On Wed 25 Aug 09:43 PDT 2021, Heikki Krogerus wrote: > On Wed, Aug 25, 2021 at 08:53:29AM -0700, Bjorn Andersson wrote: > > On Wed 25 Aug 01:18 PDT 2021, Bryan O'Donoghue wrote: > > > > > On 25/08/2021 06:51, Felipe Balbi wrote: > > > > > Hi Peter, I took a proper look at this again, hoping to find a way to > > > > > pass a callback pointer from dwc3-qcom to the dwc3 core, that can be > > > > > called from __dwc3_set_mode() to inform the Qualcomm glue about mode > > > > > changes. > > > > I would rather keep the strict separation between glue and core. > > > > > > # 1 __dwc3_set_mode > > > Felipe wants to keep a strict separation between core and glue > > > > > > # notifier > > > Requires the core probe() to complete before the glue probe to work > > > reliably. This then would lead us to remaking the dwc3-qcom::probe() to > > > facilitate probe deferral. > > > > > > We can be sure bugs would be introduced in this process. > > > > > > AFAIK Felipe is not opposed to this, Bjorn likes it > > Notifiers were proposed for the USB role switches already some time > ago [1], and I don't think anybody was against them, but in the end I > don't think there were any users for those notifier, so they were > never added. > > If something needs to only react to the role changes like I think in > this case, then I would just add those notifiers to the USB role > switches. > > [1] https://lore.kernel.org/linux-usb/20191002231617.3670-3-john.stultz@xxxxxxxxxx/ > Afaict this would end up pretty much identical to the notification chain that Bryan proposed earlier; the dwc3 drd code registers a usb_role_switch and the glue code somehow needs to get hold of that resource to register the notification. But the glue code has no way to know when the core/drd code is done registering, so it has no way to know when there is a notification chain to register with. Regards, Bjorn