All of lore.kernel.org
 help / color / mirror / Atom feed
* a question in pcie-designware-ep.c, can't find where a variable has been set.
@ 2023-01-31 12:01 Chan Kim
  0 siblings, 0 replies; only message in thread
From: Chan Kim @ 2023-01-31 12:01 UTC (permalink / raw)
  To: kernelnewbies

Hello kernel users and experts,

With linux-5.15.68, I was analyzing function dw_plat_pcie_probe in file
drivers/pci/controller/dwc/pcie-designware-plat.c.
This function creates struct dw_pcie and it has struct dw_pcie_ep embedded
in it as member 'ep'.
When it's endpoint, it calls dw_pcie_ep_init(&pci->ep).
(
https://elixir.bootlin.com/linux/v5.15.68/source/drivers/pci/controller/dwc/
pcie-designware-plat.c#L166 )

return dw_pcie_ep_init(&pci->ep);

Now in the dw_pcie_ep_init function,
(drivers/pci/controller/dwc/pcie-designware-ep.c)
It creates dw_pcie_epc and calls pci_epc_mem_init function like this. 
(
https://elixir.bootlin.com/linux/v5.15.68/source/drivers/pci/controller/dwc/
pcie-designware-ep.c#L770 )

ret = pci_epc_mem_init(epc, ep->phys_base, ep->addr_size,
                   ep->page_size);

But I can't find where ep->page_size was assigned earlier. (ep is the
pointer to the struct dw_pcie_ep).
Can anyone tell me where it was assigned?

And I'm not clear in this struct pci_epc_mem_window, the unit of size.(in
include/linux/pci-epc.h)

struct pci_epc_mem_window {
    phys_addr_t phys_base;
    size_t      size;
    size_t      page_size;
};

Is the size in byte unit? Or is it number of pages?

Thank you.

Chan Kim




_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-31 12:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-31 12:01 a question in pcie-designware-ep.c, can't find where a variable has been set Chan Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.