You are not logged in.

#1 2022-01-22 11:10:25

whypattern
Member
Registered: 2022-01-22
Posts: 1

rts5227-dkms driver fails to build module on 5.16 kernel

Hello! Since the first upgrade to the kernel 5.16 I'm getting this error when building the module for the driver rts5227-dkms:

Deprecated feature: REMAKE_INITRD

Building module:
cleaning build area...
make -j4 KERNELRELEASE=5.16.2-arch1-1 -C /usr/lib/modules/5.16.2-arch1-1/build M=/var/lib/dkms/rts5227/1.07/build....(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.16.2-arch1-1 (x86_64)
Consult /var/lib/dkms/rts5227/1.07/build/make.log for more information.

Here is the make.log https://pastebin.com/NzwpVv6k

I am currently using the lts kernel and the module is building just fine.

Offline

#2 2022-01-22 21:20:57

loqs
Member
Registered: 2014-03-06
Posts: 18,014

Re: rts5227-dkms driver fails to build module on 5.16 kernel

Please contact upstream https://github.com/Zibri/Realtek-rts5229-linux-driver.  The change in the kernel ishttps://github.com/torvalds/linux/commit/af049dfd0b105bab32170d1c68826a4cd8424efd

The following allows allows the module to build.  Do backup your data before testing it.

diff --git a/rtsx.c b/rtsx.c
index 8afb22c..a1817c9 100644
--- a/rtsx.c
+++ b/rtsx.c
@@ -129,9 +129,15 @@ static int slave_configure(struct scsi_device *sdev)
 #define SPRINTF(args...) \
 	do { if (pos < buffer+length) pos += sprintf(pos, ## args); } while (0)
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
 static int queuecommand_lck(struct scsi_cmnd *srb,
 			void (*done)(struct scsi_cmnd *))
 {
+#else
+static int queuecommand_lck(struct scsi_cmnd *srb)
+{
+	void (*done)(struct scsi_cmnd *) = scsi_done;
+#endif
 	struct rtsx_dev *dev = host_to_rtsx(srb->device->host);
 	struct rtsx_chip *chip = dev->chip;
 
@@ -150,8 +156,9 @@ static int queuecommand_lck(struct scsi_cmnd *srb,
 		return 0;
 	}
 
-	
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
 	srb->scsi_done = done;
+#endif
 	chip->srb = srb;
 	complete(&dev->cmnd_ready);
 
@@ -513,7 +520,11 @@ static int rtsx_control_thread(void * __dev)
 
 		
 		else if (chip->srb->result != DID_ABORT << 16) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
 			chip->srb->scsi_done(chip->srb);
+#else
+			scsi_done(chip->srb);
+#endif
 		} else {
 SkipForAbort:
 			printk(KERN_ERR "scsi command aborted\n");
@@ -730,7 +741,11 @@ static void quiesce_and_remove_host(struct rtsx_dev *dev)
 	if (chip->srb) {
 		chip->srb->result = DID_NO_CONNECT << 16;
 		scsi_lock(host);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
 		chip->srb->scsi_done(dev->chip->srb);
+#else
+		scsi_done(dev->chip->srb);
+#endif
 		chip->srb = NULL;
 		scsi_unlock(host);
 	}

Offline

Board footer

Powered by FluxBB