Re: [GIT PULL] USB driver patches for 4.6-rc1

From: Peter Chen
Date: Sun Mar 20 2016 - 07:37:48 EST


On Fri, Mar 18, 2016 at 04:01:51PM -0700, Linus Torvalds wrote:
> On Fri, Mar 18, 2016 at 3:51 PM, Linus Torvalds
> <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > The commit that ends up being marked bad is odd, but there it is:
> > 69bec7259853 "USB: core: let USB device know device node".
>
> Confirmed. Not only did it bisect to that, reverting it on top of the
> current kernel fixes my machine.
>
> So that commit is somehow buggy. I don't see what it does that would
> break even with OF disabled, but something does.
>
> I'll just revert it. The way it is done seems bogus anyway. It looks
> at of_node when OF is disabled, but generally that isn't even
> initialized as far as I can tell, and we have things like
> dev_of_node() helpers to make sure you don't do that.
>

I am sorry to make things break, Nicolai Stange's found the root cause
for this problem, and his patch fixed it.

USB device structure (both struct usb_hcd and struct usb_device) is
initialized by kzalloc, so the struct device in it is initialized by
zero, and will not cause non-initialized for USB device, but you
are right, a good practice is using dev_of_node for all devices in
case the struct device is not zero-initialized.

--

Best Regards,
Peter Chen