• Manivannan Sadhasivam's avatar
    PCI: endpoint: Remove "core_init_notifier" flag · a01e7214
    Manivannan Sadhasivam authored
    "core_init_notifier" flag is set by the glue drivers requiring refclk from
    the host to complete the DWC core initialization. Also, those drivers will
    send a notification to the EPF drivers once the initialization is fully
    completed using the pci_epc_init_notify() API. Only then, the EPF drivers
    will start functioning.
    
    For the rest of the drivers generating refclk locally, EPF drivers will
    start functioning post binding with them. EPF drivers rely on the
    'core_init_notifier' flag to differentiate between the drivers.
    Unfortunately, this creates two different flows for the EPF drivers.
    
    So to avoid that, let's get rid of the "core_init_notifier" flag and follow
    a single initialization flow for the EPF drivers. This is done by calling
    the dw_pcie_ep_init_notify() from all glue drivers after the completion of
    dw_pcie_ep_init_registers() API. This will allow all the glue drivers to
    send the notification to the EPF drivers once the initialization is fully
    completed.
    
    Only difference here is that, the drivers requiring refclk from host will
    send the notification once refclk is received, while others will send it
    during probe time itself.
    
    But this also requires the EPC core driver to deliver the notification
    after EPF driver bind. Because, the glue driver can send the notification
    before the EPF drivers bind() and in those cases the EPF drivers will miss
    the event. To accommodate this, EPC core is now caching the state of the
    EPC initialization in 'init_complete' flag and pci-ep-cfs driver sends the
    notification to EPF drivers based on that after each EPF driver bind.
    
    Link: https://lore.kernel.org/linux-pci/20240327-pci-dbi-rework-v12-8-082625472414@linaro.orgTested-by: default avatarNiklas Cassel <cassel@kernel.org>
    Signed-off-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Signed-off-by: default avatarKrzysztof Wilczyński <kwilczynski@kernel.org>
    Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
    Reviewed-by: default avatarNiklas Cassel <cassel@kernel.org>
    a01e7214
pcie-rockchip-ep.c 17.7 KB