From owner-freebsd-new-bus Mon Jul 10 9:18:57 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from mailgate.originative.co.uk (mailgate.originative.co.uk [194.217.50.228]) by hub.freebsd.org (Postfix) with ESMTP id A481F37BCB9 for ; Mon, 10 Jul 2000 09:18:50 -0700 (PDT) (envelope-from paul@originative.co.uk) Received: from originative.co.uk (lobster.originative.co.uk [194.217.50.241]) by mailgate.originative.co.uk (Postfix) with ESMTP id C64441D13E; Mon, 10 Jul 2000 17:18:44 +0100 (BST) Message-ID: <3969F764.E181C7CE@originative.co.uk> Date: Mon, 10 Jul 2000 17:18:44 +0100 From: Paul Richards Organization: Originative Solutions Ltd X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: Nick Hibma Cc: Warner Losh , new-bus@FreeBSD.ORG Subject: Re: Debugger vs panic References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Nick Hibma wrote: > I'm still catching up with mail I have backed up from the Perl cruise so this is a little late. > I've made this exact same comment to dfr about 1.5 years ago, to replace > the panics with appropriate empty returns, returning NULL or false in > most cases. > > He was quite persistent in his opinion that it was a bug in the code and > could only lead to faults later in the code. He'd rather have the > problem pointed out right where it occurs. And I agree with him to the > extent that if there is a problem it should go pop as early as possible > in the appropriate place, and not at a later stage where you will have > to trace back to the place where the value was last written, which might > be complicated to say the least. I noticed there were a lot of places in the code that paniced when they should really return failure codes as well. I don't agree with Doug's standpoint though. Panic's are becoming over used in the kernel to catch assert type conditions and really they should only be used in those cases where to continue would be catastrophic i.e. corruption of data or hardware failure might occur and for situations where no other action is possible. In most cases the driver code can safely return a failure code and the likely outcome will be an attach will fail or something equally benign will happen and that would be just as useful from a development point of view since it will be clear something is wrong. If you want to use panics for debugging purposes then they should be enclosed in #ifdef DEBUG or at the very least INVARIANTS. The kernel should never panic if it is possible to safely continue, otherwise we make the OS less stable to adverse situations rather than making it a more robust OS. Paul. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Mon Jul 10 11:40:27 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from njord.bart.nl (njord.bart.nl [194.158.170.15]) by hub.freebsd.org (Postfix) with ESMTP id 0FC7137B88D for ; Mon, 10 Jul 2000 11:40:23 -0700 (PDT) (envelope-from asmodai@wxs.nl) Received: from daemon.ninth-circle.org (daemon.ninth-circle.org [195.38.216.226]) by njord.bart.nl (8.10.1/8.10.1) with ESMTP id e6AIeJI34677 for ; Mon, 10 Jul 2000 20:40:19 +0200 (CEST) Received: (from asmodai@localhost) by daemon.ninth-circle.org (8.9.3/8.9.3) id UAA96892 for new-bus@freebsd.org; Mon, 10 Jul 2000 20:40:18 +0200 (CEST) (envelope-from asmodai) Date: Mon, 10 Jul 2000 20:40:18 +0200 From: Jeroen Ruigrok/Asmodai To: new-bus@freebsd.org Subject: bus_config_intr() Message-ID: <20000710204018.F86887@daemon.ninth-circle.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i Organisation: Ninth-Circle Enterprises Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Poul-Henning Kamp was friendly enough to make the following patch: http://phk.freebsd.dk/misc/bus_config_intr.patch Basically this removes some often duplicated code and wraps it in a function of itself. I am not quite sure if the name shouldn't be pcibus_config_intr(), but I welcome arguments, both for and against, before I commit this to the tree since it makes sense. Thanks, -- Jeroen Ruigrok vd Werven/Asmodai asmodai@[wxs.nl|bart.nl|freebsd.org] Documentation nutter/C-rated Coder BSD: Technical excellence at its best The BSD Programmer's Documentation Project I think, therefore I am... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Mon Jul 10 13:58:58 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 9B3DF37B7A9 for ; Mon, 10 Jul 2000 13:58:54 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id OAA44386; Mon, 10 Jul 2000 14:58:52 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id OAA86244; Mon, 10 Jul 2000 14:58:41 -0600 (MDT) Message-Id: <200007102058.OAA86244@harmony.village.org> To: Jeroen Ruigrok/Asmodai Subject: Re: bus_config_intr() Cc: new-bus@FreeBSD.ORG In-reply-to: Your message of "Mon, 10 Jul 2000 20:40:18 +0200." <20000710204018.F86887@daemon.ninth-circle.org> References: <20000710204018.F86887@daemon.ninth-circle.org> Date: Mon, 10 Jul 2000 14:58:41 -0600 From: Warner Losh Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <20000710204018.F86887@daemon.ninth-circle.org> Jeroen Ruigrok/Asmodai writes: : Poul-Henning Kamp was friendly enough to make the following patch: : : http://phk.freebsd.dk/misc/bus_config_intr.patch : : Basically this removes some often duplicated code and wraps it in a : function of itself. I am not quite sure if the name shouldn't be : pcibus_config_intr(), but I welcome arguments, both for and against, : before I commit this to the tree since it makes sense. Hmmm. I don't like the sharable bit. However, that's likely a bug in the isa bus. No, wait. the ISA bus will allow shared interrupts (look at the boca boards and we do it here all the time). I'm of two minds. On the one hand most buses the interrupts are always sharable (pci), but on the other sometimes they are and somethiens they aren't (isa). pccard is interesting because it can share interrupts between cards on the bus, but generally not with other things. It should be able to, but until we have the cardbus bridge support for 16 or 32 bit cards in place, we can't share it with other resources reliably. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Mon Jul 10 14:55: 9 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id 6E8D437B595 for ; Mon, 10 Jul 2000 14:55:07 -0700 (PDT) (envelope-from jhb@foo.osd.bsdi.com) Received: from foo.osd.bsdi.com (root@foo.osd.bsdi.com [204.216.28.137]) by pike.osd.bsdi.com (8.9.3/8.9.3) with ESMTP id OAA41324 for ; Mon, 10 Jul 2000 14:55:05 -0700 (PDT) (envelope-from jhb@foo.osd.bsdi.com) Received: (from jhb@localhost) by foo.osd.bsdi.com (8.9.3/8.9.3) id OAA50473 for new-bus@FreeBSD.org; Mon, 10 Jul 2000 14:54:20 -0700 (PDT) (envelope-from jhb) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Mon, 10 Jul 2000 14:54:20 -0700 (PDT) Organization: BSD, Inc. From: John Baldwin To: new-bus@FreeBSD.org Subject: PnP weirdness and "isa0: <@@@0000> found" Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I've recently been seeing the 'isa0: <@@@0000> found' messages in my dmesg since dfr added the isa_probe_nomatch() method to the isa bus. I was curious why I was getting those messages and what they really meant. So, I worked up a patch to sys/isa/isa_common.c that can be found at http://www.freebsd.org/~jhb/public_html/patches/isa_common.patch. The short version is that with my patches, my <@@@0000> lines became this with bootverbose: sc1: no video adapter is found. sc1: failed to probe at flags 0x100 on isa0 vga1: failed to probe on isa0 This is rather bothersome as in device.hints I have the following: hint.vga.0.at="isa" hint.sc.0.at="isa" hint.sc.0.flags="0x100" And for sc0, I end up with the following: sc0: on isa0 sc0: VGA <16 virtual consoles, flags=0x200> Note that the flags in my hints have migrated from sc0 to sc1. I also have these messages from the sc and vga identify routines: sc-: sc0 exists, using next available unit number vga-: vga0 exists, using next available unit number It seems that cninit() is forcing sc0 and vga0 to probe, using the resource hints for the drivers (but ignoring flags). However, these drivers are tried a second time during the boot, giving the sc1 and vga1 probes. Finally, one side issue that has been bugging me is that when a device fails to get resources in isa_assign_resources(), it's resource list seems to only contain one item. I'm using the isa_print_child() function which prints multiple resources fine for other devices, so I don't think there is an error in the code to display the resources. Yet: PNP0303: adding irq mask 0x2 PNP0303: adding io range 0x60-0x60, size=0x1, align=0 PNP0303: adding io range 0x64-0x64, size=0x1, align=0 PNP0303: end config ... unknown: can't assign resources unknown: at port 0x60 on isa0 *puzzled* -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Mon Jul 10 15:10:36 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id A53D837B853; Mon, 10 Jul 2000 15:10:27 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id QAA44670; Mon, 10 Jul 2000 16:10:25 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id QAA86727; Mon, 10 Jul 2000 16:10:13 -0600 (MDT) Message-Id: <200007102210.QAA86727@harmony.village.org> To: John Baldwin Subject: Re: PnP weirdness and "isa0: <@@@0000> found" Cc: new-bus@FreeBSD.ORG In-reply-to: Your message of "Mon, 10 Jul 2000 14:54:20 PDT." References: Date: Mon, 10 Jul 2000 16:10:13 -0600 From: Warner Losh Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message John Baldwin writes: : I've recently been seeing the 'isa0: <@@@0000> found' messages in my dmesg : since dfr added the isa_probe_nomatch() method to the isa bus. I was : curious why I was getting those messages and what they really meant. So, : I worked up a patch to sys/isa/isa_common.c that can be found at : http://www.freebsd.org/~jhb/public_html/patches/isa_common.patch. The : short version is that with my patches, my <@@@0000> lines became this : with bootverbose: : : sc1: no video adapter is found. : sc1: failed to probe at flags 0x100 on isa0 : vga1: failed to probe on isa0 I have a similar patch. It only whines when the device has a PnP id. I suppose that yours is better with boot verbose. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Tue Jul 11 1: 1:28 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from tele-post-20.mail.demon.net (tele-post-20.mail.demon.net [194.217.242.20]) by hub.freebsd.org (Postfix) with ESMTP id F0D0C37BC6F for ; Tue, 11 Jul 2000 01:01:24 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from nlsys.demon.co.uk ([158.152.125.33] helo=herring.nlsystems.com) by tele-post-20.mail.demon.net with esmtp (Exim 2.12 #2) id 13Buyk-0006cT-0K; Tue, 11 Jul 2000 08:01:19 +0000 Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id MAA02522; Mon, 10 Jul 2000 12:30:09 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Tue, 11 Jul 2000 09:04:41 +0100 (BST) From: Doug Rabson To: Jeroen Ruigrok/Asmodai Cc: new-bus@freebsd.org Subject: Re: bus_config_intr() In-Reply-To: <20000710204018.F86887@daemon.ninth-circle.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 10 Jul 2000, Jeroen Ruigrok/Asmodai wrote: > Poul-Henning Kamp was friendly enough to make the following patch: > > http://phk.freebsd.dk/misc/bus_config_intr.patch > > Basically this removes some often duplicated code and wraps it in a > function of itself. I am not quite sure if the name shouldn't be > pcibus_config_intr(), but I welcome arguments, both for and against, > before I commit this to the tree since it makes sense. The if statement "if (res == NULL)" should be "if (*res == NULL)". I have the same reservations as Warner on the use of RF_SHAREABLE. This flag should be passed in probably. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 20 8442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Tue Jul 11 1:49:51 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 2CC3F37B742 for ; Tue, 11 Jul 2000 01:49:48 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.8.7/8.8.7) with ESMTP id SAA12736; Tue, 11 Jul 2000 18:49:26 +1000 Date: Tue, 11 Jul 2000 18:49:21 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Warner Losh Cc: Jeroen Ruigrok/Asmodai , new-bus@FreeBSD.ORG Subject: Re: bus_config_intr() In-Reply-To: <200007102058.OAA86244@harmony.village.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 10 Jul 2000, Warner Losh wrote: > Hmmm. I don't like the sharable bit. However, that's likely a bug in > the isa bus. No, wait. the ISA bus will allow shared interrupts > (look at the boca boards and we do it here all the time). I'm of two No. The interrupt on ISA multiport boards is shared on the board, not on the bus. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Tue Jul 11 10:21:11 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 57B2237BFE2 for ; Tue, 11 Jul 2000 10:21:02 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id LAA48363; Tue, 11 Jul 2000 11:20:49 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id LAA05646; Tue, 11 Jul 2000 11:20:44 -0600 (MDT) Message-Id: <200007111720.LAA05646@harmony.village.org> To: Bruce Evans Subject: Re: bus_config_intr() Cc: Jeroen Ruigrok/Asmodai , new-bus@FreeBSD.ORG In-reply-to: Your message of "Tue, 11 Jul 2000 18:49:21 +1000." References: Date: Tue, 11 Jul 2000 11:20:44 -0600 From: Warner Losh Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message Bruce Evans writes: : On Mon, 10 Jul 2000, Warner Losh wrote: : : > Hmmm. I don't like the sharable bit. However, that's likely a bug in : > the isa bus. No, wait. the ISA bus will allow shared interrupts : > (look at the boca boards and we do it here all the time). I'm of two : : No. The interrupt on ISA multiport boards is shared on the board, : not on the bus. Ah. We have some cards at work that sit on the isa bus and can share interrupts with each other, but not other cards. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message