Problemas do leitor de cartão Realtek RTS5227

3

Estou no Ubuntu 15.10 e ele não detecta as inserções do meu cartão SD. Eu tentei várias soluções que parecem ser a resposta comum para um problema como este, mas sem sucesso.

Eu vi esta discussão que indicou que há um driver da Realtek para um dispositivo semelhante, e que alguns hacks menores geralmente resolvem o problema para o meu dispositivo específico.

Depois de seguir essas etapas e executar make , recebo os seguintes erros:

cp -f ./define.release ./define.h
make -C /lib/modules/4.2.0-34-generic/build/ SUBDIRS=/home/anti/Software/rts5227 modules
make[1]: Entering directory '/usr/src/linux-headers-4.2.0-34-generic'
  CC [M]  /home/anti/Software/rts5227/rtsx.o
/home/anti/Software/rts5227/rtsx.c: In function ‘proc_info’:
/home/anti/Software/rts5227/rtsx.c:148:55: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time]
  SPRINTF("        Build: %s, %s\n", __DATE__, __TIME__);
                                                       ^
/home/anti/Software/rts5227/rtsx.c:148:55: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time]
In file included from include/linux/printk.h:6:0,
                 from include/linux/kernel.h:13,
                 from include/linux/sched.h:17,
                 from include/linux/blkdev.h:4,
                 from /home/anti/Software/rts5227/rtsx.c:23:
/home/anti/Software/rts5227/rtsx.c: In function ‘rtsx_control_thread’:
include/linux/kern_levels.h:4:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘u64 {aka long long unsigned int}’ [-Wformat=]
 #define KERN_SOH "
02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5227 PCI Express Card Reader (rev 01)
1" /* ASCII Start Of Header */ ^ include/linux/kern_levels.h:10:18: note: in expansion of macro ‘KERN_SOH’ #define KERN_ERR KERN_SOH "3" /* error conditions */ ^ /home/anti/Software/rts5227/rtsx.c:521:11: note: in expansion of macro ‘KERN_ERR’ printk(KERN_ERR "Bad target number (%d:%d)\n", ^ include/linux/kern_levels.h:4:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘u64 {aka long long unsigned int}’ [-Wformat=] #define KERN_SOH "
cp -f ./define.release ./define.h
make -C /lib/modules/4.2.0-34-generic/build/ SUBDIRS=/home/anti/Software/rts5227 modules
make[1]: Entering directory '/usr/src/linux-headers-4.2.0-34-generic'
  CC [M]  /home/anti/Software/rts5227/rtsx.o
/home/anti/Software/rts5227/rtsx.c: In function ‘proc_info’:
/home/anti/Software/rts5227/rtsx.c:148:55: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time]
  SPRINTF("        Build: %s, %s\n", __DATE__, __TIME__);
                                                       ^
/home/anti/Software/rts5227/rtsx.c:148:55: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time]
In file included from include/linux/printk.h:6:0,
                 from include/linux/kernel.h:13,
                 from include/linux/sched.h:17,
                 from include/linux/blkdev.h:4,
                 from /home/anti/Software/rts5227/rtsx.c:23:
/home/anti/Software/rts5227/rtsx.c: In function ‘rtsx_control_thread’:
include/linux/kern_levels.h:4:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘u64 {aka long long unsigned int}’ [-Wformat=]
 #define KERN_SOH "
02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5227 PCI Express Card Reader (rev 01)
1" /* ASCII Start Of Header */ ^ include/linux/kern_levels.h:10:18: note: in expansion of macro ‘KERN_SOH’ #define KERN_ERR KERN_SOH "3" /* error conditions */ ^ /home/anti/Software/rts5227/rtsx.c:521:11: note: in expansion of macro ‘KERN_ERR’ printk(KERN_ERR "Bad target number (%d:%d)\n", ^ include/linux/kern_levels.h:4:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘u64 {aka long long unsigned int}’ [-Wformat=] #define KERN_SOH "%pre%1" /* ASCII Start Of Header */ ^ include/linux/kern_levels.h:10:18: note: in expansion of macro ‘KERN_SOH’ #define KERN_ERR KERN_SOH "3" /* error conditions */ ^ /home/anti/Software/rts5227/rtsx.c:527:11: note: in expansion of macro ‘KERN_ERR’ printk(KERN_ERR "Bad LUN (%d:%d)\n", ^ /home/anti/Software/rts5227/rtsx.c: In function ‘rtsx_probe’: /home/anti/Software/rts5227/rtsx.c:921:39: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time] printk(KERN_INFO "--- %s, %s ---\n", __DATE__, __TIME__); ^ /home/anti/Software/rts5227/rtsx.c:921:49: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time] printk(KERN_INFO "--- %s, %s ---\n", __DATE__, __TIME__); ^ /home/anti/Software/rts5227/rtsx.c: At top level: /home/anti/Software/rts5227/rtsx.c:132:12: warning: ‘proc_info’ defined but not used [-Wunused-function] static int proc_info (struct Scsi_Host *host, char *buffer, ^ cc1: some warnings being treated as errors scripts/Makefile.build:258: recipe for target '/home/anti/Software/rts5227/rtsx.o' failed make[2]: *** [/home/anti/Software/rts5227/rtsx.o] Error 1 Makefile:1398: recipe for target '_module_/home/anti/Software/rts5227' failed make[1]: *** [_module_/home/anti/Software/rts5227] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-4.2.0-34-generic' Makefile:35: recipe for target 'default' failed make: *** [default] Error 2
1" /* ASCII Start Of Header */ ^ include/linux/kern_levels.h:10:18: note: in expansion of macro ‘KERN_SOH’ #define KERN_ERR KERN_SOH "3" /* error conditions */ ^ /home/anti/Software/rts5227/rtsx.c:527:11: note: in expansion of macro ‘KERN_ERR’ printk(KERN_ERR "Bad LUN (%d:%d)\n", ^ /home/anti/Software/rts5227/rtsx.c: In function ‘rtsx_probe’: /home/anti/Software/rts5227/rtsx.c:921:39: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time] printk(KERN_INFO "--- %s, %s ---\n", __DATE__, __TIME__); ^ /home/anti/Software/rts5227/rtsx.c:921:49: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time] printk(KERN_INFO "--- %s, %s ---\n", __DATE__, __TIME__); ^ /home/anti/Software/rts5227/rtsx.c: At top level: /home/anti/Software/rts5227/rtsx.c:132:12: warning: ‘proc_info’ defined but not used [-Wunused-function] static int proc_info (struct Scsi_Host *host, char *buffer, ^ cc1: some warnings being treated as errors scripts/Makefile.build:258: recipe for target '/home/anti/Software/rts5227/rtsx.o' failed make[2]: *** [/home/anti/Software/rts5227/rtsx.o] Error 1 Makefile:1398: recipe for target '_module_/home/anti/Software/rts5227' failed make[1]: *** [_module_/home/anti/Software/rts5227] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-4.2.0-34-generic' Makefile:35: recipe for target 'default' failed make: *** [default] Error 2

Existe alguma maneira de resolver isso e usar esse driver para usar meu leitor?

Minha versão do kernel é 4.2.0-34-generic .

Esta é a saída para lspci -v | grep Reader

%pre%

Eu fornecerei qualquer outra saída que possa ser necessária para resolver a questão.

Obrigado antecipadamente!

    
por Lei 01.04.2016 / 20:50

1 resposta

2

Ok, eu percebi.

A coisa que causa problemas é a declaração implícita da função vmalloc() nos vários arquivos da fonte do driver.

Eu adicionei #include <linux/vmalloc.h> aos arquivos relevantes, que são rtsx.c , rtsx_chip.c , rtsx_scsi.c e ms.c .

Ainda tenho muitos avisos e notas ao executar o make, mas consegui compilar e instalar o driver, e os cartões SD funcionam agora!

    
por Lei 01.04.2016 / 21:49