diff mbox

Export functions from pcie-designware

Message ID 1409401476-5002-1-git-send-email-matwey@sai.msu.ru
State Changes Requested
Headers show

Commit Message

Matwey V. Kornilov Aug. 30, 2014, 12:24 p.m. UTC
From: "Matwey V. Kornilov" <matwey@sai.msu.ru>

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

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

Comments

Fabio Estevam Aug. 30, 2014, 1:07 p.m. UTC | #1
On Sat, Aug 30, 2014 at 9:24 AM,  <matwey@sai.msu.ru> wrote:
> From: "Matwey V. Kornilov" <matwey@sai.msu.ru>
>
> pcie-spear13xx when built as module requires the functions from pcie-designware.
> Export them properly.
>
> Signed-off-by: Matwey V. Kornilov <matwey@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?

> -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?
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Matwey V. Kornilov Sept. 1, 2014, 1:25 p.m. UTC | #2
2014-08-30 17:07 GMT+04:00 Fabio Estevam <festevam@gmail.com>:
> On Sat, Aug 30, 2014 at 9:24 AM,  <matwey@sai.msu.ru> wrote:
>> +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.

> Why is this needed?

For style consistency, I believe.
Bjorn Helgaas Sept. 16, 2014, 11:38 p.m. UTC | #3
On Sat, Aug 30, 2014 at 10:07:30AM -0300, Fabio Estevam wrote:
> On Sat, Aug 30, 2014 at 9:24 AM,  <matwey@sai.msu.ru> wrote:
> > From: "Matwey V. Kornilov" <matwey@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?

> >
> > Signed-off-by: Matwey V. Kornilov <matwey@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?
> 
> > -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.
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mohit KUMAR DCG Sept. 17, 2014, 4:54 a.m. UTC | #4
Hello Bjorn,

> -----Original Message-----
> From: Bjorn Helgaas [mailto:bhelgaas@google.com]
> Sent: Wednesday, September 17, 2014 5:09 AM
> To: Fabio Estevam
> Cc: matwey@sai.msu.ru; Mohit KUMAR DCG; Jingoo Han; linux-
> pci@vger.kernel.org; linux-kernel; matwey.kornilov@gmail.com
> Subject: Re: [PATCH] Export functions from pcie-designware
> 
> On Sat, Aug 30, 2014 at 10:07:30AM -0300, Fabio Estevam wrote:
> > On Sat, Aug 30, 2014 at 9:24 AM,  <matwey@sai.msu.ru> wrote:
> > > From: "Matwey V. Kornilov" <matwey@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?
> 
-  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

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Helgaas Sept. 17, 2014, 5:11 a.m. UTC | #5
On Tue, Sep 16, 2014 at 9:54 PM, Mohit KUMAR DCG <Mohit.KUMAR@st.com> wrote:
> Hello Bjorn,
>
>> -----Original Message-----
>> From: Bjorn Helgaas [mailto:bhelgaas@google.com]
>> Sent: Wednesday, September 17, 2014 5:09 AM
>> To: Fabio Estevam
>> Cc: matwey@sai.msu.ru; Mohit KUMAR DCG; Jingoo Han; linux-
>> pci@vger.kernel.org; linux-kernel; matwey.kornilov@gmail.com
>> Subject: Re: [PATCH] Export functions from pcie-designware
>>
>> On Sat, Aug 30, 2014 at 10:07:30AM -0300, Fabio Estevam wrote:
>> > On Sat, Aug 30, 2014 at 9:24 AM,  <matwey@sai.msu.ru> wrote:
>> > > From: "Matwey V. Kornilov" <matwey@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?
>>
> -  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.

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
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Helgaas Sept. 19, 2014, 5:15 a.m. UTC | #6
On Tue, Sep 16, 2014 at 10:11:22PM -0700, Bjorn Helgaas wrote:
> On Tue, Sep 16, 2014 at 9:54 PM, Mohit KUMAR DCG <Mohit.KUMAR@st.com> wrote:
> > Hello Bjorn,
> >
> >> -----Original Message-----
> >> From: Bjorn Helgaas [mailto:bhelgaas@google.com]
> >> Sent: Wednesday, September 17, 2014 5:09 AM
> >> To: Fabio Estevam
> >> Cc: matwey@sai.msu.ru; Mohit KUMAR DCG; Jingoo Han; linux-
> >> pci@vger.kernel.org; linux-kernel; matwey.kornilov@gmail.com
> >> Subject: Re: [PATCH] Export functions from pcie-designware
> >>
> >> On Sat, Aug 30, 2014 at 10:07:30AM -0300, Fabio Estevam wrote:
> >> > On Sat, Aug 30, 2014 at 9:24 AM,  <matwey@sai.msu.ru> wrote:
> >> > > From: "Matwey V. Kornilov" <matwey@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?
> >>
> > -  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.
> 
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mohit KUMAR DCG Sept. 24, 2014, 4:33 a.m. UTC | #7
Hello Bjorn,

> -----Original Message-----
> From: Bjorn Helgaas [mailto:bhelgaas@google.com]
> Sent: Friday, September 19, 2014 10:46 AM
> To: Mohit KUMAR DCG
> Cc: Fabio Estevam; matwey@sai.msu.ru; Jingoo Han; linux-
> pci@vger.kernel.org; linux-kernel; matwey.kornilov@gmail.com
> Subject: Re: [PATCH] Export functions from pcie-designware
> 
> On Tue, Sep 16, 2014 at 10:11:22PM -0700, Bjorn Helgaas wrote:
> > On Tue, Sep 16, 2014 at 9:54 PM, Mohit KUMAR DCG
> <Mohit.KUMAR@st.com> wrote:
> > > Hello Bjorn,
> > >
> > >> -----Original Message-----
> > >> From: Bjorn Helgaas [mailto:bhelgaas@google.com]
> > >> Sent: Wednesday, September 17, 2014 5:09 AM
> > >> To: Fabio Estevam
> > >> Cc: matwey@sai.msu.ru; Mohit KUMAR DCG; Jingoo Han; linux-
> > >> pci@vger.kernel.org; linux-kernel; matwey.kornilov@gmail.com
> > >> Subject: Re: [PATCH] Export functions from pcie-designware
> > >>
> > >> On Sat, Aug 30, 2014 at 10:07:30AM -0300, Fabio Estevam wrote:
> > >> > On Sat, Aug 30, 2014 at 9:24 AM,  <matwey@sai.msu.ru> wrote:
> > >> > > From: "Matwey V. Kornilov" <matwey@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?
> > >>
> > > -  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.
> >
> > 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
> 
- 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
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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 <jg1.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 */