Send freebsd-current mailing list submissions to
freebsd-current@freebsd.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.freebsd.org/mailman/listinfo/freebsd-current
or, via email, send a message with subject or body 'help' to
freebsd-current-request@freebsd.org
You can reach the person managing the list at
freebsd-current-owner@freebsd.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of freebsd-current digest..."
Today's Topics:
1. RE: Upgraded from 4.9 to 5.2.1, apm no longer works?
(Darren Pilgrim)
2. Re: change in ports rc.d script behaviour (Joe Marcus Clarke)
3. Re: ntpd cores (Doug White)
4. Re: ntpd cores (Randy Bush)
5. Re: magic sysrq keys functionality (M. Warner Losh)
6. Re: syntax errors in standard headers!? (Doug White)
7. Re: syntax errors in standard headers!? (Evan Dower)
8. Re: magic sysrq keys functionality (Scott Long)
9. Re: magic sysrq keys functionality (Arne Schwabe)
10. Re: syntax errors in standard headers!? (Don Lewis)
11. Re: HEADSUP gconcat(8) and gstripe(8) users! (Matthias Andree)
12. Re: magic sysrq keys functionality (Matthias Andree)
13. Re: magic sysrq keys functionality (Ion-Mihai Tetcu)
14. Questionable code in sys/dev/sound/pcm/channel.c
(Conrad J. Sabatier)
15. Re: Assertion td->td_turnstile (Randy Bush)
16. Re: Questionable code in sys/dev/sound/pcm/channel.c
(Conrad J. Sabatier)
17. Re: [amd64] Instability worse than ever (Conrad J. Sabatier)
18. Re: Questionable code in sys/dev/sound/pcm/channel.c (Don Lewis)
19. Re: magic sysrq keys functionality (Scott Long)
20. compile errors in current kernel whene locale is set to
de_DE.UTF-8 (Arne Schwabe)
21. panic from July 21 kernel (acpi related?) (Mike Hunter)
22. Re: Questionable code in sys/dev/sound/pcm/channel.c
(Conrad J. Sabatier)
23. Re: Floppy disk drive no longer detected (Nate Lawson)
24. Re: magic sysrq keys functionality (Matthias Andree)
25. Re: Questionable code in sys/dev/sound/pcm/channel.c (Don Lewis)
26. Re: magic sysrq keys functionality (Matthias Andree)
----------------------------------------------------------------------
Message: 1
Date: Mon, 26 Jul 2004 12:10:40 -0700
From: "Darren Pilgrim" <dmp@bitfreak.org>
Subject: RE: Upgraded from 4.9 to 5.2.1, apm no longer works?
To: "'Garrett Wollman'" <wollman@khavrinen.lcs.mit.edu>
Cc: current@FreeBSD.ORG
Message-ID: <000001c47344$41c92c50$132a15ac@spud>
Content-Type: text/plain; charset="us-ascii"
> From: Garrett Wollman [mailto:wollman@khavrinen.lcs.mit.edu]
>
> <<On Sat, 24 Jul 2004 10:39:21 -0700, "Darren Pilgrim"
> <dmp@bitfreak.org> said:
>
> > `init 0` is preferred because it runs /etc/rc.shutdown.
>
> In which operating system? You're certainly not talking about
> FreeBSD....
>
> > Neither are going to work, anyway, because /dev/apm isn't present.
>
> `shutdown -p' does not depend on /dev/apm.
<boot with hint.apm.0.disabled="1" and apm_enable="YES">
<error in the multi-user startup messages about /dev/apm not present>
# shutdown -p now
<init shutdown, sync, etc.>
Operating system has been halted.
Press any key to reboot.
<boot with hint.apm.0.disabled="0" and apm_enable="YES">
# shutdown -p now
<init shutdown, sync, etc.>
<machine powers off>
Shutdown doesn't directly use /dev/apm. The functionality of the -p flag
is, however, dependant on apm(8) to enable APM functions. The APM functions
only get enabled by apm(8) if /dev/apm is present.
------------------------------
Message: 2
Date: Mon, 26 Jul 2004 15:28:11 -0400
From: Joe Marcus Clarke <marcus@marcuscom.com>
Subject: Re: change in ports rc.d script behaviour
To: Mike Makonnen <mtm@identd.net>
Cc: ports@freebsd.org
Message-ID: <1090870090.6881.29.camel@shumai.marcuscom.com>
Content-Type: text/plain; charset="us-ascii"
On Mon, 2004-07-26 at 05:23, Mike Makonnen wrote:
> On Sun, Jul 25, 2004 at 05:59:26PM +0200, Oliver Eikemeier wrote:
> > Mike,
> >
> > I'm writing a rc.subr how-to, including a template and a list-style
> > check, pushing my other priorities back. It would be nice to have them
> > reviewed by you, so that we can send them to the maintainers of the
> > affected ports and give them time to fix.
>
> I have just sent portmgr fixes for all but one of the ports you mentioned
> You can also find them here: http://people.freebsd.org/~mtm/portrcd
I have forwarded this URL to every maintainer that is affected. As was
stated repeatedly on portmgr, it would be good to backout the localpkg
patch until maintainers have had a chance to evaluate these patches.
Thanks.
Joe
>
> I would be happy to review your rc.d template.
>
> Cheers.
--
PGP Key : http://www.marcuscom.com/pgp.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20040726/
4bb6ad27/attachment-0001.bin
------------------------------
Message: 3
Date: Mon, 26 Jul 2004 12:33:43 -0700 (PDT)
From: Doug White <dwhite@gumbysoft.com>
Subject: Re: ntpd cores
To: Randy Bush <randy@psg.com>
Cc: FreeBSD Current <freebsd-current@freebsd.org>
Message-ID: <20040726123203.D32820@carver.gumbysoft.com>
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Sat, 24 Jul 2004, Randy Bush wrote:
> >> i manually run
> >>
> >> roam.psg.com# netstat -nf inet | grep 123
> >> roam.psg.com# ntpd -g -p /var/run/ntpd.pid
> >>
> >> Jul 23 09:29:34 roam ntpd[35055]: mlockall(): Resource temporarily unavai
lable
> >> Jul 23 09:29:34 roam ntpd[35055]: no IPv6 interfaces found
> >> Jul 23 09:29:34 roam ntpd[35055]: bind() fd 5, family 2, port 123, addr 0
.0.0.0, in_classd=0 flags=8 fails: Address already in use
> >> Jul 23 09:29:37 roam kernel: pid 35055 (ntpd), uid 0: exited on signal 11
(core dumped)
> >
> > The coredump is kinda fun, but the "Addresss already in use" error implies
> > you're starting ntpd twice somewhere.
>
> yep. except see the netstat run just before invoking ntpd. ps shows
> the same, no prior ntpd.
netstat -n -f inet doesn't show everything. Try netstat -an.
--
Doug White | FreeBSD: The Power to Serve
dwhite@gumbysoft.com | www.FreeBSD.org
------------------------------
Message: 4
Date: Mon, 26 Jul 2004 10:02:11 -1000
From: Randy Bush <randy@psg.com>
Subject: Re: ntpd cores
To: Doug White <dwhite@gumbysoft.com>
Cc: FreeBSD Current <freebsd-current@freebsd.org>
Message-ID: <16645.25411.371759.61407@roam.psg.com>
Content-Type: text/plain; charset=us-ascii
> Return-path: <dwhite@gumbysoft.com>
> Received: from psg.com ([147.28.0.62] ident=mailnull)
> by rip.psg.com with esmtp (Exim 4.41 (FreeBSD))
> id 1BpBEG-0004ym-7n
> for randy@rip.psg.com; Mon, 26 Jul 2004 19:33:44 +0000
> Received: from [66.220.23.50] (helo=carver.gumbysoft.com)
> by psg.com with esmtp (Exim 4.41 (FreeBSD))
> id 1BpBEG-0006tb-0c
> for randy@psg.com; Mon, 26 Jul 2004 19:33:44 +0000
> Received: by carver.gumbysoft.com (Postfix, from userid 1000)
> id CBC1172DF2; Mon, 26 Jul 2004 12:33:43 -0700 (PDT)
> Received: from localhost (localhost [127.0.0.1])
> by carver.gumbysoft.com (Postfix) with ESMTP
> id C66E072DB5; Mon, 26 Jul 2004 12:33:43 -0700 (PDT)
> In-Reply-To: <16642.25974.699439.697278@roam.psg.com>
> Message-ID: <20040726123203.D32820@carver.gumbysoft.com>
> References: <16641.26585.367434.326919@roam.psg.com> <20040723185252.A5337@c
arver.gumbysoft.com>
> <16642.25974.699439.697278@roam.psg.com>
> MIME-Version: 1.0
> Content-Type: TEXT/PLAIN; charset=US-ASCII
> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on rip.psg.com
> Date: Mon, 26 Jul 2004 12:33:43 -0700 (PDT)
> From: Doug White <dwhite@gumbysoft.com>
> To: Randy Bush <randy@psg.com>
> Cc: FreeBSD Current <freebsd-current@freebsd.org>
> Subject: Re: ntpd cores
>
> On Sat, 24 Jul 2004, Randy Bush wrote:
>
> > >> i manually run
> > >>
> > >> roam.psg.com# netstat -nf inet | grep 123
> > >> roam.psg.com# ntpd -g -p /var/run/ntpd.pid
> > >>
> > >> Jul 23 09:29:34 roam ntpd[35055]: mlockall(): Resource temporarily unav
ailable
> > >> Jul 23 09:29:34 roam ntpd[35055]: no IPv6 interfaces found
> > >> Jul 23 09:29:34 roam ntpd[35055]: bind() fd 5, family 2, port 123, addr
0.0.0.0, in_classd=0 flags=8 fails: Address already in use
> > >> Jul 23 09:29:37 roam kernel: pid 35055 (ntpd), uid 0: exited on signal
11 (core dumped)
> > >
> > > The coredump is kinda fun, but the "Addresss already in use" error impli
es
> > > you're starting ntpd twice somewhere.
> >
> > yep. except see the netstat run just before invoking ntpd. ps shows
> > the same, no prior ntpd.
>
> netstat -n -f inet doesn't show everything. Try netstat -an.
>
> --
> Doug White | FreeBSD: The Power to Serve
> dwhite@gumbysoft.com | www.FreeBSD.org
<sigh>
# netstat -an
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 192.168.0.103.58614 147.28.0.41.443 ESTABLISHED
tcp4 0 0 192.168.0.103.63554 147.28.0.41.443 ESTABLISHED
tcp4 0 0 192.168.0.103.55507 209.20.186.192.22 ESTABLISHED
tcp4 0 0 192.168.0.103.64385 147.28.0.62.22 ESTABLISHED
tcp4 0 0 192.168.0.103.50412 147.28.0.62.5222 ESTABLISHED
tcp4 0 0 192.168.0.103.51749 147.28.0.254.22 ESTABLISHED
tcp4 0 0 192.168.0.103.62339 147.28.0.62.22 ESTABLISHED
tcp4 0 0 192.168.0.103.56714 147.28.0.63.22 ESTABLISHED
tcp4 0 0 192.168.0.103.50259 147.28.0.39.22 ESTABLISHED
tcp4 0 0 192.168.0.103.50002 147.28.0.5.22 ESTABLISHED
tcp4 0 0 127.0.0.1.20025 *.* LISTEN
tcp4 0 0 192.168.0.103.60663 147.28.0.39.22 ESTABLISHED
tcp4 0 0 192.168.0.103.55969 147.28.255.2.22 ESTABLISHED
tcp4 0 0 192.168.0.103.56006 147.28.0.4.22 ESTABLISHED
tcp4 0 0 192.168.0.103.57548 147.28.0.39.22 ESTABLISHED
tcp4 0 0 192.168.0.103.57598 147.28.0.39.22 ESTABLISHED
tcp4 0 0 127.0.0.1.783 *.* LISTEN
tcp4 0 0 *.25 *.* LISTEN
tcp4 0 0 127.0.0.1.953 *.* LISTEN
tcp4 0 0 127.0.0.1.53 *.* LISTEN
tcp4 0 0 *.22 *.* LISTEN
tcp4 0 0 *.515 *.* LISTEN
udp4 0 0 *.68 *.*
udp4 0 0 *.67 *.*
udp4 0 0 *.61199 *.*
udp4 0 0 127.0.0.1.53 *.*
udp4 0 0 *.514 *.*
icm4 0 0 *.* *.*
# ntpd -g -p /var/run/ntpd.pid
and syslog
Jul 26 10:01:28 roam ntpd[62483]: mlockall(): Resource temporarily unavailable
Jul 26 10:01:28 roam ntpd[62483]: no IPv6 interfaces found
Jul 26 10:01:28 roam ntpd[62483]: bind() fd 6, family 2, port 123, addr 0.0.0.
0, in_classd=0 flags=8 fails: Address already in use
Jul 26 10:01:31 roam kernel: pid 62483 (ntpd), uid 0: exited on signal 11 (cor
e dumped)
randy
------------------------------
Message: 5
Date: Mon, 26 Jul 2004 14:02:54 -0600 (MDT)
From: "M. Warner Losh" <imp@bsdimp.com>
Subject: Re: magic sysrq keys functionality
To: green@freebsd.org
Cc: scottl@freebsd.org
Message-ID: <20040726.140254.88474690.imp@bsdimp.com>
Content-Type: Text/Plain; charset=us-ascii
In message: <20040726191004.GC96815@green.homeunix.org>
Brian Fundakowski Feldman <green@freebsd.org> writes:
: On Mon, Jul 26, 2004 at 12:54:39PM -0600, Scott Long wrote:
: > On Mon, 26 Jul 2004, Brian Fundakowski Feldman wrote:
: > > I think it would be prudent to add a nice fat "WARNING:" printf to the
: > > boot process. It's really not obvious that FreeBSD defaults to having
: > > your hard drives run "unsafely," even though it is usually faster.
: > >
: >
: > I think that this was discussed too. The problem is that Linux and
: > Windows also silently default to having it on, and breaking from that
: > status quo causes too much haertburn.
:
: The status quo of FreeBSD and Linux shouldn't really apply to FreeBSD...
: we're supposed to be about stability and correctness.
And we're also not supposed to get into stupid, absolute arguments.
All disk media is unsafe to some degree or another. It is the degree
of the unsafeness that can be controlled. To pretend otherwise, and
yell about how 'unsafe' it is really is counter productive. The
current setting represents a compromise between many competing factors
and now is not the time to reopen the debate. We've fought this war,
it is resolved. Time to move on.
Warner
------------------------------
Message: 6
Date: Mon, 26 Jul 2004 13:10:32 -0700 (PDT)
From: Doug White <dwhite@gumbysoft.com>
Subject: Re: syntax errors in standard headers!?
To: Evan Dower <evantd@hotmail.com>
Cc: freebsd-current@freebsd.org
Message-ID: <20040726130939.J32820@carver.gumbysoft.com>
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Sat, 24 Jul 2004, Evan Dower wrote:
> WIth the instability issues of late, I recently had a crash in the middle of
> portupgrading. This left many packages with no +CONTENTS file. Thus I
> figured I would simply reinstall them. Unfortunately when I try to reinstall
> any of them I tend to get errors such as:
> /usr/include/stdlib.h:46: error: syntax error before "typedef"
> and
> /usr/include/locale.h:42: error: syntax error before "struct"
>
> I get all kinds of other errors too. Basically not a whole lot is working
> properly, even though I have updated -CURRENT since the crash. Most recently
> on Thursday.
Some port's .h file probably got corrupted and its leaving things in an
insconsistent state when the system headers come along. Inspect a file
that doesn't compile and trace the included files to find the corrupted
one.
--
Doug White | FreeBSD: The Power to Serve
dwhite@gumbysoft.com | www.FreeBSD.org
------------------------------
Message: 7
Date: Mon, 26 Jul 2004 13:15:24 -0700
From: "Evan Dower" <evantd@hotmail.com>
Subject: Re: syntax errors in standard headers!?
To: dwhite@gumbysoft.com
Cc: freebsd-current@freebsd.org
Message-ID: <BAY8-F86M4OF7vN5xfs0002d183@hotmail.com>
Content-Type: text/plain; format=flowed
I managed to "fix" things by doing the following:
cvsup
build & install new world & kernel
restore /var/db/pkg from a backup just before all my package info got
corrupted
After that, everything seems to be able to build again. I could have sworn
that I had already updated the world and kernel a couple times since the
corruption, but perhaps my memory failed me.
Thanks very much for the time, response, and advice,
--
Evan Dower
Undergraduate, Computer Science
University of Washington
Public key: http://students.washington.edu/evantd/pgp-pub-key.txt
Key fingerprint = D321 FA24 4BDA F82D 53A9 5B27 7D15 5A4F 033F 887D
>From: Doug White <dwhite@gumbysoft.com>
>To: Evan Dower <evantd@hotmail.com>
>CC: freebsd-current@freebsd.org
>Subject: Re: syntax errors in standard headers!?
>Date: Mon, 26 Jul 2004 13:10:32 -0700 (PDT)
>
>On Sat, 24 Jul 2004, Evan Dower wrote:
>
> > WIth the instability issues of late, I recently had a crash in the
>middle of
> > portupgrading. This left many packages with no +CONTENTS file. Thus I
> > figured I would simply reinstall them. Unfortunately when I try to
>reinstall
> > any of them I tend to get errors such as:
> > /usr/include/stdlib.h:46: error: syntax error before "typedef"
> > and
> > /usr/include/locale.h:42: error: syntax error before "struct"
> >
> > I get all kinds of other errors too. Basically not a whole lot is
>working
> > properly, even though I have updated -CURRENT since the crash. Most
>recently
> > on Thursday.
>
>Some port's .h file probably got corrupted and its leaving things in an
>insconsistent state when the system headers come along. Inspect a file
>that doesn't compile and trace the included files to find the corrupted
>one.
>
>--
>Doug White | FreeBSD: The Power to Serve
>dwhite@gumbysoft.com | www.FreeBSD.org
_________________________________________________________________
Don�t just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/
------------------------------
Message: 8
Date: Mon, 26 Jul 2004 14:42:15 -0600 (MDT)
From: Scott Long <scottl@freebsd.org>
Subject: Re: magic sysrq keys functionality
To: Brian Fundakowski Feldman <green@freebsd.org>
Cc: current@freebsd.org
Message-ID: <20040726143916.X32601@pooker.samsco.org>
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Mon, 26 Jul 2004, Brian Fundakowski Feldman wrote:
> On Mon, Jul 26, 2004 at 12:54:39PM -0600, Scott Long wrote:
> > On Mon, 26 Jul 2004, Brian Fundakowski Feldman wrote:
> > > I think it would be prudent to add a nice fat "WARNING:" printf to the
> > > boot process. It's really not obvious that FreeBSD defaults to having
> > > your hard drives run "unsafely," even though it is usually faster.
> > >
> >
> > I think that this was discussed too. The problem is that Linux and
> > Windows also silently default to having it on, and breaking from that
> > status quo causes too much haertburn.
>
> The status quo of FreeBSD and Linux shouldn't really apply to FreeBSD...
> we're supposed to be about stability and correctness.
>
Whoa there. What part of 'biblically bad things happen when you change
this' did you not understand? Go look in the email archives to see the
previous discussion. In short, I agree that it's not ideal, but I don't
agree that your assertion that it must be changed. Not everything is
black and white here.
Scott
------------------------------
Message: 9
Date: Mon, 26 Jul 2004 23:01:15 +0200
From: Arne Schwabe <arne@rfc2549.org>
Subject: Re: magic sysrq keys functionality
To: Brian Fundakowski Feldman <green@freebsd.org>
Cc: Scott Long <scottl@freebsd.org>
Message-ID: <86wu0qxz38.fsf@kamino.rfc1149.org>
Content-Type: text/plain; charset=us-ascii
Brian Fundakowski Feldman <green@freebsd.org> writes:
> On Mon, Jul 26, 2004 at 12:54:39PM -0600, Scott Long wrote:
>> On Mon, 26 Jul 2004, Brian Fundakowski Feldman wrote:
>> > I think it would be prudent to add a nice fat "WARNING:" printf to the
>> > boot process. It's really not obvious that FreeBSD defaults to having
>> > your hard drives run "unsafely," even though it is usually faster.
>> >
>>
>> I think that this was discussed too. The problem is that Linux and
>> Windows also silently default to having it on, and breaking from that
>> status quo causes too much haertburn.
>
> The status quo of FreeBSD and Linux shouldn't really apply to FreeBSD...
> we're supposed to be about stability and correctness.
Solaris on Sparc (don't know about i386) has a nice way of doing this,
it also does _not_ sync your disk in case of a panic but you call sync
from the OpenBoot Prompt.
[insert a OpenBoot is better than i386 bios flame here]
Arne
--
compiling millions of tiny c-programs...done
checking for a working configure script... not found
------------------------------
Message: 10
Date: Mon, 26 Jul 2004 14:03:00 -0700 (PDT)
From: Don Lewis <truckman@FreeBSD.org>
Subject: Re: syntax errors in standard headers!?
To: dwhite@gumbysoft.com
Cc: freebsd-current@FreeBSD.org
Message-ID: <200407262103.i6QL30Uj058231@gw.catspoiler.org>
Content-Type: TEXT/plain; charset=us-ascii
On 26 Jul, Doug White wrote:
> On Sat, 24 Jul 2004, Evan Dower wrote:
>
>> WIth the instability issues of late, I recently had a crash in the middle o
f
>> portupgrading. This left many packages with no +CONTENTS file. Thus I
>> figured I would simply reinstall them. Unfortunately when I try to reinstal
l
>> any of them I tend to get errors such as:
>> /usr/include/stdlib.h:46: error: syntax error before "typedef"
>> and
>> /usr/include/locale.h:42: error: syntax error before "struct"
>>
>> I get all kinds of other errors too. Basically not a whole lot is working
>> properly, even though I have updated -CURRENT since the crash. Most recentl
y
>> on Thursday.
>
> Some port's .h file probably got corrupted and its leaving things in an
> insconsistent state when the system headers come along. Inspect a file
> that doesn't compile and trace the included files to find the corrupted
> one.
gcc's -E option comes in very handy for debugging problems like this.
Direct the package build output to a file.
Go to the directory that the compiler was running in when it
croaked.
Execute the compiler command that croaked, with the addition of
the -E option, and the removal of the -o outputfile option.
You'll probably want to redirect the output to a file.
The -C and -dD options may also be helpful.
------------------------------
Message: 11
Date: Mon, 26 Jul 2004 23:06:15 +0200
From: Matthias Andree <ma@dt.e-technik.uni-dortmund.de>
Subject: Re: HEADSUP gconcat(8) and gstripe(8) users!
To: Pawel Jakub Dawidek <pjd@FreeBSD.org>
Cc: freebsd-current@freebsd.org
Message-ID: <m3llh6lbqw.fsf@merlin.emma.line.org>
Content-Type: text/plain; charset=us-ascii
Pawel Jakub Dawidek <pjd@FreeBSD.org> writes:
> I'm going to change provider's naming tomorrow.
> The old (current) naming is: /dev/<name>.concat and /dev/<name>.stripe.
> The new one is going to be: /dev/concat/<name> and /dev/stripe/<name>.
>
> So, dear user, if your are using gconcat(8) or gstripe(8) don't forget
> to change your /etc/fstab after upgreading the system.
I wonder if "make installworld" should display such warnings (or head
/usr/src/UPDATING FWIW) and give the user a chance to abort the
installation.
--
Matthias Andree
Encrypted mail welcome: my GnuPG key ID is 0x052E7D95 (PGP/MIME preferred)
------------------------------
Message: 12
Date: Mon, 26 Jul 2004 23:13:03 +0200
From: Matthias Andree <ma@dt.e-technik.uni-dortmund.de>
Subject: Re: magic sysrq keys functionality
To: Scott Long <scottl@freebsd.org>
Cc: current@freebsd.org
Message-ID: <m3hdrulbfk.fsf@merlin.emma.line.org>
Content-Type: text/plain; charset=us-ascii
Scott Long <scottl@freebsd.org> writes:
> GAH! No, please don't start this war again! The last time that we tried
> turning this off in a release (4.1 IIRC), were were plagqued by months of
> earthquakes, plagues, and deaths of first-born youngsters. I 100% agree
> that write caching in ATA is not compatible with data integrety, but the
> ATA marketting machine has convinced us that cached+untagged speed is
> better than uncached+tagged safety. C'est la vie, or so they say here.
Looking out of the cosy FreeBSD hut, for the Linux kernel, write barrier
support (i. e. using the ATA cache flush facility on those drives that
support it, and logging a warning if a drive doesn't) to enforce proper
write order and synchronization is underway, with some distros already
using it, for instance SuSE. It's not yet in the baseline code AFAIK.
BTW, is proper write order guaranteed on SCSI drives through ordered
tags? softdep doesn't really like blocks being written in different
order than scheduled.
--
Matthias Andree
Encrypted mail welcome: my GnuPG key ID is 0x052E7D95 (PGP/MIME preferred)
------------------------------
Message: 13
Date: Tue, 27 Jul 2004 00:24:53 +0300
From: Ion-Mihai Tetcu <itetcu@people.tecnik93.com>
Subject: Re: magic sysrq keys functionality
To: "Kevin Oberman" <oberman@es.net>
Cc: freebsd-current@freebsd.org
Message-ID: <20040727002453.063749d6@it.buh.tecnik93.com>
Content-Type: text/plain; charset=US-ASCII
On Mon, 26 Jul 2004 12:00:39 -0700
"Kevin Oberman" <oberman@es.net> wrote:
> > From: bugghy <bugghy@home.ro>
> > Date: Mon, 26 Jul 2004 21:53:02 +0000
> > Sender: owner-freebsd-current@freebsd.org
> >
> >
> >
> > So, what would be a convenient way to protect a 5.x release against
> > data loss / corruption in case of frequent powerfaillures. (a software
> > method)
>
> Turn off write-cache on the disks. hw.ata.wc="0" in /boot/loader.conf
> (But be prepared to suffer the consequences to disk performance.)
You could also lower the interval the filesystem date is sync'ed to disk,
from the default 30,29,28 e.g. in /boot/loader/conf:
kern.filedelay="15"
kern.dirdelay="14"
kern.metadelay="13"
Of course, the disk performance will suffer even more.
--
IOnut
Unregistered ;) FreeBSD "user"
------------------------------
Message: 14
Date: Mon, 26 Jul 2004 16:35:29 -0500 (CDT)
From: "Conrad J. Sabatier" <conrads@cox.net>
Subject: Questionable code in sys/dev/sound/pcm/channel.c
To: freebsd-current@freebsd.org
Message-ID: <XFMail.20040726163529.conrads@cox.net>
Content-Type: text/plain; charset=us-ascii
I'm a little perplexed at the following bit of logic in chn_write()
(which is where the "interrupt timeout, channel dead" messages are
being generated).
Within an else branch within the main while loop, we have:
else {
timeout = (hz * sndbuf_getblksz(bs)) /
(sndbuf_getspd(bs) * sndbuf_getbps(bs));
if (timeout < 1)
timeout = 1;
timeout = 1;
Why the formulaic calculation of timeout, if it's simply going to be
unconditionally set to 1 immediately afterwards anyway? What's going on
here?
Also, at the end of the function:
if (count <= 0) {
c->flags |= CHN_F_DEAD;
printf("%s: play interrupt timeout, channel dead\n", c->name);
}
return ret;
}
Could it be that the conditional test is wrong here? Perhaps
we should be using (count < 0) instead?
I don't know. I'm having no small difficulty understanding this code,
but these two items caught my attention.
--
Conrad J. Sabatier <conrads@cox.net> -- "In Unix veritas"
------------------------------
Message: 15
Date: Mon, 26 Jul 2004 11:45:06 -1000
From: Randy Bush <randy@psg.com>
Subject: Re: Assertion td->td_turnstile
To: FreeBSD Current <freebsd-current@freebsd.org>
Message-ID: <16645.31586.86585.328376@roam.psg.com>
Content-Type: text/plain; charset=us-ascii
> current as of an hour ago
> smp
>
>
> panic: Assertion td->td_turnstile != NULL failed at /usr/src/sys/kern/subr_t
urnstile.c:478
> cpuid = 0;
> KDB: enter: panic
> [thread 100340]
> Stopped at kdb_enter+0x30: movl %ebp,%esp
> db> trace
> kdb_enter(c05f8022,0,c05f4cb4,df14faa8,100) at kdb_enter+0x30
> panic(c05f4cb4,c05fb006,c05fadea,1de,c064d588) at panic+0x156
> turnstile_wait(c2142a00,c0642980,c27b89a0,20e,c26d4dc0) at turnstile_wait+0x
2ac
> _mtx_lock_sleep(c0642980,0,c05f4d75,cc,c26d4dc0) at _mtx_lock_sleep+0x195
> _mtx_lock_flags(c0642980,0,c05f4d75,cc,1) at _mtx_lock_flags+0xb2
> cv_wait_sig(c0672e24,c0672e00,c05fbc70,2ee,4) at cv_wait_sig+0x2f4
> kern_select(c26d4dc0,4,bfbfed10,0,0) at kern_select+0x516
> select(c26d4dc0,df14fd14,14,431,5) at select+0x66
> syscall(835002f,2f,a7f002f,835b000,0) at syscall+0x2a0
> Xint0x80_syscall() at Xint0x80_syscall+0x1f
> --- syscall (93, FreeBSD ELF32, select), eip = 0x284e3fbf, esp = 0xbfbfe8bc,
ebp = 0xbfbfe8f8 ---
> db>
reproduces with non-smp kernel
filed kern/69629
randy
------------------------------
Message: 16
Date: Mon, 26 Jul 2004 16:47:09 -0500 (CDT)
From: "Conrad J. Sabatier" <conrads@cox.net>
Subject: Re: Questionable code in sys/dev/sound/pcm/channel.c
To: freebsd-current@freebsd.org
Message-ID: <XFMail.20040726164709.conrads@cox.net>
Content-Type: text/plain; charset=us-ascii
On 26-Jul-2004 Conrad J. Sabatier wrote:
> I'm a little perplexed at the following bit of logic in chn_write()
> (which is where the "interrupt timeout, channel dead" messages are
> being generated).
>
> Within an else branch within the main while loop, we have:
>
> else {
> timeout = (hz * sndbuf_getblksz(bs)) /
> (sndbuf_getspd(bs) * sndbuf_getbps(bs));
> if (timeout < 1)
> timeout = 1;
> timeout = 1;
>
> Why the formulaic calculation of timeout, if it's simply going to be
> unconditionally set to 1 immediately afterwards anyway? What's going
> on here?
>
> Also, at the end of the function:
>
> if (count <= 0) {
> c->flags |= CHN_F_DEAD;
> printf("%s: play interrupt timeout, channel dead\n",
> c->name);
> }
>
> return ret;
> }
>
> Could it be that the conditional test is wrong here? Perhaps
> we should be using (count < 0) instead?
I'm now running a kernel built with this last conditional test changed
to "if (count < 0)" and sound is still working OK. Have yet to see if
this eliminates the interrupt timeout messages. Perhaps a few other
people might try it and see?
I still don't know what to make of the earlier business with the
setting of "timeout". Looks to me like something that just got
overlooked in the course of a series of edits.
--
Conrad J. Sabatier <conrads@cox.net> -- "In Unix veritas"
------------------------------
Message: 17
Date: Mon, 26 Jul 2004 16:51:31 -0500 (CDT)
From: "Conrad J. Sabatier" <conrads@cox.net>
Subject: Re: [amd64] Instability worse than ever
To: Brian Fundakowski Feldman <green@freebsd.org>
Cc: freebsd-current@freebsd.org
Message-ID: <XFMail.20040726165131.conrads@cox.net>
Content-Type: text/plain; charset=us-ascii
On 26-Jul-2004 Brian Fundakowski Feldman wrote:
> On Mon, Jul 26, 2004 at 06:58:23AM -0500, Conrad J. Sabatier wrote:
>>
>> OK, I've built a new kernel (after cvsup) with INVARIANTS and
>> WITNESS enabled, and double-checked my serial debugging setup,
>> however, it's just occurred to me that this probably isn't going to
>> help very much in this particular situation, as I already had
>> debug.debugger_on_panic enabled, and the system still just went
>> directly to a reboot, bypassing the debugger altogether.
>
> Were you running X? It is recognized that the console is
> "unavailable" when running X, and if no consoles are available,
> debug.debugger_on_panic has no effect.
Ah, OK. That would explain that. :-)
--
Conrad J. Sabatier <conrads@cox.net> -- "In Unix veritas"
------------------------------
Message: 18
Date: Mon, 26 Jul 2004 14:55:23 -0700 (PDT)
From: Don Lewis <truckman@FreeBSD.org>
Subject: Re: Questionable code in sys/dev/sound/pcm/channel.c
To: conrads@cox.net
Cc: freebsd-current@FreeBSD.org
Message-ID: <200407262155.i6QLtNuZ058373@gw.catspoiler.org>
Content-Type: TEXT/plain; charset=us-ascii
On 26 Jul, Conrad J. Sabatier wrote:
> I'm a little perplexed at the following bit of logic in chn_write()
> (which is where the "interrupt timeout, channel dead" messages are
> being generated).
>
> Within an else branch within the main while loop, we have:
>
> else {
> timeout = (hz * sndbuf_getblksz(bs)) /
> (sndbuf_getspd(bs) * sndbuf_getbps(bs));
> if (timeout < 1)
> timeout = 1;
> timeout = 1;
>
> Why the formulaic calculation of timeout, if it's simply going to be
> unconditionally set to 1 immediately afterwards anyway? What's going on
> here?
Hmn, looks bogus to me. I think the intention is to round timeout up to
1 if the result of the formula is zero. The final assignment statement
looks bogus to me. Maybe a too short timeout is the source of this
problem.
It looks like this assignment appeared in rev 1.65.
> Also, at the end of the function:
>
> if (count <= 0) {
> c->flags |= CHN_F_DEAD;
> printf("%s: play interrupt timeout, channel dead\n", c->name);
> }
>
> return ret;
> }
>
> Could it be that the conditional test is wrong here? Perhaps
> we should be using (count < 0) instead?
>
> I don't know. I'm having no small difficulty understanding this code,
> but these two items caught my attention.
I ran into the same problem when I was looking at the code a few days
ago.
BTW, the trace output that was posted showed write() returning 0
immediately before the failure occurred.
------------------------------
Message: 19
Date: Mon, 26 Jul 2004 16:06:33 -0600 (MDT)
From: Scott Long <scottl@freebsd.org>
Subject: Re: magic sysrq keys functionality
To: Matthias Andree <ma@dt.e-technik.uni-dortmund.de>
Cc: current@freebsd.org
Message-ID: <20040726155712.R32601@pooker.samsco.org>
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Mon, 26 Jul 2004, Matthias Andree wrote:
> Scott Long <scottl@freebsd.org> writes:
>
> > GAH! No, please don't start this war again! The last time that we tried
> > turning this off in a release (4.1 IIRC), were were plagqued by months of
> > earthquakes, plagues, and deaths of first-born youngsters. I 100% agree
> > that write caching in ATA is not compatible with data integrety, but the
> > ATA marketting machine has convinced us that cached+untagged speed is
> > better than uncached+tagged safety. C'est la vie, or so they say here.
>
> Looking out of the cosy FreeBSD hut, for the Linux kernel, write barrier
> support (i. e. using the ATA cache flush facility on those drives that
> support it, and logging a warning if a drive doesn't) to enforce proper
> write order and synchronization is underway, with some distros already
> using it, for instance SuSE. It's not yet in the baseline code AFAIK.
>
> BTW, is proper write order guaranteed on SCSI drives through ordered
> tags? softdep doesn't really like blocks being written in different
> order than scheduled.
>
I don't believe that any order is guaranteed. FreeBSD used to have the
concept of a B_ORDERED bio flag that would help order the bioq, but it was
removed early in the 5-current cycle due to apparent non-use. It's tough
to rely on ATA Flush Cache since many devices exist that advertise it but
don't actually support it (i.e. they lock up if you try it). SCSI
certainly supports it, but again it was information that was never getting
to the device. Some SCSI drivers compensate by sending periodic ordered
tags to help decrease the chances for an out-of-order commit, but it's
still a small gamble. This works right now because we assume that disks
will commit blocks in order, and that assumption generally hasn't been
broken. If legacy ATA were to drop off the face of the earth and drive
makers were to commit to producing honest and non-buggy firmware, I'd love
to bring back B_ORDERED and make it actually work.
Scott
------------------------------
Message: 20
Date: Tue, 27 Jul 2004 00:00:20 +0200
From: Arne Schwabe <arne@rfc2549.org>
Subject: compile errors in current kernel whene locale is set to
de_DE.UTF-8
To: freebsd-current@freebsd.org
Message-ID: <86smbexwcr.fsf@kamino.rfc1149.org>
Content-Type: text/plain; charset="iso-2022-jp-2"
Hi,
In file included from /usr/src/sys/i386/acpica/acpi_wakeup.c:53:
acpi_wakecode.h:2:81: invalid suffix "x" on integer constant
In file included from /usr/src/sys/i386/acpica/acpi_wakeup.c:53:
acpi_wakecode.h:2: error: syntax error before '.' token
acpi_wakecode.h:2: error: stray '\372' in program
acpi_wakecode.h:2: error: stray '\310' in program
acpi_wakecode.h:2: error: stray '\330' in program
acpi_wakecode.h:2: error: stray '\320' in program
acpi_wakecode.h:2: error: stray '\274' in program
acpi_wakecode.h:2:181: invalid suffix "x" on integer constant
acpi_wakecode.h:2: error: `t' undeclared here (not in a function)
acpi_wakecode.h:2: error: syntax error before '...' token
acpi_wakecode.h:2: error: stray '\300' in program
acpi_wakecode.h:2: error: stray '\310' in program
acpi_wakecode.h:2: error: stray '\330' in program
acpi_wakecode.h:2: error: stray '\320' in program
acpi_wakecode.h:2:281: invalid suffix "x" on integer constant
acpi_wakecode.h:2: error: `P' undeclared here (not in a function)
[more noise like this]
% head modules/usr/src/sys/modules/acpi/acpi/acpi_wakecode.h
static char wakecode[] = {
0x90,0xfa,0x8c,0xc8,0x8e,0xd8,0x8e,0xd0,0xbc,0x00,0x10,0x83,0x3e,0x66,0x01,0x0
0,0x|.%G.ANoN?N=%@.%GNoN?N=%@.%GNoN?N=%@.$B'^(B...>f..,0x74,
0x0b,0x9a,0x03,0x00,0x00,0xc0,0x8c,0xc8,0x8e,0xd8,0x8e,0xd0,0x0f,0x01,0x16,0x|
t.....%GNoN?N=%@.%GNoN?N=%@.%GNoN?N=%@.%GNoN?N=%@...,0x50,
0x01,0x66,0xa1,0x5a,0x01,0x0f,0x22,0xd0,0x66,0xa1,0x5e,0x01,0x0f,0x22,0xd8,0x|
P.f%GNoN?N=%@Z.."%GNoN?N=%@f%GNoN?N=%@^.."%GNoN?N=%@,0x66,
0xa1,0x62,0x01,0x0f,0x22,0xe0,0x66,0xa1,0x8a,0x01,0x66,0xa3,0xb4,0x00,0x66,0x|
f%GNoN?N=%@b.."%GNoN?N=%@f%GNoN?N=%@..f%GNoN?N=NoN?N=%@
.f,0xa1,0x86,0x01,0x66,0xa3,0xb9,0x00,0x66,0xa1,0x82,0x01,0x66,0xa3,0xbe,0x00,
0x66,0x|%GNoN?N=%@..f%GNoN?N=NoN?N=%@.f%GNoN?N=%@..f%GNoN
?N=NoN?N=%@.f,0xa1,0x52,0x01,0x66,0xa3,0xc3,0x
% locale
LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES=C
LC_ALL=
when I have LANG=C (then everything is =C" the kernel compiles without
problems.
kernel config is attached.
kernel sources/world are 1-2 days old.
Arne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kamino
Type: application/octet-stream
Size: 14816 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20040727/
049dd669/kamino-0001.obj
------------------------------
Message: 21
Date: Mon, 26 Jul 2004 15:01:18 -0700
From: Mike Hunter <mhunter@ack.Berkeley.EDU>
Subject: panic from July 21 kernel (acpi related?)
To: freebsd-current@freebsd.org
Message-ID: <20040726220118.GA27472@ack.Berkeley.EDU>
Content-Type: text/plain; charset=us-ascii
Hi,
I upgraded my kernel recently:
FreeBSD fark.com 5.2-CURRENT FreeBSD 5.2-CURRENT #2: Wed
Jul 21 17:17:10 PDT 2004 root@fark.com:/usr/obj/usr/src/sys/fark i386
Unfortunately it seems like a problem from April is still with me.
It's really weird; when I boot my laptop with a MS USB keyboard and a
logitech usb mouse (and external monitor hooked into the back) on wall
power, this crash never happens. But I got the crash below on wall power,
without the mouse. It seems like loading without acpi gives better luck,
but I've had it crash without acpi also. Seems like folk-lore evidence;
so maybe there's some factor I'm missing.
Not using the custom DSDT.aml didn't change anything. My system is a dell
d800 with bios rev a9.
Please let me know if I can provide more info.
>From memory: (just kidding; hand transcribed...lots of typos and
can't-read-my-own-writing stuff :) )
..
starting bg fsystem checks
Monday July 26 2004
memory modifies after free 0xc1cfc900 (508) val=1000100@0xc1cfc900
Fatal trap 12: page fault while in kernel mode
fault v address 0x1000120
fault code supervisor read, page not present
ins ptr 0x8:0xc0731146
stack 0x10:0xd5378984
frameptr 0x10 0xd5378990
code reg base 0x0 lim 0xfffffff type 0x1b ddl 0 pres 1 det321 gvan 1
proc interrupt enaled ralone iopl=0
current process = 489 (init)
[thr 1000 sn]
db> tr
stoped at mtrash_ctor +0x39 movb 0x20 (%eax), %eax
mtrash_ctor(clcfc900,200,0) mtrash_ctor 0x39
uma_zalloc_arg(c10446c0,0,2) uma_zalloc_arg + 0x124
malloc(188, c081960, 2, 3, c1d06580) uma_zalloc_arg 0x124
elf32_load_file(c1ddb1be, d3f6d0f4, d5378ab0, d5378bd0, 1000) at 0x4c7
kern_execve...
syscall...
xinit0x80_syscall...
syscall((..., f...32, execcve, exp=0x803183c, esp=0xb8bfed7e, ebc=0xbfbfedf8)
------------------------------
Message: 22
Date: Mon, 26 Jul 2004 17:15:24 -0500 (CDT)
From: "Conrad J. Sabatier" <conrads@cox.net>
Subject: Re: Questionable code in sys/dev/sound/pcm/channel.c
To: Don Lewis <truckman@FreeBSD.org>
Cc: freebsd-current@FreeBSD.org
Message-ID: <XFMail.20040726171524.conrads@cox.net>
Content-Type: text/plain; charset=us-ascii
On 26-Jul-2004 Don Lewis wrote:
> On 26 Jul, Conrad J. Sabatier wrote:
>> I'm a little perplexed at the following bit of logic in chn_write()
>> (which is where the "interrupt timeout, channel dead" messages are
>> being generated).
>>
>> Within an else branch within the main while loop, we have:
>>
>> else {
>> timeout = (hz * sndbuf_getblksz(bs)) /
>> (sndbuf_getspd(bs) * sndbuf_getbps(bs));
>> if (timeout < 1)
>> timeout = 1;
>> timeout = 1;
>>
>> Why the formulaic calculation of timeout, if it's simply going to be
>> unconditionally set to 1 immediately afterwards anyway? What's
>> going on
>> here?
>
> Hmn, looks bogus to me. I think the intention is to round timeout up
> to 1 if the result of the formula is zero. The final assignment
> statement looks bogus to me. Maybe a too short timeout is the
> source of this problem.
>
> It looks like this assignment appeared in rev 1.65.
Hmm, your guess is as good as (or probably better than) mine. :-)
A little more in the way of comments certainly wouldn't hurt.
>> Also, at the end of the function:
>>
>> if (count <= 0) {
>> c->flags |= CHN_F_DEAD;
>> printf("%s: play interrupt timeout, channel dead\n",
>> c->name);
>> }
>>
>> return ret;
>> }
>>
>> Could it be that the conditional test is wrong here? Perhaps
>> we should be using (count < 0) instead?
>>
>> I don't know. I'm having no small difficulty understanding this
>> code, but these two items caught my attention.
>
> I ran into the same problem when I was looking at the code a few days
> ago.
>
> BTW, the trace output that was posted showed write() returning 0
> immediately before the failure occurred.
Are you referring to the truss output I posted a few days ago? The
thing of it is, though, that the original "channel dead" message had
already occurred in a previous run of madplay (which wasn't traced), so
it's really hard to say if there's any useful info to be obtained from
tracing a later run, after the pcm device was already "broken".
So far, I still haven't gotten the error with the new kernel I'm
testing. I wouldn't say absolutely that that single patch (of the
final conditional test) is "the fix", but it may help in the meantime.
--
Conrad J. Sabatier <conrads@cox.net> -- "In Unix veritas"
------------------------------
Message: 23
Date: Mon, 26 Jul 2004 15:20:35 -0700
From: Nate Lawson <nate@root.org>
Subject: Re: Floppy disk drive no longer detected
To: Tim Robbins <tjr@freebsd.org>
Cc: current@freebsd.org
Message-ID: <410583B3.4000104@root.org>
Content-Type: text/plain; charset="us-ascii"
Tim Robbins wrote:
> On Mon, Jul 26, 2004 at 12:13:26PM +1000, Tim Robbins wrote:
>>My floppy disk drive is no longer probed correctly by -CURRENT. I get the
>>following message, but none about fd0 (and /dev/fd0 does not exist):
>>
>>fdc0: <floppy drive controller (FDE)> port 0x3f7,0x3f0-0x3f5 irq 6 drq 2 on
acpi0
>>
>>Previously it probed as:
>>
>>fdc0: <Enhanced floppy controller (i82077, NE72065 or clone)> port 0x3f7,0x3
f0-0x3f5 irq 6 drq 2 on acpi0
>>fdc0: FIFO enabled, 8 bytes threshold
>>fd0: <1440-KB 3.5" drive> on fdc0 drive 0
>>
>>The ACPI DSDT for this system is available at:
>>http://people.freebsd.org/~tjr/k8v.txt.bz2
>
> Ok, it looks like the FDC device should have a child device for each drive,
> but my system's DSDT has none. Could we work around this in the driver by
> not using _FDE/_FDI to probe unless the FDC device has at least 1 child with
> an _FDI object, or should we add an entry to the quirks table for this
> particular BIOS instead?
Ok, below is a patch to address this. There are two things this fixes. The
first, which I think Marcel's laptop had from the dmesg I saw, is that _FDI is
not required so a system may have child devices of FDC that lack an _FDI
method. The second is Tim's bug, where _FDE is present on the FDC but there
are no children. We handle this with a second pass after the namespace walk
to add missing devices indicated as present by _FDE but not represented in the
namespace. I also noticed that his ASL uses a non-standard approach to _FDE
but one that is compatible with the standard so I fixed this also.
Please test.
-Nate
-------------- next part --------------
Index: fdc_acpi.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/fdc/fdc_acpi.c,v
retrieving revision 1.1
diff -u -r1.1 fdc_acpi.c
--- fdc_acpi.c 15 Jul 2004 16:38:07 -0000 1.1
+++ fdc_acpi.c 26 Jul 2004 22:12:06 -0000
@@ -42,21 +42,31 @@
static int fdc_acpi_probe(device_t dev);
static int fdc_acpi_attach(device_t dev);
+static int fdc_acpi_probe_children(device_t bus, device_t dev,
+ void *fde);
static ACPI_STATUS fdc_acpi_probe_child(ACPI_HANDLE h, device_t *dev,
int level, void *arg);
static void fdctl_wr_acpi(fdc_p fdc, u_int8_t v);
-/* Parameters for the tape drive (5th device). */
-#define ACPI_TAPE_UNKNOWN 0
-#define ACPI_TAPE_PRESENT 1
-#define ACPI_TAPE_NEVER_PRESENT 2
+/* Maximum number of child devices of a controller (4 floppy + 1 tape.) */
+#define ACPI_FDC_MAXDEVS 5
+
+/*
+ * Parameters for the tape drive (5th device). Some BIOS authors use this
+ * for all drives, not just the tape drive (e.g., ASUS K8V). This isn't
+ * grossly incompatible with the spec since it says the first four devices
+ * are simple booleans.
+ */
+#define ACPI_FD_UNKNOWN 0
+#define ACPI_FD_PRESENT 1
+#define ACPI_FD_NEVER_PRESENT 2
/* Temporary buf length for evaluating _FDE and _FDI. */
#define ACPI_FDC_BUFLEN 1024
/* Context for walking FDC child devices. */
struct fdc_walk_ctx {
- uint32_t fd_present[5];
+ uint32_t fd_present[ACPI_FDC_MAXDEVS];
int index;
device_t acpi_dev;
device_t dev;
@@ -88,7 +98,6 @@
static int
fdc_acpi_attach(device_t dev)
{
- struct fdc_walk_ctx *ctx;
struct fdc_data *sc;
ACPI_BUFFER buf;
device_t bus;
@@ -144,30 +153,10 @@
* this fails, fall back to the ISA hints-based probe method.
*/
bus = device_get_parent(dev);
- if (ACPI_SUCCESS(ACPI_EVALUATE_OBJECT(bus, dev, "_FDE", NULL, &buf))) {
- /* Setup the context and walk all child devices. */
- ctx = malloc(sizeof(struct fdc_walk_ctx), M_TEMP, M_NOWAIT);
- if (ctx == NULL) {
- device_printf(dev, "no memory for walking children\n");
- goto out;
- }
- bcopy(buf.Pointer, ctx->fd_present, sizeof(ctx->fd_present));
- ctx->index = 0;
- ctx->dev = dev;
- ctx->acpi_dev = bus;
- ACPI_SCAN_CHILDREN(ctx->acpi_dev, dev, 1, fdc_acpi_probe_child,
- ctx);
- free(ctx, M_TEMP);
-
- /* Attach any children found during the probe. */
- error = bus_generic_attach(dev);
- if (error != 0)
- goto out;
- } else {
+ if (ACPI_SUCCESS(ACPI_EVALUATE_OBJECT(bus, dev, "_FDE", NULL, &buf)))
+ error = fdc_acpi_probe_children(bus, dev, buf.Pointer);
+ else
error = fdc_hints_probe(dev);
- if (error != 0)
- goto out;
- }
out:
if (buf.Pointer)
@@ -178,6 +167,40 @@
return (error);
}
+static int
+fdc_acpi_probe_children(device_t bus, device_t dev, void *fde)
+{
+ struct fdc_walk_ctx *ctx;
+ devclass_t fd_dc;
+ int i;
+
+ /* Setup the context and walk all child devices. */
+ ctx = malloc(sizeof(struct fdc_walk_ctx), M_TEMP, M_NOWAIT);
+ if (ctx == NULL) {
+ device_printf(dev, "no memory for walking children\n");
+ return (ENOMEM);
+ }
+ bcopy(fde, ctx->fd_present, sizeof(ctx->fd_present));
+ ctx->index = 0;
+ ctx->dev = dev;
+ ctx->acpi_dev = bus;
+ ACPI_SCAN_CHILDREN(ctx->acpi_dev, dev, 1, fdc_acpi_probe_child,
+ ctx);
+
+ /* Add any devices not represented by an AML Device handle/node. */
+ fd_dc = devclass_find("fd");
+ for (i = 0; i < ACPI_FDC_MAXDEVS; i++)
+ if (ctx->fd_present[i] == ACPI_FD_PRESENT &&
+ devclass_get_device(fd_dc, i) == NULL) {
+ if (fdc_add_child(ctx->dev, "fd", i) == NULL)
+ device_printf(dev, "fd add failed\n");
+ }
+ free(ctx, M_TEMP);
+
+ /* Attach any children found during the probe. */
+ return (bus_generic_attach(dev));
+}
+
static ACPI_STATUS
fdc_acpi_probe_child(ACPI_HANDLE h, device_t *dev, int level, void *arg)
{
@@ -187,29 +210,38 @@
ACPI_OBJECT *pkg, *obj;
ACPI_STATUS status;
+ ctx = (struct fdc_walk_ctx *)arg;
+ buf.Pointer = NULL;
+
/*
* The first four ints are booleans that indicate whether fd0-3 are
* present or not. The last is for a tape device, which we don't
* bother supporting for now.
*/
- ctx = (struct fdc_walk_ctx *)arg;
if (ctx->index > 3)
return (AE_OK);
+ /* This device is not present, move on to the next. */
+ if (ctx->fd_present[ctx->index] != ACPI_FD_PRESENT)
+ goto out;
+
+ /* Create a device for the child with the given index. */
+ child = fdc_add_child(ctx->dev, "fd", ctx->index);
+ if (child == NULL)
+ goto out;
+ *dev = child;
+
/* Get temporary buffer for _FDI probe. */
buf.Length = ACPI_FDC_BUFLEN;
buf.Pointer = malloc(buf.Length, M_TEMP, M_NOWAIT | M_ZERO);
if (buf.Pointer == NULL)
goto out;
- /* This device is not present, move on to the next. */
- if (ctx->fd_present[ctx->index] == 0)
- goto out;
-
/* Evaluate _FDI to get drive type to pass to the child. */
status = ACPI_EVALUATE_OBJECT(ctx->acpi_dev, *dev, "_FDI", NULL, &buf);
if (ACPI_FAILURE(status)) {
- device_printf(ctx->dev, "_FDI not available - %#x\n", status);
+ if (status != AE_NOT_FOUND)
+ device_printf(ctx->dev, "_FDI failed - %#x\n", status);
goto out;
}
pkg = (ACPI_OBJECT *)buf.Pointer;
@@ -222,12 +254,6 @@
device_printf(ctx->dev, "invalid type object in _FDI\n");
goto out;
}
-
- /* Create a device for the child with the given index and set ivars. */
- child = fdc_add_child(ctx->dev, "fd", ctx->index);
- if (child == NULL)
- goto out;
- *dev = child;
fdc_set_fdtype(child, obj->Integer.Value);
out:
------------------------------
Message: 24
Date: Tue, 27 Jul 2004 00:31:06 +0200
From: Matthias Andree <ma@dt.e-technik.uni-dortmund.de>
Subject: Re: magic sysrq keys functionality
To: Scott Long <scottl@freebsd.org>
Cc: Matthias Andree <ma@dt.e-technik.uni-dortmund.de>
Message-ID: <m3oem2jt91.fsf@merlin.emma.line.org>
Content-Type: text/plain; charset=us-ascii
Scott Long <scottl@freebsd.org> writes:
> I don't believe that any order is guaranteed. FreeBSD used to have the
> concept of a B_ORDERED bio flag that would help order the bioq, but it was
> removed early in the 5-current cycle due to apparent non-use. It's tough
> to rely on ATA Flush Cache since many devices exist that advertise it but
> don't actually support it (i.e. they lock up if you try it).
I have more devices that don't even advertise it than such that
do... Out of four drives I've checked (Seagate, WDC, I*M DeathStar,
Maxtor) only the latter, a Maxtor 4K060H3, advertises this.
> SCSI certainly supports it, but again it was information that was
> never getting to the device. Some SCSI drivers compensate by sending
> periodic ordered tags to help decrease the chances for an out-of-order
> commit, but it's still a small gamble. This works right now because
> we assume that disks will commit blocks in order, and that assumption
> generally hasn't been broken.
The assumption is that the Queue Algorithm Modifier (offset 3, upper
nibble) in the Control Mode Page (0xA) of the device is zero. If it's
set to 1, the assumption is broken and so is consistency unless ordered
tags are scheduled to enforce ordering.
> If legacy ATA were to drop off the face of the earth and drive makers
> were to commit to producing honest and non-buggy firmware, I'd love to
> bring back B_ORDERED and make it actually work.
FreeBSD 7 may be legacy-ATA free perhaps, or 6 if it takes a few years
until then.
--
Matthias Andree
Encrypted mail welcome: my GnuPG key ID is 0x052E7D95 (PGP/MIME preferred)
------------------------------
Message: 25
Date: Mon, 26 Jul 2004 15:33:42 -0700 (PDT)
From: Don Lewis <truckman@FreeBSD.org>
Subject: Re: Questionable code in sys/dev/sound/pcm/channel.c
To: conrads@cox.net
Cc: freebsd-current@FreeBSD.org
Message-ID: <200407262233.i6QMXghe058450@gw.catspoiler.org>
Content-Type: TEXT/plain; charset=us-ascii
On 26 Jul, Conrad J. Sabatier wrote:
>
> On 26-Jul-2004 Don Lewis wrote:
>> On 26 Jul, Conrad J. Sabatier wrote:
>>> I'm a little perplexed at the following bit of logic in chn_write()
>>> (which is where the "interrupt timeout, channel dead" messages are
>>> being generated).
>>>
>>> Within an else branch within the main while loop, we have:
>>>
>>> else {
>>> timeout = (hz * sndbuf_getblksz(bs)) /
>>> (sndbuf_getspd(bs) * sndbuf_getbps(bs));
>>> if (timeout < 1)
>>> timeout = 1;
>>> timeout = 1;
>>>
>>> Why the formulaic calculation of timeout, if it's simply going to be
>>> unconditionally set to 1 immediately afterwards anyway? What's
>>> going on
>>> here?
>>
>> Hmn, looks bogus to me. I think the intention is to round timeout up
>> to 1 if the result of the formula is zero. The final assignment
>> statement looks bogus to me. Maybe a too short timeout is the
>> source of this problem.
>>
>> It looks like this assignment appeared in rev 1.65.
>
> Hmm, your guess is as good as (or probably better than) mine. :-)
> A little more in the way of comments certainly wouldn't hurt.
>
>>> Also, at the end of the function:
>>>
>>> if (count <= 0) {
>>> c->flags |= CHN_F_DEAD;
>>> printf("%s: play interrupt timeout, channel dead\n",
>>> c->name);
>>> }
>>>
>>> return ret;
>>> }
>>>
>>> Could it be that the conditional test is wrong here? Perhaps
>>> we should be using (count < 0) instead?
>>>
>>> I don't know. I'm having no small difficulty understanding this
>>> code, but these two items caught my attention.
>>
>> I ran into the same problem when I was looking at the code a few days
>> ago.
>>
>> BTW, the trace output that was posted showed write() returning 0
>> immediately before the failure occurred.
>
> Are you referring to the truss output I posted a few days ago? The
> thing of it is, though, that the original "channel dead" message had
> already occurred in a previous run of madplay (which wasn't traced), so
> it's really hard to say if there's any useful info to be obtained from
> tracing a later run, after the pcm device was already "broken".
I think that was it. The truss output looked like things were working
for a while before it croaked. I saw a bunch of writes succeed, then a
write returned 0, and then it looked like it died.
> So far, I still haven't gotten the error with the new kernel I'm
> testing. I wouldn't say absolutely that that single patch (of the
> final conditional test) is "the fix", but it may help in the meantime.
I just looked at the code some more. With timeout hardwired to 1, count
can never go negative. The code initializes count to hz, and then
decrements it whenever chn_sleep() returns EWOULDBLOCK, and
re-initializes count to hz if chn_sleep() returns zero. With timeout
hardwired to 1, count should only be able to decrement to zero if
chn_sleep() returns EWOULDBLOCK hz times in a row, which means that
nothing could be stuffed into the buffer for one second, which seems
like a long time ...
I suspect that with your change the write() call is returning a 0 and
the player software is doing a retry that succeeds (or this might be
audible as a skip).
------------------------------
Message: 26
Date: Tue, 27 Jul 2004 00:34:55 +0200
From: Matthias Andree <ma@dt.e-technik.uni-dortmund.de>
Subject: Re: magic sysrq keys functionality
To: Scott Long <scottl@freebsd.org>
Cc: current@freebsd.org
Message-ID: <m3k6wqjt2o.fsf@merlin.emma.line.org>
Content-Type: text/plain; charset=us-ascii
Scott Long <scottl@freebsd.org> writes:
> On Mon, 26 Jul 2004, Brian Fundakowski Feldman wrote:
>> SoftUpdates guarantess that your file systems will not get corrupt.
> This isn't entirely correct. Softupdates guarantees that you won't get
> corruption due to metadata pointing to invalid or stale data blocks.
> That's not the same as guaranteeing that there won't be any corruption.
> Write caching on the drive combined with an in-opportune power loss or
> other failure can easily leave you with corrupt or incomplete metadata
> and/or data blocks.
I've had a SCS HDD lock up (1997 Micropolis 4345WS showing its age and
bad interaction with an Adaptec 2940UW Pro[*]) while softdep was writing
to the drive and suffered *SEVERE* file system corruption, which tore
down my /var/db/pkg and other stuff.
[*] The same adaptor used to lock up every other week in a different
hardware environment. I haven't seen this kind of trouble with the
Tekram DC-390U I used to use, but I was too lazy to replace the Tekram
until now.
--
Matthias Andree
Encrypted mail welcome: my GnuPG key ID is 0x052E7D95 (PGP/MIME preferred)
------------------------------
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
End of freebsd-current Digest, Vol 70, Issue 3
**********************************************
--
[35mEvariste Galois[m:
[33m�����呛��樱������蔷������,����直前......[m
[m[31m�� ��源:������� bbs.ustc.edu.cn [FROM: 210.45.72.234][m