linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* UDC core dependent of CONFIG_MODULES?
@ 2023-03-17 12:08 deffo
  2023-03-17 15:42 ` Alan Stern
  0 siblings, 1 reply; 2+ messages in thread
From: deffo @ 2023-03-17 12:08 UTC (permalink / raw)
  To: linux-usb

Hi all,

is the UDC core meant to be used only with CONFIG_MODULES=y? Because I have the problem, that I want to configure g_ether via CONFIGFS, but when I do

ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/g/UDC

in order to enable the gadget, I get the error:

[ 314.569798] udc-core: couldn't find an available UDC or it's busy

Sure g_ether is already enabled via UDC and as such cannot be configured anymore:

[ 9.981767] udc 49000000.usb-otg: registering UDC driver [g_ether]

Trying to disable UDC via:

echo "" > /sys/kernel/config/usb_gadget/UDC

won't help either. Am I forced to use modules here? Or am I doing something wrong?

Bye,
Joe

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

* Re: UDC core dependent of CONFIG_MODULES?
  2023-03-17 12:08 UDC core dependent of CONFIG_MODULES? deffo
@ 2023-03-17 15:42 ` Alan Stern
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Stern @ 2023-03-17 15:42 UTC (permalink / raw)
  To: deffo; +Cc: linux-usb

On Fri, Mar 17, 2023 at 01:08:43PM +0100, deffo@gmx.de wrote:
> Hi all,
> 
> is the UDC core meant to be used only with CONFIG_MODULES=y? Because I 
> have the problem, that I want to configure g_ether via CONFIGFS, but 
> when I do
> 
> ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/g/UDC
> 
> in order to enable the gadget, I get the error:
> 
> [ 314.569798] udc-core: couldn't find an available UDC or it's busy
> 
> Sure g_ether is already enabled via UDC and as such cannot be 
> configured anymore:
> 
> [ 9.981767] udc 49000000.usb-otg: registering UDC driver [g_ether]
> 
> Trying to disable UDC via:
> 
> echo "" > /sys/kernel/config/usb_gadget/UDC
> 
> won't help either. Am I forced to use modules here? Or am I doing 
> something wrong?

Provided your kernel version is 5.19 or later, you can unbind the UDC 
from the g_ether driver via sysfs:

	echo 49000000.usb-otg >/sys/bus/gadget/drivers/g_ether/unbind

(or something like that).  Once you do that, it should be possible to 
configure your gadget using configfs.

Alan Stern


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

end of thread, other threads:[~2023-03-17 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-17 12:08 UDC core dependent of CONFIG_MODULES? deffo
2023-03-17 15:42 ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).