On Fri, Dec 03, 2021 at 10:36:00AM +0530, Kishon Vijay Abraham I wrote:
Hi Kunihiko,according
On 01/09/21 10:46 am, Kunihiko Hayashi wrote:
The driver using core_init_notifier, e.g. pcie-tegra194.c, runs
controllerto the following sequence:
probe()
dw_pcie_ep_init()
bind()
dw_pcie_ep_start()
enable_irq()
(interrupt occurred)
handler()
[enable controller]
dw_pcie_ep_init_complete()
dw_pcie_ep_init_notify()
After receiving an interrupt from RC, the handler enables the
registersand the controller registers can be accessed.
So accessing the registers should do in dw_pcie_ep_init_complete().
Currently dw_pcie_ep_init() has functions dw_iatu_detect() and
dw_pcie_ep_find_capability() that include accesses to DWC registers.
As a result, accessing the registers before enabling the controller,
the access will fail.
The function dw_pcie_ep_init() shouldn't have any access to DWC
codesif the controller is enabled after calling bind(). This moves access
toto DBI/iATU registers and depending variables from dw_pcie_ep_init()
dw_pcie_ep_init_complete().
Ideally pci_epc_create() should be the last step by the controller
driver before handing the control to the core EPC framework. Since
after this step the EPC framework can start invoking the epc_ops.
Here more stuff is being added to dw_pcie_ep_init_complete() which is
required for epc_ops and this could result in aborts for platforms
which does not add core_init_notifier.
This patch needs rework, I will mark the series as "Changes requested".