Ubuntu14.04 and Debian 8.1, the Realtek Semiconductor Co., Ltd. RTS5209 driver

冥辰mc 2015-08-19 01:28:42
For a long time I get a SD Card driver problem in Ubuntu14.04, I want to solve it in recent days, although, it's not really a big problem.

I've RTFM for a while, but, it seems nothing change.

I wish get your help, if you can. I will certenly appreciate it.

Those are my tried records, just list below:



~$ lspci -v

......(omit output)

04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5209 PCI Express Card Reader (rev 01)
Subsystem: Acer Incorporated [ALI] Device 0696
Flags: bus master, fast devsel, latency 0, IRQ 50
Memory at f0101000 (32-bit, non-prefetchable) [size=4K]
Expansion ROM at f0000000 [disabled] [size=64K]
Capabilities: <access denied>
Kernel driver in use: rtsx_pci



I've downloaded source code from rtsx


~$ tar jvxf 0001-rts_pstor.tar.bz2
~/rts_pstor$ cd rts_pstor
~/rts_pstor$ less README.txt
General Information
===================

Linux driver for Realtek PCI-Express card reader chip.


Build Steps
===========

1) make
2) make install
3) depmod
4) reboot your computer

Note: Root privilege is required in step 2 and 3

~/rts_pstor$ sudo make
[sudo] password for bdg:
sed "s/RTSX_MK_TIME/`date +%y.%m.%d.%H.%M`/" timestamp.in > timestamp.h
cp -f ./define.release ./define.h
make -C /lib/modules/3.13.0-61-generic/build/ SUBDIRS= modules
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-61-generic'
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-61-generic'
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-61-generic'
make[2]: *** No rule to make target `/usr/src/linux-headers-3.13.0-61-generic/arch/x86/syscalls/syscall_32.tbl', needed by `arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h'. Stop.
make[1]: *** [archheaders] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-61-generic'
make: *** [default] Error 2

~/rts_pstor$ sudo su
~/rts_pstor# make
sed "s/RTSX_MK_TIME/`date +%y.%m.%d.%H.%M`/" timestamp.in > timestamp.h
cp -f ./define.release ./define.h
make -C /lib/modules/3.13.0-61-generic/build/ SUBDIRS=/home/bdg/Downloads/tmp/rts_pstor modules
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-61-generic'
CC [M] /home/bdg/Downloads/tmp/rts_pstor/rtsx.o
/home/bdg/Downloads/tmp/rts_pstor/rtsx.c:275:2: error: unknown field ‘proc_info’ specified in initializer
.proc_info = proc_info,
^
/home/bdg/Downloads/tmp/rts_pstor/rtsx.c:275:2: warning: initialization from incompatible pointer type [enabled by default]
/home/bdg/Downloads/tmp/rts_pstor/rtsx.c:275:2: warning: (near initialization for ‘rtsx_host_template.proc_dir’) [enabled by default]
/home/bdg/Downloads/tmp/rts_pstor/rtsx.c:916:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rtsx_probe’
static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
^
/home/bdg/Downloads/tmp/rts_pstor/rtsx.c:1080:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rtsx_remove’
static void __devexit rtsx_remove(struct pci_dev *pci)
^
/home/bdg/Downloads/tmp/rts_pstor/rtsx.c:1106:11: error: ‘rtsx_probe’ undeclared here (not in a function)
.probe = rtsx_probe,
^
/home/bdg/Downloads/tmp/rts_pstor/rtsx.c:1107:2: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]
.remove = __devexit_p(rtsx_remove),
^
/home/bdg/Downloads/tmp/rts_pstor/rtsx.c:1107:24: error: ‘rtsx_remove’ undeclared here (not in a function)
.remove = __devexit_p(rtsx_remove),
^
/home/bdg/Downloads/tmp/rts_pstor/rtsx.c:485:12: warning: ‘rtsx_control_thread’ defined but not used [-Wunused-function]
static int rtsx_control_thread(void * __dev)
^
/home/bdg/Downloads/tmp/rts_pstor/rtsx.c:596:12: warning: ‘rtsx_polling_thread’ defined but not used [-Wunused-function]
static int rtsx_polling_thread(void * __dev)
^
/home/bdg/Downloads/tmp/rts_pstor/rtsx.c:745:13: warning: ‘quiesce_and_remove_host’ defined but not used [-Wunused-function]
static void quiesce_and_remove_host(struct rtsx_dev *dev)
^
/home/bdg/Downloads/tmp/rts_pstor/rtsx.c:780:13: warning: ‘release_everything’ defined but not used [-Wunused-function]
static void release_everything(struct rtsx_dev *dev)
^
/home/bdg/Downloads/tmp/rts_pstor/rtsx.c:790:12: warning: ‘rtsx_scan_thread’ defined but not used [-Wunused-function]
static int rtsx_scan_thread(void * __dev)
^
/home/bdg/Downloads/tmp/rts_pstor/rtsx.c:816:13: warning: ‘rtsx_init_options’ defined but not used [-Wunused-function]
static void rtsx_init_options(struct rtsx_chip *chip)
^
cc1: some warnings being treated as errors
make[2]: *** [/home/bdg/Downloads/tmp/rts_pstor/rtsx.o] Error 1
make[1]: *** [_module_/home/bdg/Downloads/tmp/rts_pstor] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-61-generic'
make: *** [default] Error 2



I got this reference to modify rtsx.c : https://dainaccio.wordpress.com/2013/07/14/realtek-sd-reader-mounting-problems-under-linux-mintubuntu/

do those changes:

static void __devexit rtsx_remove(struct pci_dev *pci) => static void rtsx_remove(struct pci_dev *pci)

static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) => static int rtsx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)

.remove = __devexit_p(rtsx_remove), => .remove = rtsx_remove,

there was still a problem at line 275, I commented it. And yes compile passed.



~/rts_pstor# depmod
~/rts_pstor# reboot now


~$ lcpci -v

04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5209 PCI Express Card Reader (rev 01)
Subsystem: Acer Incorporated [ALI] Device 0696
Flags: bus master, fast devsel, latency 0, IRQ 50
Memory at f0101000 (32-bit, non-prefetchable) [size=4K]
Expansion ROM at f0000000 [disabled] [size=64K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Device Serial Number 00-00-00-01-00-4c-e0-00
Kernel driver in use: rtsx_pci



what show i DO?


~$ uname -a

Linux Bulbul 3.13.0-61-generic #100-Ubuntu SMP Wed Jul 29 11:21:34 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
...全文
314 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
冥辰mc 2015-09-14
  • 打赏
  • 举报
回复
It's done. I mean this post.
冥辰mc 2015-09-03
  • 打赏
  • 举报
回复
引用 2 楼 nswcfd 的回复:
现在的问题是什么?从lscpi的输出来看,不是找到驱动了吗? 还是说加载的驱动不是楼主刚编译的驱动?如果是,楼主链接里已经给出解决方法了,就是卸载旧驱动,再加载新驱动。 关于第275行的错误,应该是新内核的接口有变化,realtek官方没有跟进,这个就没有办法。 只能像楼主这样临时注释掉,但影响就不知道了。
编译安装完之后,系统不是告诉我跟以前完全一样么? 我参考的链接,他编译完之后出现编译成功的驱动了,我的并没有丫。也许是无法解决了。 还是谢谢
nswcfd 2015-08-19
  • 打赏
  • 举报
回复
现在的问题是什么?从lscpi的输出来看,不是找到驱动了吗? 还是说加载的驱动不是楼主刚编译的驱动?如果是,楼主链接里已经给出解决方法了,就是卸载旧驱动,再加载新驱动。 关于第275行的错误,应该是新内核的接口有变化,realtek官方没有跟进,这个就没有办法。 只能像楼主这样临时注释掉,但影响就不知道了。
冥辰mc 2015-08-19
  • 打赏
  • 举报
回复

~$ dmesg

bdg@Bulbul:~/Downloads/tmp/rts_pstor$ dmesg | grep -i 'error\|sd'
[    0.000000] ACPI: RSDP 00000000000fe020 000024 (v02 ACRSYS)
[    0.000000] ACPI: XSDT 00000000afbfe120 00008C (v01 ACRSYS ACRPRDCT 00000001      01000013)
[    0.000000] ACPI: DSDT 00000000afbe9000 00EB54 (v01 ACRSYS ACRPRDCT F0000000 1025 00040000)
[    0.000000] ACPI: SSDT 00000000afbe2000 000B9C (v01 ACRSYS ACRPRDCT 00000001 1025 00040000)
[    0.000000] ACPI: SSDT 00000000afbe0000 001ED4 (v02 ACRSYS ACRPRDCT 00000001 1025 00040000)
[    2.112764] acpi-cpufreq: overriding BIOS provided _PSD data
[    2.781057] ACPI Error: [SSZE] Namespace lookup failure, AE_ALREADY_EXISTS (20131115/dsfield-211)
[    2.781077] ACPI Error: Method parse/execution failed [\_SB_.ACAD._PSR] (Node ffff880223ed0b90), AE_ALREADY_EXISTS (20131115/psparse-536)
[    2.781107] ACPI Exception: AE_ALREADY_EXISTS, Error reading AC Adapter state (20131115/ac-130)
[    2.800695] ACPI: Marking method _PSR as Serialized because of AE_ALREADY_EXISTS error
[    3.256815] sd 0:0:0:0: [sda] 234441648 512-byte logical blocks: (120 GB/111 GiB)
[    3.256924] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    3.257028] sd 0:0:0:0: [sda] Write Protect is off
[    3.257039] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    3.257107] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    3.257908] sd 1:0:0:0: Attached scsi generic sg1 type 0
[    3.257913] sd 1:0:0:0: [sdb] 1465149168 512-byte logical blocks: (750 GB/698 GiB)
[    3.257922] sd 1:0:0:0: [sdb] 4096-byte physical blocks
[    3.258063] sd 1:0:0:0: [sdb] Write Protect is off
[    3.258073] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[    3.258086]  sda: sda1 sda2 sda3
[    3.258134] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    3.259048] sd 0:0:0:0: [sda] Attached SCSI disk
[    3.381727] usb 4-4: string descriptor 0 read error: -22
[    4.239385]  sdb: sdb1 sdb2 sdb3 < sdb5 sdb6 sdb7 sdb8 sdb9 > sdb4
[    4.241509] sd 1:0:0:0: [sdb] Attached SCSI disk
[    4.916127] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)
[    6.971072] Adding 4194236k swap on /dev/sdb6.  Priority:-1 extents:1 across:4194236k FS
[    7.274551] EXT4-fs (sda3): re-mounted. Opts: errors=remount-ro
[    8.006047] EXT4-fs (sdb5): mounted filesystem with ordered data mode. Opts: (null)
[    8.579624] type=1400 audit(1439955103.961:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/cupsd" pid=799 comm="apparmor_parser"
[    8.580303] type=1400 audit(1439955103.961:10): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=799 comm="apparmor_parser"
[    9.118317] usb 4-4: string descriptor 0 read error: -22
[ 1512.607002] type=1400 audit(1439956607.282:63): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=4019 comm="apparmor_parser"
[ 1512.607683] type=1400 audit(1439956607.282:64): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=4019 comm="apparmor_parser"
[ 4318.378763] usb 5-1: device not accepting address 2, error -71
[ 4334.734523] sd 2:0:0:0: Attached scsi generic sg2 type 0
[ 4334.735789] sd 2:0:0:0: [sdc] Spinning up disk...
[ 4336.981078] sd 2:0:0:0: [sdc] 1953525167 512-byte logical blocks: (1.00 TB/931 GiB)
[ 4336.981748] sd 2:0:0:0: [sdc] Write Protect is off
[ 4336.981758] sd 2:0:0:0: [sdc] Mode Sense: 2b 00 10 08
[ 4336.982531] sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA
[ 4337.015724]  sdc: sdc1 sdc2
[ 4337.017642] sd 2:0:0:0: [sdc] Attached SCSI disk
[ 4337.595894] EXT4-fs (sdc2): mounted filesystem with ordered data mode. Opts: (null)
[ 4538.487349] sd 2:0:0:0: [sdc] Synchronizing SCSI cache

1,318

社区成员

发帖
与我相关
我的任务
社区描述
主要是开发驱动技术
社区管理员
  • 驱动程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧