asymingt / rts5139

Fix for RTS5129 USB MMC card reader on Linux 3.16+ kernels
62 stars 18 forks source link

Changes for kernel versions >= 5.0.14 are now also required for 4.x branch #12

Open fonic opened 5 years ago

fonic commented 5 years ago

It seems the changes introduced in kernel 5.0.14 were recently backported to the 4.x branch. I encountered compiling problems after upgrading to kernel 4.19.52. With the changes implemented by #11, the driver compiles and works fine again.

I simple changed: #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 14)) to #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 14)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 52))

svfed commented 5 years ago

The same with 4.15.0 starting with 4.15.0-60.

aayushbhan commented 4 years ago

@svfed what did you change to make it work for 4.15.0-60 ?

svfed commented 4 years ago

Since the change of power usage count may go to any kernel version, I have chosen not to add version check as @fonic, but rather defined in rts51x.h: #define OLD_KERNEL_PM_CNT_UPDATED 1 and right after that #if ((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 14)) || OLD_KERNEL_PM_CNT_UPDATED) and the same in all source files that require it (5 places in rts51x.c, for example)

aayushbhan commented 4 years ago

Ok thanks. I'll check if it works for me.

vladki77 commented 4 years ago

I confirm that this change is needed for Debian stretch kernels too: Linux 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u1 (2019-09-20) x86_64 GNU/Linux

michael-xiii commented 4 years ago

It helps for Dell Inspiron 3180

Linux small-note 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Changes appear somewhere after the 4.15.0-58 but before 4.15.0-65,, hard to tell

Also - I don't see the freezes now, they were the headache on 4.15.0-58 https://github.com/asymingt/rts5139/issues/15

But need some time for being sure