On Wed, Aug 30, 2023 at 09:57:46AM +0530, Krishna Kurapati PSSNV wrote: > > > On 8/28/2023 10:50 PM, Bjorn Andersson wrote: > > > > > > I had some idea on how to get the role notification reach qcom glue driver > > > but wanted your opinion on whether they can be used or not: > > > > > > 1. Register a vendor_hook from glue driver and invoke that during > > > __dwc3_set_mode. > > > > > > 2. Let the role notification reach dwc3-qcom first and then let qcom driver > > > invoke role_set of drd. Something similar to what was implemented by Wesley > > > on [1]. > > > > > > But both the options require dwc3_probe to be done in sync with > > > of_platform_populate or we need to defer qcom probe if dwc3_probe is > > > deferred. Since we are leaning towards async probe, not sure if the above > > > two options would be proper. > > > > > ... > > > As mentioned, this need has been identified a few times by now, so > > nothing strange in your request/proposal. > > > > But so far no one has come up with a good way to register glue code > > callbacks with the core; we can't pass arbitrary data (such as a > > function pointer to such callback), and we don't know when the core is > > registered, so we can't call a register operation when that happens. > > > > Regards, > > Bjorn > > > > > [1]: https://patchwork.kernel.org/project/linux-usb/patch/20201009082843.28503-4-wcheng@xxxxxxxxxxxxxx/ > > > [2]: https://patchwork.kernel.org/project/linux-usb/cover/20230325165217.31069-1-manivannan.sadhasivam@xxxxxxxxxx/ > > > > > Hi Bjorn, > > How about we use Component framework to let the glue layer know that the > child probe is complete. That way we don't need to defer QCOM probe and in > the bind call back coming to master (in this case, the glue layer), we can > register the vendor hook or role switch we need and we can pass the role > notifications from core to glue as needed. > Would device_driver::sync_state() help here? The qcom glue driver creates a DL_FLAG_SYNC_STATE_ONLY device link with dwc3 core. If it works, we can avoid component framework related changes in dwc3 core. Thanks, Pavan