Re: Crash in dwc3 driver on module unload

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

 



On Fri, 17 May 2013, Peter Chen wrote:

> > I found out a couple more things about this.
> >
> > If I do "rmmod dwc3" first, and then do "rmmod dwc3-pci", it doesn't
> > crash.
> >
> 
> dwc3-pci will release dwc3 and its resources at its removal.
> So, dwc3 core must be released first, then glue layer.

That makes no sense.  Obviously dwc3 can't be removed until all its
resources have been released.  And you said that dwc3-pci doesn't
release the dwc3 resources until dwc3-pci has been removed.

Therefore dwc3 can't be removed until dwc3-pci has been removed.  This 
is exactly the opposite of what you wrote above.

> Since there are no relationship between core and glue
> layer, If user unload module in incorrect order, the oops
> may occur, the phy driver is the same situation.
> 
> For such kinds of case, do we need to fix at kernel layer?
> or using user space method to fix?

There _should_ be a relationship between the core and the glue layer.  
The glue layer uses the core's resources; therefore the glue layer
should contain references to symbols that are defined in the core.  
This will cause the kernel to prevent the core from being removed
before the glue layer.

PHY drivers will need different treatment.  I suspect that the right 
approach is to increment the phy driver's module count each time an HCD 
claims a PHY.

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