Re: [RFC PATCH] usb: Change persist_enabled when attribute avoid_reset_quirk is changed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 24 Jul 2012, Lan Tianyu wrote:

> 于 2012/7/24 22:59, Alan Stern 写道:
> > Yes, good idea.
> >
> > When you do this, you should also add another little paragraph to
> > Documentation/usb/persist.txt.  At the end of the "What is the
> > solution?" section, explain why the persist attribute cannot be set if
> > the avoid_reset_quirk attribute is on.
> >
> > Hmmm, what about hubs?  They don't have a persist attribute because
> > persist is_always_  supposed to be enabled for a hub.  Maybe this means
> > they shouldn't have an avoid_reset_quirk attribute either.
> Another proposal is to add USB_CLASS_HUB check in the avoid_reset_quirk
> attribute callback. If it was hub, return directly.

Or else take the &dev_attr_avoid_reset_quirk.attr entry out of 
dev_attrs[], and instead make usb_create_sysfs_dev_files() and 
usb_remove_sysfs_dev_files() explicitly create and remove the 
avoid_reset_quirk attribute if the device isn't a hub.

Adding the check to the avoid_reset_quirk callback is easier, though.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux