rpi_patches icon indicating copy to clipboard operation
rpi_patches copied to clipboard

Using dm9601-bug.patch

Open javary opened this issue 10 years ago • 9 comments

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

javary avatar Dec 30 '14 15:12 javary

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 avatar Dec 31 '14 04:12 kmtaylor

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

kmtaylor avatar Dec 31 '14 04:12 kmtaylor

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!

javary avatar Jan 01 '15 18:01 javary

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

hosek avatar Jan 21 '16 08:01 hosek

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

Also have a look at https://github.com/raspberrypi/linux/issues/1045

MPParsley avatar Feb 20 '16 12:02 MPParsley

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?

PvdGulik avatar May 15 '21 17:05 PvdGulik

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 avatar May 17 '21 01:05 kmtaylor

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

kmtaylor avatar May 17 '21 01:05 kmtaylor

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!

PvdGulik avatar May 19 '21 11:05 PvdGulik