OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - Other distros support => Topic started by: maynard on December 16, 2021, 01:21:29 am

Title: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on December 16, 2021, 01:21:29 am
When I place my SL-6000 in the USB cradle/docking station connected to a PC running Linux kernel 2.6.32, a new USB0 connection is automatically created on my PC. However, in later kernels 3/4/5, I get an error message "Bad CDC descriptors" and no network connection. I am using the stock Sharp OS on my Tosa.

Has anyone managed to get a USB network connection working on a PC running a 3+ kernel after docking their SL6000?

Someone else had a similar issue many years ago:

https://forums.raspberrypi.com/viewtopic.php?t=25159&start=50
Title: Re: Connecting SL-6000 Tosa to PC with Linux Kernels 3/4/5
Post by: Varti on December 16, 2021, 04:49:22 am
Hi and welcome! I have moved the topic out of the Archived section, for better visibility.

If I have understood the thread you have linked, 6000s don't work anymore with recent kernels, while 5500s still work, since the device is seen as a CDC Ether device, while the 5500 registers itself as a serial one. The workaround described in the thread seems to be to force to register the 6000 as a serial device too.

BTW sdjf has been an active member here in the past, although he hasn't logged in here since some years.

Varti
Title: Re: Connecting SL-6000 Tosa to PC with Linux Kernels 3/4/5
Post by: maynard on December 16, 2021, 05:17:16 pm
Hi Varti,

Thank you for moving me out of the Archived section!

I have been looking for a solution to this over the past year or so. There are a few other Zaurii in the cdc_ether.c blacklist such as the SL-5600 poodle, as well as some that were sold only in Japan: SL-A300 / C700 / C750 / C760 / C860. I am guessing that networking via the USB docking station doesn't work for SL-5600 users either.

If you were an Ubuntu user, you might not have encountered this issue until 2012 after it moved to Kernel 3, by which time the SL-6000 was getting quite old.

Anyway, I decided to post here on the slim chance that someone has been able to find a workaround to this problem.
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on February 14, 2022, 03:51:11 pm
The kernel developers have kindly applied a patch to fix this issue: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=6605cc67ca18
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: Varti on February 15, 2022, 09:58:44 am
Great, thanks for this patch! I had some free time today and I have tried to connect three cradles/USB cables I own to my laptop:
- CE-ST7 (cradle, with an SL-5500)
- CE-ST8 (cradle, SL-A300)
- CE-UA1 (USB interface and cable, with an SL-5500, SL-B500/SL-5600, SL-6000N and an SL-A300)

My laptop is running Void Linux with kernel 5.10.20_1. I have managed to successfully connect the 5500 (with both its cradle and the cable), while the other 3 Zauruses show the same "bad CDC descriptors" error. I have also the SL-C clamshell models, I suspect they'll have the same issues. I guess they'll need a patch too, I'll see if I'll find some time to prepare one myself for them too, it would be very handy to be able to connect to all the Zauruses via USB.

 


Here's the output of dmesg for all the devices:

Code: [Select]
CE-ST7 (cradle) SL-5500:
[  256.488449] usb 2-2: new full-speed USB device number 3 using xhci_hcd
[  256.667755] usb 2-2: New USB device found, idVendor=04dd, idProduct=8004, bcdDevice= 0.00
[  256.667763] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  256.667767] usb 2-2: Product: SL-5500
[  256.667770] usb 2-2: Manufacturer: Sharp
[  256.667773] usb 2-2: SerialNumber: 400002000001
[  256.722789] usbcore: registered new interface driver cdc_ether
[  256.744888] zaurus 2-2:1.0 usb0: register 'zaurus' at usb-0000:00:10.0-2, Sharp Zaurus SL-5x00, 4a:71:73:4d:b2:da
[  256.752775] usbcore: registered new interface driver zaurus
[  256.761554] zaurus 2-2:1.0 enp0s16u2: renamed from usb0

CE-ST8 (cradle) SL-A300:
[ 3289.448559] usb 2-2: new full-speed USB device number 29 using xhci_hcd
[ 3289.610845] usb 2-2: New USB device found, idVendor=04dd, idProduct=8005, bcdDevice= 0.00
[ 3289.610853] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3289.610857] usb 2-2: Product: SL-A300
[ 3289.610860] usb 2-2: Manufacturer: Sharp
[ 3289.634091] usb 2-2: bad CDC descriptors

CE-UA1 (cable)
--------------

SL-B500 (SL-5600):
[ 2318.272523] usb 2-2: new full-speed USB device number 26 using xhci_hcd
[ 2318.433237] usb 2-2: New USB device found, idVendor=04dd, idProduct=8006, bcdDevice= 0.00
[ 2318.433246] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2318.433250] usb 2-2: Product: SL-B500
[ 2318.433253] usb 2-2: Manufacturer: Sharp
[ 2318.456418] usb 2-2: bad CDC descriptors

SL-5500:
[ 2387.942100] usb 2-2: USB disconnect, device number 26
[ 2563.752533] usb 2-2: new full-speed USB device number 27 using xhci_hcd
[ 2563.930405] usb 2-2: New USB device found, idVendor=04dd, idProduct=8004, bcdDevice= 0.00
[ 2563.930413] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2563.930418] usb 2-2: Product: SL-5500
[ 2563.930421] usb 2-2: Manufacturer: Sharp
[ 2563.930424] usb 2-2: SerialNumber: 400002000001
[ 2563.957352] zaurus 2-2:1.0 usb0: register 'zaurus' at usb-0000:00:10.0-2, Sharp Zaurus SL-5x00, 4a:71:73:4d:b2:da
[ 2563.981569] zaurus 2-2:1.0 enp0s16u2: renamed from usb0

SL-6000N:
[ 3186.512562] usb 2-2: new full-speed USB device number 28 using xhci_hcd
[ 3186.674872] usb 2-2: New USB device found, idVendor=04dd, idProduct=9032, bcdDevice= 0.00
[ 3186.674880] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3186.674884] usb 2-2: Product: SL-6000
[ 3186.674887] usb 2-2: Manufacturer: Sharp
[ 3186.698092] usb 2-2: bad CDC descriptors

SL-A300:
[ 3289.448559] usb 2-2: new full-speed USB device number 29 using xhci_hcd
[ 3289.610845] usb 2-2: New USB device found, idVendor=04dd, idProduct=8005, bcdDevice= 0.00
[ 3289.610853] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3289.610857] usb 2-2: Product: SL-A300
[ 3289.610860] usb 2-2: Manufacturer: Sharp
[ 3289.634091] usb 2-2: bad CDC descriptors

Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on February 15, 2022, 04:00:13 pm
Hi Varti,

Thanks for the reply!

The bug report I created was: https://bugzilla.kernel.org/show_bug.cgi?id=215361. It took me a few weeks to track down the offending patch using git bisect as instructed by Greg Kroah-Hartman.

[16adf5d07987d93675945f3cecf0e33706566005] usbnet: Remove over-broad module alias from zaurus.

That patch removed the following lines from zaurus.c which were in the 2.6 kernel:

    USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM,
            USB_CDC_PROTO_NONE),
    .driver_info = (unsigned long) &bogus_mdlm_info,
}, {

A quick and dirty fix would be to add the above lines back into zaurus.c and compile the module (I tried that myself over a month ago and it did work for the SL-6000). For future versions of the kernel you could create new bug report(s) for your other Zaurii that have the same issue.

If you just want to try fixing the problem for your SL-6000, just apply the new patch below and re-compile zauruc.c and cdc_ether.c:

https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/patch?id=6605cc67ca18b9d583eb96e18a20f5f4e726103c

By the way, I know for a fact that SL-5600 compatibility was also broken by the offending patch, but I did not create a bug report for that, mainly because I don't use it any more...

Good luck!
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: Varti on February 16, 2022, 06:55:59 am
Ok, I'll give it a try. I'm unsure if the SL-C1/3xxx USB ports are recognized in the same way, or if the custom connector can still be used with the CE-UA1 cable. I have noticed that there's a "SL-C3000 PDA in MDLM mode" entry in zaurus.c, I wonder if that mode has to be manually activated.

Varti
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on February 16, 2022, 05:22:05 pm
Maybe just try adding

    USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM,
            USB_CDC_PROTO_NONE),
    .driver_info = (unsigned long) &bogus_mdlm_info,
}, {

to the 5.10.20_1 kernel's version of zaurus.c, and see if you can ping your other devices after compiling to the new zaurus.ko...

Those lines should be inserted before:

    /* Motorola Rokr E6 */
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: Varti on February 17, 2022, 06:30:34 am
Thanks, I'll try that.
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on March 12, 2022, 02:25:19 am
The patch for the SL-6000 has now been applied to the following kernel versions in git:

4.9.304
4.14.269
4.19.232
5.4.182
5.10.103
5.15.26
5.16.12
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on March 13, 2022, 07:11:19 pm
Hi Varti,

If you connect your SL-C1/3xxx devices using a mini B cable, are they recognised by your Linux PC? (The cable for the SL-6000 cradle has a mini B plug.) I found from this website that these devices behave differently depending on whether you use a mini A or mini B plug: www.users.on.net/~hluc/myZaurus/

Another point is that the following line was not added to zaurus.c until well after the patch which broke SL-6000/5600 compatibility:

/* C-750/C-760/C-860/SL-C3000 PDA in MDLM mode */

So I am hoping that support for SL-C1/3xxx as client devices is not broken.
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on March 14, 2022, 02:49:50 am
It seems that the same patch that broke SL-5600/6000 loading also affected C-750/C-760/C-860/SL-C3000, so another patch was applied for those devices in 2012 as a fix.

https://kernel.googlesource.com/pub/scm/linux/kernel/git/jejb/parisc-2.6/+/15103aa7a033d7d671c75cc3a71d772dbcbae61e
https://www.spinics.net/lists/netdev/msg189543.html
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: Varti on March 15, 2022, 05:25:40 am
So, I guess that both the "cradle" cable and the USB one on the clamshell devices should be working. I'll do another round of checks to confirm that.

Varti
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on April 22, 2022, 12:06:21 am
The SL-6000 was detected without errors by Ubuntu 22.04 (live DVD).
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on March 21, 2023, 12:25:56 am
Hi Varti,
Would you happen to know where I can buy an SL-A300? I purchased two of them from auctions.yahoo.co.jp, but it turns out neither of them worked. I think the batteries were dead as they would not switch on after many hours of charging.
I want to report a bug at bugzilla.kernel.org so that they will fix broken SL-A300 support in recent kernels.
Thanks
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: Varti on March 23, 2023, 10:13:43 am
Hi maynard, great to hear that you're supporting other Zaurus models! You might want to order one or two new batteries from Cameron Sino, I have recently contacted them and they have told me that they still sell newly manufactured EA-BL06 (and EA-BL08 too for newer Zauruses) batteries. That will be easier than hunting for an A300, as they are quite rare even on Yahoo Auction.

Unfortunately I'm not aware of any other site with Zaurus ads than Auction, except for the few ones on Amazon/Ebay that are sold at premium prices...

https://www.cameronsino.com/searchProduct?keyword=EA-BL06

Varti
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on March 23, 2023, 09:52:32 pm
Hi Varti,
Thank you for that information. I did not know that the SL-A300 uses the EA-BL06 battery.
I had a look at the Japanese manual, and it says that the customer cannot replace the battery, but should ask the retailer or Sharp customer service (この製品の充電池は、お客様では交換できませんので、お買い上げの販売店、またはもよりのシャープお客様ご相談窓口にお問い合わせください).
I have no experience taking apart electronics, so I guess I might have to take it to an electronics repair shop. Did you ever have to replace your SL-A300's battery?
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: Varti on March 24, 2023, 05:26:57 am
I remembered reading somewhere that the A300 has a replaceable EA-BL06 battery, though I might remember this wrong. I also have 2 A300's, I never had to check for the batteries since they both still work. I'll try to find some time to try to open one of them and check its battery. There's very little info about them in the forum, I believe they were not very popular since they lack a keyboard.

Varti
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on March 28, 2023, 02:58:00 am
Thanks, Varti. Let me know if you ever want to sell one of your SL-A300s.
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on May 08, 2023, 04:33:45 am
Hi Varti,
I managed to take the back cover off the A300 and remove the battery. It is thinner than the EA-BL06 and does not look like something you could buy online (see attached photo).
I would need access to a working A300 in order to test any patch before it is added to the Linux kernel. Could you possibly lend one of your devices to me? I would pay for international postage and return it as soon as I test the patch...
If you would like to discuss offline, please send me a PM.
Thanks!
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: Varti on May 11, 2023, 03:44:22 am
Hi, sorry for not checking myself the battery, unfortunately I don't have much free time lately. Too bad its battery is a non-standard one... If you'd be interested in buying a new one, I have now written an inquiry to Cameron Sino asking them if they have it in stock. I have attached your photo to the email; if they don't have in stock batteries specifically for this model, we might be lucky and find out that it's the same battery for another device, which they manufacture.

Check also your PM.

Varti
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on May 11, 2023, 05:37:54 am
Thanks, Varti. That's really helpful. Fingers crossed!
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on July 03, 2023, 08:04:25 pm
Hi Varti,
I was finally able to buy a couple of SL-A300s on ebay. Thankfully their batteries are still functional.
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: Varti on July 05, 2023, 04:40:51 am
Congratulations, that's nice to hear. I have been searching them on buyee from time but to no avail.

Varti
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on July 09, 2023, 05:42:17 am
Hi Varti,
I have attached a patch that would add back Linux support for your SL-5600 and A300 (and also the C700 which AFAIK you don't own). I applied the patch yesterday and compiled the kernel, and it worked. I am not sure if this will ever get added to the official Linux kernel though  :(
Oh well, at least SL-6000 support was fixed last year :)
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on August 09, 2023, 09:25:54 pm
The patch has been added to the 4.19.291, 5.4.253, 5.10.190, 5.15.126, 6.1.45, and 6.4.10 kernels, so future Linux distros and kernel upgrades should support USB networking again for the SL-A300, 5600, and C700 models.
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: Varti on August 10, 2023, 03:15:08 am
That's great to hear, thanks for your work! I hope I'll find time to test this with my devices.

Varti
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on August 10, 2023, 04:08:34 am
No worries! It was kind of fun to do. One thing I learnt was that you can use the A300's CE-UA1 USB adapter for the SL-5600 instead of the bulky cradle. Too bad the adapter doesn't work with the SL-6000, even though it plugs in OK.
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: greguu on August 15, 2023, 05:43:03 am
The patch has been added to the 4.19.291, 5.4.253, 5.10.190, 5.15.126, 6.1.45, and 6.4.10 kernels, so future Linux distros and kernel upgrades should support USB networking again for the SL-A300, 5600, and C700 models.

Thats great news. Good to see the kernel team still accepting patches for this platform!
Can you confirm if you build any 5.10 - 6.4.10 kernels for these models including your patch and / or any other patches ?
I have not looked into it for a while, but the last kernel building fine for Cxx00 series was 5.4 branch with some ugly patches.
I got a C700 now and would be keen to know if any of these kernels you mention build fine and what works and what not...
Title: Re: Connecting SL-6000 to PC running Linux Kernel 3/4/5
Post by: maynard on August 15, 2023, 07:24:30 pm
None of the developers seemed interested in writing another Zaurus patch for me, so I had to learn how to submit one myself. Thankfully though, even if it is an old bug, they will accept a patch.
I tested the patch on 5.4 (Linux Mint 20), but not on the later kernels. I was planning to try connecting the SL-A300/5600/C700 on Ubuntu 23.10 when it is released in October.