Re: Fwd: core dump on kldload atapicam

From: Alexander Motin <mav_at_FreeBSD.org>
Date: Thu, 24 Sep 2009 12:36:38 +0300
Jaakko Heinonen wrote:
> On 2009-09-23, Alexander Motin wrote:
>> Then please explain me how it happens. I don't think that explanation
>> "it just works" sufficient.
>>
>> Any ideas what needed to reproduce that? Because it looks like not going
>> to fall in my case:
> 
> It happens if a parent ata device is not attached. I can reproduce the
> problem on system which hash ata0, ata2 and ata3 devices but ata1 fails
> to probe.

Nice catch. I think it is newbus problem, not ata. I am able to simulate
this problem locally and attached patch fixes it. Any objections?

-- 
Alexander Motin

--- subr_bus.c.prev	2009-09-15 20:44:39.000000000 +0300
+++ subr_bus.c	2009-09-24 12:24:35.000000000 +0300
_at__at_ -1017,7 +1017,7 _at__at_ devclass_driver_added(devclass_t dc, dri
 	 * Call BUS_DRIVER_ADDED for any existing busses in this class.
 	 */
 	for (i = 0; i < dc->maxunit; i++)
-		if (dc->devices[i])
+		if (dc->devices[i] && device_is_attached(dc->devices[i]))
 			BUS_DRIVER_ADDED(dc->devices[i], driver);
 
 	/*
Received on Thu Sep 24 2009 - 08:09:22 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:56 UTC