atom feed13 messages in org.freebsd.freebsd-archnewbus flaw
FromSent OnAttachments
Dag-Erling SmørgravMay 11, 2004 7:39 am 
Doug RabsonMay 11, 2004 8:08 am 
Poul-Henning KampMay 11, 2004 8:12 am 
John-Mark GurneyMay 11, 2004 6:02 pm 
Dag-Erling SmørgravMay 12, 2004 6:27 am 
John-Mark GurneyMay 12, 2004 10:41 am 
Dag-Erling SmørgravMay 12, 2004 10:48 am 
John-Mark GurneyMay 12, 2004 10:53 am 
Dag-Erling SmørgravMay 12, 2004 1:30 pm 
Doug RabsonMay 13, 2004 1:27 am 
Dag-Erling SmørgravMay 13, 2004 3:46 am 
Doug RabsonMay 13, 2004 5:34 am 
M. Warner LoshMay 13, 2004 9:06 am 
Subject:newbus flaw
From:John-Mark Gurney (gurn@efn.org)
Date:May 12, 2004 10:53:44 am
List:org.freebsd.freebsd-arch

Dag-Erling Sm?rgrav wrote this message on Wed, May 12, 2004 at 15:26 +0200:

John-Mark Gurney <gurn@efn.org> writes:

You are incorrect in assuming you can't find out if another child already exists.. Usually this is a problem of properly allocating resources so that you know the other child exists. Since you are using identify, you already don't have a "self describing" bus, which means that you have to either use hints, or another method to make sure that your device doesn't already exist.

It's not quite that simple. See the block comment at the top of src/sys/dev/ichwd/ichwd.c for an explanation.

Sorry, I had an out of date cvsup and hadn't received ichwd yet.

You're always going to be a child of nexus, and since I assume from the comment that there can only ever be one child. Also, why do you find_child w/ unit number 0, but then add a child with unit -1? Why not add it unit 0, and make it fail if that already exists?

Also, it seems to me that if dev already exists, that you shouldn't reset the driver and desc. This should be harmless, but if for some reason you are called on an attached device, it could cause problems.

"All that I will do, has been done, All that I have, has not."