Discussion:
[PATCH] Export functions from pcie-designware
m***@sai.msu.ru
2014-08-30 12:24:36 UTC
Permalink
From: "Matwey V. Kornilov" <***@sai.msu.ru>

pcie-spear13xx when built as module requires the functions from pcie-designware.
Export them properly.

Signed-off-by: Matwey V. Kornilov <***@sai.msu.ru>
---
drivers/pci/host/pcie-designware.c | 7 +++++++
drivers/pci/host/pcie-designware.h | 14 +++++++-------
2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index 52bd3a1..7914b92c 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -89,6 +89,7 @@ int dw_pcie_cfg_read(void __iomem *addr, int where, int size, u32 *val)

return PCIBIOS_SUCCESSFUL;
}
+EXPORT_SYMBOL(dw_pcie_cfg_read);

int dw_pcie_cfg_write(void __iomem *addr, int where, int size, u32 val)
{
@@ -103,6 +104,7 @@ int dw_pcie_cfg_write(void __iomem *addr, int where, int size, u32 val)

return PCIBIOS_SUCCESSFUL;
}
+EXPORT_SYMBOL(dw_pcie_cfg_write);

static inline void dw_pcie_readl_rc(struct pcie_port *pp, u32 reg, u32 *val)
{
@@ -183,6 +185,7 @@ irqreturn_t dw_handle_msi_irq(struct pcie_port *pp)

return ret;
}
+EXPORT_SYMBOL(dw_handle_msi_irq);

void dw_pcie_msi_init(struct pcie_port *pp)
{
@@ -193,6 +196,7 @@ void dw_pcie_msi_init(struct pcie_port *pp)
virt_to_phys((void *)pp->msi_data));
dw_pcie_wr_own_conf(pp, PCIE_MSI_ADDR_HI, 4, 0);
}
+EXPORT_SYMBOL(dw_pcie_msi_init);

static int find_valid_pos0(struct pcie_port *pp, int msgvec, int pos, int *pos0)
{
@@ -401,6 +405,7 @@ int dw_pcie_link_up(struct pcie_port *pp)
else
return 0;
}
+EXPORT_SYMBOL(dw_pcie_link_up);

static int dw_pcie_msi_map(struct irq_domain *domain, unsigned int irq,
irq_hw_number_t hwirq)
@@ -565,6 +570,7 @@ int __init dw_pcie_host_init(struct pcie_port *pp)

return 0;
}
+EXPORT_SYMBOL(dw_pcie_host_init);

static void dw_pcie_prog_viewport_cfg0(struct pcie_port *pp, u32 busdev)
{
@@ -899,6 +905,7 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
PCI_COMMAND_MASTER | PCI_COMMAND_SERR;
dw_pcie_writel_rc(pp, val, PCI_COMMAND);
}
+EXPORT_SYMBOL(dw_pcie_setup_rc);

MODULE_AUTHOR("Jingoo Han <***@samsung.com>");
MODULE_DESCRIPTION("Designware PCIe host controller driver");
diff --git a/drivers/pci/host/pcie-designware.h b/drivers/pci/host/pcie-designware.h
index daf81f9..6e4400b 100644
--- a/drivers/pci/host/pcie-designware.h
+++ b/drivers/pci/host/pcie-designware.h
@@ -76,12 +76,12 @@ struct pcie_host_ops {
u32 (*get_msi_data)(struct pcie_port *pp);
};

-int dw_pcie_cfg_read(void __iomem *addr, int where, int size, u32 *val);
-int dw_pcie_cfg_write(void __iomem *addr, int where, int size, u32 val);
-irqreturn_t dw_handle_msi_irq(struct pcie_port *pp);
-void dw_pcie_msi_init(struct pcie_port *pp);
-int dw_pcie_link_up(struct pcie_port *pp);
-void dw_pcie_setup_rc(struct pcie_port *pp);
-int dw_pcie_host_init(struct pcie_port *pp);
+extern int dw_pcie_cfg_read(void __iomem *addr, int where, int size, u32 *val);
+extern int dw_pcie_cfg_write(void __iomem *addr, int where, int size, u32 val);
+extern irqreturn_t dw_handle_msi_irq(struct pcie_port *pp);
+extern void dw_pcie_msi_init(struct pcie_port *pp);
+extern int dw_pcie_link_up(struct pcie_port *pp);
+extern void dw_pcie_setup_rc(struct pcie_port *pp);
+extern int dw_pcie_host_init(struct pcie_port *pp);

#endif /* _PCIE_DESIGNWARE_H */
--
1.8.1.4
Fabio Estevam
2014-08-30 13:07:30 UTC
Permalink
Post by m***@sai.msu.ru
pcie-spear13xx when built as module requires the functions from pcie-designware.
Export them properly.
---
drivers/pci/host/pcie-designware.c | 7 +++++++
drivers/pci/host/pcie-designware.h | 14 +++++++-------
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index 52bd3a1..7914b92c 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -89,6 +89,7 @@ int dw_pcie_cfg_read(void __iomem *addr, int where, int size, u32 *val)
return PCIBIOS_SUCCESSFUL;
}
+EXPORT_SYMBOL(dw_pcie_cfg_read);
What about using EXPORT_SYMBOL_GPL instead?
Post by m***@sai.msu.ru
-int dw_pcie_cfg_read(void __iomem *addr, int where, int size, u32 *val);
-int dw_pcie_cfg_write(void __iomem *addr, int where, int size, u32 val);
-irqreturn_t dw_handle_msi_irq(struct pcie_port *pp);
-void dw_pcie_msi_init(struct pcie_port *pp);
-int dw_pcie_link_up(struct pcie_port *pp);
-void dw_pcie_setup_rc(struct pcie_port *pp);
-int dw_pcie_host_init(struct pcie_port *pp);
+extern int dw_pcie_cfg_read(void __iomem *addr, int where, int size, u32 *val);
+extern int dw_pcie_cfg_write(void __iomem *addr, int where, int size, u32 val);
+extern irqreturn_t dw_handle_msi_irq(struct pcie_port *pp);
+extern void dw_pcie_msi_init(struct pcie_port *pp);
+extern int dw_pcie_link_up(struct pcie_port *pp);
+extern void dw_pcie_setup_rc(struct pcie_port *pp);
+extern int dw_pcie_host_init(struct pcie_port *pp);
Why is this needed?
Matwey V. Kornilov
2014-09-01 13:25:52 UTC
Permalink
Post by Fabio Estevam
Post by m***@sai.msu.ru
+EXPORT_SYMBOL(dw_pcie_cfg_read);
What about using EXPORT_SYMBOL_GPL instead?
It is for initial author to decide whether he want to export this
function only for GPLed.
Post by Fabio Estevam
Why is this needed?
For style consistency, I believe.
--
With best regards,
Matwey V. Kornilov.
Sternberg Astronomical Institute, Lomonosov Moscow State University, Russia
Bjorn Helgaas
2014-09-16 23:38:41 UTC
Permalink
Post by Fabio Estevam
Post by m***@sai.msu.ru
pcie-spear13xx when built as module requires the functions from pcie-designware.
Export them properly.
I don't know how valuable pcie-spear13xx as a module is. No other host
drivers are supported as a module. Maybe we should just change
pcie-spear13xx from tristate to bool?
Post by Fabio Estevam
Post by m***@sai.msu.ru
---
drivers/pci/host/pcie-designware.c | 7 +++++++
drivers/pci/host/pcie-designware.h | 14 +++++++-------
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index 52bd3a1..7914b92c 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -89,6 +89,7 @@ int dw_pcie_cfg_read(void __iomem *addr, int where, int size, u32 *val)
return PCIBIOS_SUCCESSFUL;
}
+EXPORT_SYMBOL(dw_pcie_cfg_read);
What about using EXPORT_SYMBOL_GPL instead?
Post by m***@sai.msu.ru
-int dw_pcie_cfg_read(void __iomem *addr, int where, int size, u32 *val);
-int dw_pcie_cfg_write(void __iomem *addr, int where, int size, u32 val);
-irqreturn_t dw_handle_msi_irq(struct pcie_port *pp);
-void dw_pcie_msi_init(struct pcie_port *pp);
-int dw_pcie_link_up(struct pcie_port *pp);
-void dw_pcie_setup_rc(struct pcie_port *pp);
-int dw_pcie_host_init(struct pcie_port *pp);
+extern int dw_pcie_cfg_read(void __iomem *addr, int where, int size, u32 *val);
+extern int dw_pcie_cfg_write(void __iomem *addr, int where, int size, u32 val);
+extern irqreturn_t dw_handle_msi_irq(struct pcie_port *pp);
+extern void dw_pcie_msi_init(struct pcie_port *pp);
+extern int dw_pcie_link_up(struct pcie_port *pp);
+extern void dw_pcie_setup_rc(struct pcie_port *pp);
+extern int dw_pcie_host_init(struct pcie_port *pp);
Why is this needed?
- This is logically separate from the EXPORT_SYMBOL change, so it should be
a separate patch.

- I wouldn't take a patch adding "extern" to function declarations in a
header file because I recently removed them all, e.g.,
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=f39d5b72913e.
Mohit KUMAR DCG
2014-09-17 04:54:51 UTC
Permalink
Hello Bjorn,
-----Original Message-----
Sent: Wednesday, September 17, 2014 5:09 AM
To: Fabio Estevam
Subject: Re: [PATCH] Export functions from pcie-designware
Post by m***@sai.msu.ru
pcie-spear13xx when built as module requires the functions from pcie-
designware.
Post by m***@sai.msu.ru
Export them properly.
I don't know how valuable pcie-spear13xx as a module is. No other host
drivers are supported as a module. Maybe we should just change pcie-
spear13xx from tristate to bool?
- Sachin's patch is already doing this:
http://www.spinics.net/lists/linux-pci/msg33665.html

You acknowledge it to apply for v3.17 but somehow it has been left out.

Regards
Mohit
Bjorn Helgaas
2014-09-17 05:11:22 UTC
Permalink
Post by Mohit KUMAR DCG
Hello Bjorn,
-----Original Message-----
Sent: Wednesday, September 17, 2014 5:09 AM
To: Fabio Estevam
Subject: Re: [PATCH] Export functions from pcie-designware
Post by m***@sai.msu.ru
pcie-spear13xx when built as module requires the functions from pcie-
designware.
Post by m***@sai.msu.ru
Export them properly.
I don't know how valuable pcie-spear13xx as a module is. No other host
drivers are supported as a module. Maybe we should just change pcie-
spear13xx from tristate to bool?
http://www.spinics.net/lists/linux-pci/msg33665.html
You acknowledge it to apply for v3.17 but somehow it has been left out.
Oops, sorry! I was pretty sure I remembered a patch like this, but
somehow I deleted the branch before it got fully merged. Anyway, I
re-did it. Thanks for the reminder.

Bjorn
Bjorn Helgaas
2014-09-19 05:15:34 UTC
Permalink
Post by Bjorn Helgaas
Post by Mohit KUMAR DCG
Hello Bjorn,
-----Original Message-----
Sent: Wednesday, September 17, 2014 5:09 AM
To: Fabio Estevam
Subject: Re: [PATCH] Export functions from pcie-designware
Post by m***@sai.msu.ru
pcie-spear13xx when built as module requires the functions from pcie-
designware.
Post by m***@sai.msu.ru
Export them properly.
I don't know how valuable pcie-spear13xx as a module is. No other host
drivers are supported as a module. Maybe we should just change pcie-
spear13xx from tristate to bool?
http://www.spinics.net/lists/linux-pci/msg33665.html
You acknowledge it to apply for v3.17 but somehow it has been left out.
Oops, sorry! I was pretty sure I remembered a patch like this, but
somehow I deleted the branch before it got fully merged. Anyway, I
re-did it. Thanks for the reminder.
Actually, I *had* already merged it, and it's been in Linus' tree since
2014-09-03 15:45:48 (GMT) and appeared in v3.17-rc4:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/pci/host/Kconfig?id=f16c15a0e0ea

Or am I still missing something?

Bjorn
Mohit KUMAR DCG
2014-09-24 04:33:36 UTC
Permalink
Hello Bjorn,
-----Original Message-----
Sent: Friday, September 19, 2014 10:46 AM
To: Mohit KUMAR DCG
Subject: Re: [PATCH] Export functions from pcie-designware
On Tue, Sep 16, 2014 at 9:54 PM, Mohit KUMAR DCG
Post by Mohit KUMAR DCG
Hello Bjorn,
-----Original Message-----
Sent: Wednesday, September 17, 2014 5:09 AM
To: Fabio Estevam
Subject: Re: [PATCH] Export functions from pcie-designware
Post by m***@sai.msu.ru
pcie-spear13xx when built as module requires the functions from pcie-
designware.
Post by m***@sai.msu.ru
Export them properly.
I don't know how valuable pcie-spear13xx as a module is. No other
host drivers are supported as a module. Maybe we should just
change pcie- spear13xx from tristate to bool?
http://www.spinics.net/lists/linux-pci/msg33665.html
You acknowledge it to apply for v3.17 but somehow it has been left out.
Oops, sorry! I was pretty sure I remembered a patch like this, but
somehow I deleted the branch before it got fully merged. Anyway, I
re-did it. Thanks for the reminder.
Actually, I *had* already merged it, and it's been in Linus' tree since
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers
/pci/host/Kconfig?id=f16c15a0e0ea
- yes, its been merged. I think Fabio was working with v3.17-rc2 or earlier.

Fabio,
Pls let us know if you still have any concern after merging of this patch.

Thanks
Mohit
Or am I still missing something?
Bjorn
Loading...