Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using dm9601-bug.patch #1

Open
javary opened this issue Dec 30, 2014 · 9 comments
Open

Using dm9601-bug.patch #1

javary opened this issue Dec 30, 2014 · 9 comments

Comments

@javary
Copy link

javary commented Dec 30, 2014

Hi,

I am an experienced developer, but a complete newbie when it comes to drivers, kernel modules and so on. I have recently bought a DM9601 USB-to-ethernet adapter (you know, these extra cheap but extra crappy adapters). And of course, I get frequent kernel panics with it. I'd like to try your fix, but I have no clue on how to use it...
I guess I should build a driver with your change included somewhere in /somewhere/drivers/net/usb/usbnet.c. But could you please provide a hint on how to do so? Which source exactly should I download to apply this fix? Should I compile a whole new kernel? Or compile just a few drivers? And how to enable them afterwards?
(note: I am using Raspbian (Debian for ARM on a Raspberry Pi))

Thank you very much for providing this patch, and thanks in advance for the extra help you could give me :)

@kmtaylor
Copy link
Owner

Hi Javary,

The patch applies to the linux kernel source from:
https://github.com/raspberrypi/linux.git

The process will be something like the following:
You can either compile the module on a host machine (much faster but you'll need to set up a cross compiling toolchain), or you can just compile on the rpi (the quickest option for a one off task like this)

If you are compiling on the rpi, skip step 6.
Also, the module is more likely to work properly if you install the same kernel sources that your rpi is currently running. If you are using raspbian, you should be able to get the kernel sources by doing something like:
apt-get install linux-source

This should put the correct source tarball in /usr/src. You would then skip step 1.

  1. Clone: git clone https://github.com/raspberrypi/linux.git
  2. Patch: patch -p1 < dm9601-bug.patch
  3. Get your Raspberry Pi config file: zcat /proc/config.gz > current_config
  4. Copy current_config to linux_source_dir/.config
  5. Confirm that your configuration is correct: make menuconfig
  6. Tell linux that you are cross compiling (if necessary): export CROSS_COMPILE=armv6j-hardfloat-linux-gnueabi-
  7. Make the usbnet module: make M=drivers/net/usb
  8. Copy the module to your pi and load it with: insmod ./usbnet.ko

Let me know how you go. Also depending on your version I could just send you my usbnet.ko binary and it might just work.

@kmtaylor
Copy link
Owner

If you're successful, perhaps you could write a readme so that others can easily apply the patch.

@javary
Copy link
Author

javary commented Jan 1, 2015

Thanks a lot for this extra help! I'll definitely try what you are suggesting.
However, this is not currently my top priority, so I am afraid I'll need a moment before I can take time to do so, but I definitely will. And providing a readme sounds good too, I'll be happy to do so if I succeed :)
Thanks for your work anyway!

@hosek
Copy link

hosek commented Jan 21, 2016

Hi, I tried it yesterday on Raspbery Zero and latest Raspbian, some hints for others:
For step 3 - if config file is not found, try sudo modprobe configs
For step 5 - in prior to make menuconfig, run apt-get install libncurses5-dev libncursesw5-dev
For step 7 - if recordmcount is not found try make scripts

I also get the wget https://raw.githubusercontent.com/raspberrypi/firmware/master/extra/Module.symvers to avoid "WARNING: Symbol version dump Module.symvers is missing; modules will have no dependencies and modversions."

Found:
http://jumpstation.co.uk/flog/Jan2015.html#p190120151932

@MPParsley
Copy link

According to that previous blogpost, the make process takes about 11hrs.
Could someone provide the patched usbnet.ko binary?

Also have a look at raspberrypi/linux#1045

@PvdGulik
Copy link

I’m trying to follow your manual, but after the command „patch -p1 < ../rpi_patches/dm9601-bug.patch", I get the following error. Don't know what to do..

patching file drivers/net/usb/usbnet.c
Hunk #1 FAILED at 473.
1 out of 1 hunk FAILED — saving rejects to file drivers/net/usb/usbnet.c.rej

Can you please help?

@kmtaylor
Copy link
Owner

Hi PvdGulik - This patch is now 7 years old, so it's quite likely it doesn't apply cleanly anymore. Are you sure it's still needed? (I haven't tested this configuration for a long time now) I would expect that this bug was fixed upstream.

@kmtaylor
Copy link
Owner

In fact - yes it does look like this has been properly fixed upstream:
raspberrypi/linux#1045
There should be no reason to use this patch anymore.

@PvdGulik
Copy link

Hello kmtaylor, thanks for your response.

I have two of those DM9601 USB-network hub. Both looses the connection after a few minutes. I really don't know why. Thats why I thought this would be the solution. Bu most likely it is not the problem.
So where to go now.

Can you help me to find out where the problem is?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants