linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Mainlining Linux Sunxi SoC AW USB
@ 2021-07-24  9:54 Petr Vorel
  2021-07-24 10:29 ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Petr Vorel @ 2021-07-24  9:54 UTC (permalink / raw)
  To: linux-usb

Hi,

I'd like to cleanup and mainline Linux Sunxi SoC AW USB host driver [1].

What are the most ugly parts which should be replaced? Loading module does not
complain about anything?
[267044.912155] awusb: loading out-of-tree module taints kernel.
[267044.912257] awusb: module verification failed: signature and/or required key missing - tainting kernel
[267044.913399] usbcore: registered new interface driver allwinner
[267044.913401] awusb: v0.5:AW USB driver

BTW should it go to the host/Kconfig or misc/Kconfig or elsewhere?

Thanks for info.

Kind regards,
Petr

[1] https://github.com/linux-sunxi/sunxi-livesuite/blob/master/awusb/awusb.c

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

* Re: Mainlining Linux Sunxi SoC AW USB
  2021-07-24  9:54 Mainlining Linux Sunxi SoC AW USB Petr Vorel
@ 2021-07-24 10:29 ` Greg KH
  2021-07-24 13:41   ` Petr Vorel
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2021-07-24 10:29 UTC (permalink / raw)
  To: Petr Vorel; +Cc: linux-usb

On Sat, Jul 24, 2021 at 11:54:40AM +0200, Petr Vorel wrote:
> Hi,
> 
> I'd like to cleanup and mainline Linux Sunxi SoC AW USB host driver [1].

Great!

> What are the most ugly parts which should be replaced? Loading module does not
> complain about anything?
> [267044.912155] awusb: loading out-of-tree module taints kernel.

That will be fixed by moving it into the tree.

> [267044.912257] awusb: module verification failed: signature and/or required key missing - tainting kernel

That shows a mis-match between you building a kernel and what keys were
used to build the distro kernel you are using.

> [267044.913399] usbcore: registered new interface driver allwinner
> [267044.913401] awusb: v0.5:AW USB driver

Looks fine.

> BTW should it go to the host/Kconfig or misc/Kconfig or elsewhere?

No idea, is this a host driver or does it control a USB device you plug
into the system?

> [1] https://github.com/linux-sunxi/sunxi-livesuite/blob/master/awusb/awusb.c

I looked at this, and it's a device driver, not a host controller
driver.

But it looks to need a userspace program for the ioctls, where is that
code at?  And why does it need any ioctls at all?

Why is this even a driver at all, it looks like you can write a small
userspace program using libusb to do everything it does, right?  What
exactly is this driver needed for?

thanks,

greg k-h

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

* Re: Mainlining Linux Sunxi SoC AW USB
  2021-07-24 10:29 ` Greg KH
@ 2021-07-24 13:41   ` Petr Vorel
  2021-07-24 14:17     ` Greg KH
  2021-07-24 14:49     ` Felipe Balbi
  0 siblings, 2 replies; 8+ messages in thread
From: Petr Vorel @ 2021-07-24 13:41 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-usb, linux-sunxi, linux-sunxi

Hi Greg,

[ Cc: linux-sunxi@lists.linux.dev and linux-sunxi@googlegroups.com, which I
should have done before ]

> On Sat, Jul 24, 2021 at 11:54:40AM +0200, Petr Vorel wrote:
> > Hi,

> > I'd like to cleanup and mainline Linux Sunxi SoC AW USB host driver [1].

> Great!

> > What are the most ugly parts which should be replaced? Loading module does not
> > complain about anything?
> > [267044.912155] awusb: loading out-of-tree module taints kernel.

> That will be fixed by moving it into the tree.

> > [267044.912257] awusb: module verification failed: signature and/or required key missing - tainting kernel

> That shows a mis-match between you building a kernel and what keys were
> used to build the distro kernel you are using.

> > [267044.913399] usbcore: registered new interface driver allwinner
> > [267044.913401] awusb: v0.5:AW USB driver

> Looks fine.
Yep, I meant by this, that I see nothing serious (i.e. agree with you).

> > BTW should it go to the host/Kconfig or misc/Kconfig or elsewhere?

> No idea, is this a host driver or does it control a USB device you plug
> into the system?

> > [1] https://github.com/linux-sunxi/sunxi-livesuite/blob/master/awusb/awusb.c

> I looked at this, and it's a device driver, not a host controller
> driver.

> But it looks to need a userspace program for the ioctls, where is that
> code at?  And why does it need any ioctls at all?

> Why is this even a driver at all, it looks like you can write a small
> userspace program using libusb to do everything it does, right?  What
> exactly is this driver needed for?

I'm sorry for not providing more info at the beginning. This is a driver for
host computer (i.e. developers laptop) used by LiveSuit tool [2] to flash Images
to the NAND of Allwinner devices. LiveSuit itself [3] is unfortunately provided
only in binary form. The only open source code with GPL v2 license is awusb
driver. Thus I thought I could ease my life with upstreaming at least the
kernel driver. But maybe it's not a good idea. I'm using LiveSuit for flashing
Allwinner A31, but it requires quite old distro due libqtgui4. Maybe sunxi folks
use something newer nowadays, but I haven't found anything in their wiki.

Kind regards,
Petr

[2] https://github.com/linux-sunxi/sunxi-livesuite
[3] https://github.com/linux-sunxi/sunxi-livesuite/tree/master/x86-64

> thanks,

> greg k-h

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

* Re: Mainlining Linux Sunxi SoC AW USB
  2021-07-24 13:41   ` Petr Vorel
@ 2021-07-24 14:17     ` Greg KH
  2021-07-24 14:22       ` Petr Vorel
  2021-07-24 14:49     ` Felipe Balbi
  1 sibling, 1 reply; 8+ messages in thread
From: Greg KH @ 2021-07-24 14:17 UTC (permalink / raw)
  To: Petr Vorel; +Cc: linux-usb, linux-sunxi, linux-sunxi

On Sat, Jul 24, 2021 at 03:41:42PM +0200, Petr Vorel wrote:
> > Why is this even a driver at all, it looks like you can write a small
> > userspace program using libusb to do everything it does, right?  What
> > exactly is this driver needed for?
> 
> I'm sorry for not providing more info at the beginning. This is a driver for
> host computer (i.e. developers laptop) used by LiveSuit tool [2] to flash Images
> to the NAND of Allwinner devices. LiveSuit itself [3] is unfortunately provided
> only in binary form. The only open source code with GPL v2 license is awusb
> driver. Thus I thought I could ease my life with upstreaming at least the
> kernel driver. But maybe it's not a good idea. I'm using LiveSuit for flashing
> Allwinner A31, but it requires quite old distro due libqtgui4. Maybe sunxi folks
> use something newer nowadays, but I haven't found anything in their wiki.

Ah, that's not going to be good then.  Really, this doesn't seem to need
to be a driver at all, and the ioctls are really strange so we would
need to change them anyway before it could be merged.  But with no
access to userspace code, that will be quite difficult, so I would push
back on allwinner and have them work on resolving this.

thanks,

greg k-h

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

* Re: Mainlining Linux Sunxi SoC AW USB
  2021-07-24 14:17     ` Greg KH
@ 2021-07-24 14:22       ` Petr Vorel
  2021-07-24 14:45         ` [linux-sunxi] " Christopher Obbard
  2021-07-24 14:54         ` Jernej Škrabec
  0 siblings, 2 replies; 8+ messages in thread
From: Petr Vorel @ 2021-07-24 14:22 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-usb, linux-sunxi, linux-sunxi

Hi Greg,

> On Sat, Jul 24, 2021 at 03:41:42PM +0200, Petr Vorel wrote:
> > > Why is this even a driver at all, it looks like you can write a small
> > > userspace program using libusb to do everything it does, right?  What
> > > exactly is this driver needed for?

> > I'm sorry for not providing more info at the beginning. This is a driver for
> > host computer (i.e. developers laptop) used by LiveSuit tool [2] to flash Images
> > to the NAND of Allwinner devices. LiveSuit itself [3] is unfortunately provided
> > only in binary form. The only open source code with GPL v2 license is awusb
> > driver. Thus I thought I could ease my life with upstreaming at least the
> > kernel driver. But maybe it's not a good idea. I'm using LiveSuit for flashing
> > Allwinner A31, but it requires quite old distro due libqtgui4. Maybe sunxi folks
> > use something newer nowadays, but I haven't found anything in their wiki.

> Ah, that's not going to be good then.  Really, this doesn't seem to need
> to be a driver at all, and the ioctls are really strange so we would
> need to change them anyway before it could be merged.  But with no
> access to userspace code, that will be quite difficult, so I would push
> back on allwinner and have them work on resolving this.
Understand, it makes sense. Thanks for your time!

@Sunxi community: am I missing something? Using LiveSuit with old distro chroot
and Xephyr with out-of-tree module isn't fun :(.

Kind regards,
Petr

> thanks,

> greg k-h

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

* Re: [linux-sunxi] Re: Mainlining Linux Sunxi SoC AW USB
  2021-07-24 14:22       ` Petr Vorel
@ 2021-07-24 14:45         ` Christopher Obbard
  2021-07-24 14:54         ` Jernej Škrabec
  1 sibling, 0 replies; 8+ messages in thread
From: Christopher Obbard @ 2021-07-24 14:45 UTC (permalink / raw)
  To: petr.vorel; +Cc: Greg KH, linux-usb, linux-sunxi, mailing list linux-sunxi

Peter,

On Sat, 24 Jul 2021 at 15:22, Petr Vorel <petr.vorel@gmail.com> wrote:
>
> Hi Greg,
>
> > On Sat, Jul 24, 2021 at 03:41:42PM +0200, Petr Vorel wrote:
> > > > Why is this even a driver at all, it looks like you can write a small
> > > > userspace program using libusb to do everything it does, right?  What
> > > > exactly is this driver needed for?
>
> > > I'm sorry for not providing more info at the beginning. This is a driver for
> > > host computer (i.e. developers laptop) used by LiveSuit tool [2] to flash Images
> > > to the NAND of Allwinner devices. LiveSuit itself [3] is unfortunately provided
> > > only in binary form. The only open source code with GPL v2 license is awusb
> > > driver. Thus I thought I could ease my life with upstreaming at least the
> > > kernel driver. But maybe it's not a good idea. I'm using LiveSuit for flashing
> > > Allwinner A31, but it requires quite old distro due libqtgui4. Maybe sunxi folks
> > > use something newer nowadays, but I haven't found anything in their wiki.
>
> > Ah, that's not going to be good then.  Really, this doesn't seem to need
> > to be a driver at all, and the ioctls are really strange so we would
> > need to change them anyway before it could be merged.  But with no
> > access to userspace code, that will be quite difficult, so I would push
> > back on allwinner and have them work on resolving this.
> Understand, it makes sense. Thanks for your time!
>
> @Sunxi community: am I missing something? Using LiveSuit with old distro chroot
> and Xephyr with out-of-tree module isn't fun :(.

Suggest you take a look at sunxi-tools - specifically the sunxi-fel
tool. This is a libusb-based userland tool to talk to these devices.
I'm not sure if it supports flashing to nand on A31 - never tried it -
but have used it to flash to eMMC and SPI flash on their other chips.

hth,
Chris

>
> Kind regards,
> Petr
>
> > thanks,
>
> > greg k-h
>
> --
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/YPwiGB7VnzECN/jg%40pevik.

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

* Re: Mainlining Linux Sunxi SoC AW USB
  2021-07-24 13:41   ` Petr Vorel
  2021-07-24 14:17     ` Greg KH
@ 2021-07-24 14:49     ` Felipe Balbi
  1 sibling, 0 replies; 8+ messages in thread
From: Felipe Balbi @ 2021-07-24 14:49 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Greg KH, linux-usb, linux-sunxi, linux-sunxi


Hi,

Petr Vorel <petr.vorel@gmail.com> writes:
>> > [1] https://github.com/linux-sunxi/sunxi-livesuite/blob/master/awusb/awusb.c
>
>> Why is this even a driver at all, it looks like you can write a small
>> userspace program using libusb to do everything it does, right?  What
>> exactly is this driver needed for?
>
> I'm sorry for not providing more info at the beginning. This is a driver for
> host computer (i.e. developers laptop) used by LiveSuit tool [2] to flash Images
> to the NAND of Allwinner devices. LiveSuit itself [3] is unfortunately provided
> only in binary form. The only open source code with GPL v2 license is awusb
> driver. Thus I thought I could ease my life with upstreaming at least the
> kernel driver. But maybe it's not a good idea. I'm using LiveSuit for flashing
> Allwinner A31, but it requires quite old distro due libqtgui4. Maybe sunxi folks
> use something newer nowadays, but I haven't found anything in their wiki.

looks like you could implement that entirely in userspace with libusb ;-)

-- 
balbi

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

* Re: Mainlining Linux Sunxi SoC AW USB
  2021-07-24 14:22       ` Petr Vorel
  2021-07-24 14:45         ` [linux-sunxi] " Christopher Obbard
@ 2021-07-24 14:54         ` Jernej Škrabec
  1 sibling, 0 replies; 8+ messages in thread
From: Jernej Škrabec @ 2021-07-24 14:54 UTC (permalink / raw)
  To: Greg KH, Petr Vorel; +Cc: linux-usb, linux-sunxi, linux-sunxi

Dne sobota, 24. julij 2021 ob 16:22:16 CEST je Petr Vorel napisal(a):
> Hi Greg,
> 
> > On Sat, Jul 24, 2021 at 03:41:42PM +0200, Petr Vorel wrote:
> > > > Why is this even a driver at all, it looks like you can write a small
> > > > userspace program using libusb to do everything it does, right?  What
> > > > exactly is this driver needed for?
> > > 
> > > I'm sorry for not providing more info at the beginning. This is a driver
> > > for host computer (i.e. developers laptop) used by LiveSuit tool [2] to
> > > flash Images to the NAND of Allwinner devices. LiveSuit itself [3] is
> > > unfortunately provided only in binary form. The only open source code
> > > with GPL v2 license is awusb driver. Thus I thought I could ease my
> > > life with upstreaming at least the kernel driver. But maybe it's not a
> > > good idea. I'm using LiveSuit for flashing Allwinner A31, but it
> > > requires quite old distro due libqtgui4. Maybe sunxi folks use
> > > something newer nowadays, but I haven't found anything in their wiki.> 
> > Ah, that's not going to be good then.  Really, this doesn't seem to need
> > to be a driver at all, and the ioctls are really strange so we would
> > need to change them anyway before it could be merged.  But with no
> > access to userspace code, that will be quite difficult, so I would push
> > back on allwinner and have them work on resolving this.
> 
> Understand, it makes sense. Thanks for your time!
> 
> @Sunxi community: am I missing something? Using LiveSuit with old distro
> chroot and Xephyr with out-of-tree module isn't fun :(.

Community is mostly concerned with mainline kernel nowadays and thus with 
standard tools. Few people still use vendor (BSP) kernel and most of those use 
it without LiveSuit (like custom distro images).

Now and then people ask about LiveSuit on IRC, but they usually get little 
response.

Best regards,
Jernej

> 
> Kind regards,
> Petr
> 
> > thanks,
> > 
> > greg k-h





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

end of thread, other threads:[~2021-07-24 15:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-24  9:54 Mainlining Linux Sunxi SoC AW USB Petr Vorel
2021-07-24 10:29 ` Greg KH
2021-07-24 13:41   ` Petr Vorel
2021-07-24 14:17     ` Greg KH
2021-07-24 14:22       ` Petr Vorel
2021-07-24 14:45         ` [linux-sunxi] " Christopher Obbard
2021-07-24 14:54         ` Jernej Škrabec
2021-07-24 14:49     ` Felipe Balbi

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).