From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 13 14:26:46 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C18BD16A420 for ; Fri, 13 Jan 2006 14:26:46 +0000 (GMT) (envelope-from NKoch@demig.de) Received: from server.absolute-media.de (server.absolute-media.de [213.239.231.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5BCA743D4C for ; Fri, 13 Jan 2006 14:26:44 +0000 (GMT) (envelope-from NKoch@demig.de) Received: from localhost (unknown [127.0.0.1]) by server.absolute-media.de (Postfix) with ESMTP id 1C6E9BAB40 for ; Fri, 13 Jan 2006 15:26:42 +0100 (CET) Received: from server.absolute-media.de ([127.0.0.1]) by localhost (server [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 29716-01 for ; Fri, 13 Jan 2006 15:26:34 +0100 (CET) Received: from firewall.demig (p50839880.dip0.t-ipconnect.de [80.131.152.128]) by server.absolute-media.de (Postfix) with ESMTP id 2AEA9B98E9 for ; Fri, 13 Jan 2006 15:26:34 +0100 (CET) Received: from ws-ew-3 (ws-ew-3.demig.intra [192.168.1.72]) by firewall.demig (8.13.5/8.13.4) with SMTP id k0DEMlIc047886 for ; Fri, 13 Jan 2006 15:22:47 +0100 (CET) (envelope-from NKoch@demig.de) From: "Norbert Koch" To: Date: Fri, 13 Jan 2006 15:22:47 +0100 Message-ID: <000701c6184c$d3f27060$4801a8c0@ws-ew-3.demig.intra> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2120.0 Importance: Normal X-Virus-Scanned: by amavisd-new X-Virus-Scanned: by amavisd-new at absolute-media.de Subject: device probe re-tried for failed isa device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2006 14:26:46 -0000 Hello. I wrote two isa device drivers A and B for FreeBSD4.11. Both are kld-loaded and have identify() entries. Here is the pseudo code for the identify() routines: A_identify() /* 2 units */ { for (i = 0; i <=1; ++ i) { dev = BUS_ADD_CHILD(parent, ISA-ORDER_SPECULATIVE, "a", 0); If (bus_set_resource (dev, ...) != 0) { device_delete_child (parent, dev); continue; }; init (device_get_softc (dev, i)); } } B_identify() /* 1 unit */ { dev = BUS_ADD_CHILD(parent, ISA-ORDER_SPECULATIVE, "a", 0); If (bus_set_resource (dev, ...) != 0) { device_delete_child (parent, dev); } } When I kldload the two drivers I see these function calls: 1. A_identify 2. A_probe(unit 0) 3. A_attach(unit 0) 4. A_probe(unit 1) <-- fails with ENXIO because hardware is not present 5. B_identify 6. A_probe(unit 1) <-- probed again!? 7. B_probe(unit 0) 8. B_attach(unit 0) Is it correct, that the isa bus re-tries to probe failed devices? The results from calling device_get_softc() differ for the two probe() calls 4 and 6. Is this correct? Is it correct to initialize softc in identify()? Should I call device_delete_child() in probe() when the hardware fails? Thank you, Norbert Koch