All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: add EXPORT_SYMBOL_GPL for role init functions
@ 2021-01-26  9:49 Ray Chi
  2021-01-26 10:01 ` Greg KH
  2021-01-27 18:08 ` Christoph Hellwig
  0 siblings, 2 replies; 5+ messages in thread
From: Ray Chi @ 2021-01-26  9:49 UTC (permalink / raw)
  To: balbi, gregkh; +Cc: linux-usb, linux-kernel, kyletso, Ray Chi

Currently, role init functions are used in dwc3 driver but
can't be called from kernel modules.
  dwc3_host_init
  dwc3_host_exit
  dwc3_gadget_init
  dwc3_gadget_exit
  dwc3_event_buffers_setup
  dwc3_event_buffers_cleanup

If other kernel modules want to use these functions, it needs
EXPORT_SYMBOL_GPL() to get compile pass.

Signed-off-by: Ray Chi <raychi@google.com>
---
 drivers/usb/dwc3/core.c   | 2 ++
 drivers/usb/dwc3/gadget.c | 2 ++
 drivers/usb/dwc3/host.c   | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 25c686a752b0..f34a7dd5323e 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -418,6 +418,7 @@ int dwc3_event_buffers_setup(struct dwc3 *dwc)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(dwc3_event_buffers_setup);
 
 void dwc3_event_buffers_cleanup(struct dwc3 *dwc)
 {
@@ -433,6 +434,7 @@ void dwc3_event_buffers_cleanup(struct dwc3 *dwc)
 			| DWC3_GEVNTSIZ_SIZE(0));
 	dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), 0);
 }
+EXPORT_SYMBOL_GPL(dwc3_event_buffers_cleanup);
 
 static int dwc3_alloc_scratch_buffers(struct dwc3 *dwc)
 {
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 80c3ef134e41..43110bfdc440 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -3699,6 +3699,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
 err0:
 	return ret;
 }
+EXPORT_SYMBOL_GPL(dwc3_gadget_init);
 
 /* -------------------------------------------------------------------------- */
 
@@ -3712,6 +3713,7 @@ void dwc3_gadget_exit(struct dwc3 *dwc)
 	dma_free_coherent(dwc->sysdev, sizeof(*dwc->ep0_trb) * 2,
 			  dwc->ep0_trb, dwc->ep0_trb_addr);
 }
+EXPORT_SYMBOL_GPL(dwc3_gadget_exit);
 
 int dwc3_gadget_suspend(struct dwc3 *dwc)
 {
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index bef1c1ac2067..30589e313a67 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -126,8 +126,10 @@ int dwc3_host_init(struct dwc3 *dwc)
 	platform_device_put(xhci);
 	return ret;
 }
+EXPORT_SYMBOL_GPL(dwc3_host_init);
 
 void dwc3_host_exit(struct dwc3 *dwc)
 {
 	platform_device_unregister(dwc->xhci);
 }
+EXPORT_SYMBOL_GPL(dwc3_host_exit);
-- 
2.30.0.280.ga3ce27912f-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: dwc3: add EXPORT_SYMBOL_GPL for role init functions
  2021-01-26  9:49 [PATCH] usb: dwc3: add EXPORT_SYMBOL_GPL for role init functions Ray Chi
@ 2021-01-26 10:01 ` Greg KH
  2021-01-26 12:14   ` Ray Chi
  2021-01-27 18:08 ` Christoph Hellwig
  1 sibling, 1 reply; 5+ messages in thread
From: Greg KH @ 2021-01-26 10:01 UTC (permalink / raw)
  To: Ray Chi; +Cc: balbi, linux-usb, linux-kernel, kyletso

On Tue, Jan 26, 2021 at 05:49:13PM +0800, Ray Chi wrote:
> Currently, role init functions are used in dwc3 driver but
> can't be called from kernel modules.
>   dwc3_host_init
>   dwc3_host_exit
>   dwc3_gadget_init
>   dwc3_gadget_exit
>   dwc3_event_buffers_setup
>   dwc3_event_buffers_cleanup
> 
> If other kernel modules want to use these functions, it needs
> EXPORT_SYMBOL_GPL() to get compile pass.
> 
> Signed-off-by: Ray Chi <raychi@google.com>

What current kernel configuration fails without this patch applied?  I
don't see any in-tree users of this as a module that would break, or am
I missing something?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: dwc3: add EXPORT_SYMBOL_GPL for role init functions
  2021-01-26 10:01 ` Greg KH
@ 2021-01-26 12:14   ` Ray Chi
  2021-01-26 12:20     ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Ray Chi @ 2021-01-26 12:14 UTC (permalink / raw)
  To: Greg KH; +Cc: balbi, linux-usb, linux-kernel, Kyle Tso

On Tue, Jan 26, 2021 at 6:01 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Tue, Jan 26, 2021 at 05:49:13PM +0800, Ray Chi wrote:
> > Currently, role init functions are used in dwc3 driver but
> > can't be called from kernel modules.
> >   dwc3_host_init
> >   dwc3_host_exit
> >   dwc3_gadget_init
> >   dwc3_gadget_exit
> >   dwc3_event_buffers_setup
> >   dwc3_event_buffers_cleanup
> >
> > If other kernel modules want to use these functions, it needs
> > EXPORT_SYMBOL_GPL() to get compile pass.
> >
> > Signed-off-by: Ray Chi <raychi@google.com>
>
> What current kernel configuration fails without this patch applied?  I
> don't see any in-tree users of this as a module that would break, or am
> I missing something?
>
> thanks,
>
> greg k-h

There is no failure for current status. This patch is just used for
any kernel modules
which want to call these functions. I think it is an expandability of
dwc3 core driver.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: dwc3: add EXPORT_SYMBOL_GPL for role init functions
  2021-01-26 12:14   ` Ray Chi
@ 2021-01-26 12:20     ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2021-01-26 12:20 UTC (permalink / raw)
  To: Ray Chi; +Cc: balbi, linux-usb, linux-kernel, Kyle Tso

On Tue, Jan 26, 2021 at 08:14:02PM +0800, Ray Chi wrote:
> On Tue, Jan 26, 2021 at 6:01 PM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Tue, Jan 26, 2021 at 05:49:13PM +0800, Ray Chi wrote:
> > > Currently, role init functions are used in dwc3 driver but
> > > can't be called from kernel modules.
> > >   dwc3_host_init
> > >   dwc3_host_exit
> > >   dwc3_gadget_init
> > >   dwc3_gadget_exit
> > >   dwc3_event_buffers_setup
> > >   dwc3_event_buffers_cleanup
> > >
> > > If other kernel modules want to use these functions, it needs
> > > EXPORT_SYMBOL_GPL() to get compile pass.
> > >
> > > Signed-off-by: Ray Chi <raychi@google.com>
> >
> > What current kernel configuration fails without this patch applied?  I
> > don't see any in-tree users of this as a module that would break, or am
> > I missing something?
> >
> > thanks,
> >
> > greg k-h
> 
> There is no failure for current status. This patch is just used for
> any kernel modules
> which want to call these functions. I think it is an expandability of
> dwc3 core driver.

We will gladly take exports for in-kernel users, but as you well know,
we can not export symbols that no one in the kernel tree needs, that
would be foolish of us to do so.

Please submit the code that uses these symbols and include this patch as
part of that patch series and all will be good!

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: dwc3: add EXPORT_SYMBOL_GPL for role init functions
  2021-01-26  9:49 [PATCH] usb: dwc3: add EXPORT_SYMBOL_GPL for role init functions Ray Chi
  2021-01-26 10:01 ` Greg KH
@ 2021-01-27 18:08 ` Christoph Hellwig
  1 sibling, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2021-01-27 18:08 UTC (permalink / raw)
  To: Ray Chi; +Cc: balbi, gregkh, linux-usb, linux-kernel, kyletso

On Tue, Jan 26, 2021 at 05:49:13PM +0800, Ray Chi wrote:
> Currently, role init functions are used in dwc3 driver but
> can't be called from kernel modules.
>   dwc3_host_init
>   dwc3_host_exit
>   dwc3_gadget_init
>   dwc3_gadget_exit
>   dwc3_event_buffers_setup
>   dwc3_event_buffers_cleanup
> 
> If other kernel modules want to use these functions, it needs
> EXPORT_SYMBOL_GPL() to get compile pass.

What "other kernel modules" would want to use it an why?

Please specify that in your patch, and only resend it togethe with the
patches actually adding/modifying those modules.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-27 18:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26  9:49 [PATCH] usb: dwc3: add EXPORT_SYMBOL_GPL for role init functions Ray Chi
2021-01-26 10:01 ` Greg KH
2021-01-26 12:14   ` Ray Chi
2021-01-26 12:20     ` Greg KH
2021-01-27 18:08 ` Christoph Hellwig

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.