From owner-freebsd-mobile Wed Dec 1 16:58:47 1999 Delivered-To: freebsd-mobile@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id C751D150A6; Wed, 1 Dec 1999 16:58:37 -0800 (PST) (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 RAA15156; Wed, 1 Dec 1999 17:57:07 -0700 (MST) (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 RAA05497; Wed, 1 Dec 1999 17:57:07 -0700 (MST) Message-Id: <199912020057.RAA05497@harmony.village.org> To: Mike Smith Subject: Re: cvs commit: src/sys/pccard pccard.c src/sys/isa sio.c src/sys/dev/ed if_ed_pccard.c src/sys/dev/ep if_ep_pccard.c Cc: nate@mt.sri.com (Nate Williams), mobile@FreeBSD.ORG In-reply-to: Your message of "Wed, 01 Dec 1999 16:44:49 PST." <199912020044.QAA03272@mass.cdrom.com> References: <199912020044.QAA03272@mass.cdrom.com> Date: Wed, 01 Dec 1999 17:57:07 -0700 From: Warner Losh Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org In message <199912020044.QAA03272@mass.cdrom.com> Mike Smith writes: : > > In the old old code this only : > > worked because the pcic interrupt handler wasn't masked, so the detach : > > routine could preempt the device interrupt handler and set the gone flag. : > : > Do you have a better solution than this? This was the 'most' correct : > solution I could come up with. (I'd love to hear about a better : > solution than this). : : I've already proposed it; a bus method that a child can use to verify via : a hardware accessor in the parent bus that the hardware it "owns" is : still physically present. The problem with this is that the device is gone. The child is detached and therefore can't be used to call a bus method unless the child driver caches a pointer to its parent. : > The only other solution I could envision was one involving re-writing : > all of the drivers to modify them so they would have timeouts reading : > hardware (difficult and time consuming), but this wouldn't work in : > newbus due to softc going away. :( : : Again, the softc _can't_ go away until the driver lets it. The driver : shouldn't let it until it's finished with it. End of story. Agreed. However, the only way that it can do this currently is to block in detach until all references to softc have gone out of scope. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message