From 48eceda39b2065a5ec5bf40812752fb850ef4c77 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 15 Jun 2019 14:11:27 +0000 Subject: [PATCH 1/3] nightly build: Update kernel versions git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8424 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- nightly/conf/nightly.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index 6c628c5cd..8b4114f3b 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -3,15 +3,15 @@ ABT_DETAILS="x86_64" ABT_JOBS=5 ABT_KERNELS=" \ -5.1.9 \ +5.1.10 \ 5.0.20-nc \ 4.20.17-nc \ -4.19.50-nc \ +4.19.51-nc \ 4.18.20-nc \ 4.17.19-nc \ 4.16.18-nc \ 4.15.18-nc \ -4.14.125-nc \ +4.14.126-nc \ 4.13.16-nc \ 4.12.14-nc \ 4.11.12-nc \ From 126cc447db3c26bde53c52b620f9da98f8766f42 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 16 Jun 2019 20:53:37 +0000 Subject: [PATCH 2/3] scst: Introduce scst_reset_scsi_target() and scst_reset_scsi_device() This patch does not change any functionality. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8425 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_targ.c | 48 ++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index d03063ebe..0a6f91b95 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -6771,6 +6771,30 @@ out: return res; } +static int scst_reset_scsi_target(struct scsi_device *sdev) +{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) + int arg = SG_SCSI_RESET_TARGET; + + return scsi_ioctl_reset(sdev, (__force __user int *)&arg); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) + return scsi_reset_provider(sdev, SCSI_TRY_RESET_TARGET); +#else + return scsi_reset_provider(sdev, SCSI_TRY_RESET_BUS); +#endif +} + +static int scst_reset_scsi_device(struct scsi_device *sdev) +{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) + int arg = SG_SCSI_RESET_DEVICE; + + return scsi_ioctl_reset(sdev, (__force __user int *)&arg); +#else + return scsi_reset_provider(sdev, SCSI_TRY_RESET_DEVICE); +#endif +} + /* Returns 0 if the command processing should be continued, <0 otherwise */ static int scst_target_reset(struct scst_mgmt_cmd *mcmd) { @@ -6837,18 +6861,7 @@ static int scst_target_reset(struct scst_mgmt_cmd *mcmd) /* dev->scsi_dev must be non-NULL here */ TRACE(TRACE_MGMT, "Resetting host %d bus ", dev->scsi_dev->host->host_no); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) - { - int arg = SG_SCSI_RESET_TARGET; - - rc = scsi_ioctl_reset(dev->scsi_dev, - (__force __user int *)&arg); - } -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) - rc = scsi_reset_provider(dev->scsi_dev, SCSI_TRY_RESET_TARGET); -#else - rc = scsi_reset_provider(dev->scsi_dev, SCSI_TRY_RESET_BUS); -#endif + rc = scst_reset_scsi_target(dev->scsi_dev); TRACE(TRACE_MGMT, "Result of host %d target reset: %s", dev->scsi_dev->host->host_no, (rc == SUCCESS) ? "SUCCESS" : "FAILED"); @@ -6908,16 +6921,7 @@ static int scst_lun_reset(struct scst_mgmt_cmd *mcmd) if (dev->scsi_dev != NULL) { TRACE(TRACE_MGMT, "Resetting host %d bus ", dev->scsi_dev->host->host_no); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) - { - int arg = SG_SCSI_RESET_DEVICE; - - rc = scsi_ioctl_reset(dev->scsi_dev, - (__force __user int *)&arg); - } -#else - rc = scsi_reset_provider(dev->scsi_dev, SCSI_TRY_RESET_DEVICE); -#endif + rc = scst_reset_scsi_device(dev->scsi_dev); TRACE(TRACE_MGMT, "scsi_reset_provider(%s) returned %d", dev->virt_name, rc); #if 0 From 86fad676e9b54a2c04a64185e42adbbc97b68a4a Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 16 Jun 2019 21:07:17 +0000 Subject: [PATCH 3/3] scst: Fix build against Linux kernel v5.2 Reported-by: Sebastian Herbszt git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8426 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_targ.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 0a6f91b95..7f1d830c8 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -6773,7 +6773,11 @@ out: static int scst_reset_scsi_target(struct scsi_device *sdev) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0) + /* To do: implement this functionality. */ + WARN_ON_ONCE(true); + return FAILED; +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) int arg = SG_SCSI_RESET_TARGET; return scsi_ioctl_reset(sdev, (__force __user int *)&arg); @@ -6786,7 +6790,11 @@ static int scst_reset_scsi_target(struct scsi_device *sdev) static int scst_reset_scsi_device(struct scsi_device *sdev) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0) + /* To do: implement this functionality. */ + WARN_ON_ONCE(true); + return FAILED; +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) int arg = SG_SCSI_RESET_DEVICE; return scsi_ioctl_reset(sdev, (__force __user int *)&arg);