Patch "ncr5380: Fix NCR5380_select() EH checks and result handling" has been added to the 4.5-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
ncr5380: Fix NCR5380_select() EH checks and result handling
to the 4.5-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ncr5380-fix-ncr5380_select-eh-checks-and-result-handling.patch
and it can be found in the queue-4.5 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
ccf6efd78317ef6265829c81a3e1a19f628b1a2dMon Sep 17 00:00:00 2001
From: Finn Thain <[email protected]>
Date: Tue, 23 Feb 2016 10:07:08 +1100
Subject: ncr5380: Fix NCR5380_select() EH checks and result handling
From: Finn Thain <[email protected]>
commit ccf6efd78317ef6265829c81a3e1a19f628b1a2d upstream.
Add missing checks for EH abort during arbitration and selection. Rework the handling of NCR5380_select() result to improve clarity.
--- drivers/scsi/NCR5380.c | 16 +++++++++++----- drivers/scsi/atari_NCR5380.c | 16 +++++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-)
drivers/scsi/NCR5380.c +11 -5
@@ -815,15 +815,17 @@ static void NCR5380_main(struct work_strstruct NCR5380_hostdata *hostdata = container_of(work, struct NCR5380_hostdata, main_task);struct Scsi_Host *instance = hostdata->host; -struct scsi_cmnd *cmd;int done; do { done = 1; spin_lock_irq(&hostdata->lock); - while (!hostdata->connected && - (cmd = dequeue_next_cmd(instance))) { + while (!hostdata->connected && !hostdata->selecting) { + struct scsi_cmnd *cmd = dequeue_next_cmd(instance); + + if (!cmd) + break; dsprintk(NDEBUG_MAIN, instance, "main: dequeued %p\n", cmd);
@@ -840,8 +842,7 @@ static void NCR5380_main(struct work_str* entire unit. */ - cmd =NCR5380_select (instance, cmd); -if (!cmd) { +if (!NCR5380_select (instance, cmd)) {dsprintk (NDEBUG_MAIN , instance,"main: select complete\n" ); }else { dsprintk(NDEBUG_MAIN | NDEBUG_QUEUES, instance,
@@ -1056,6 +1057,11 @@ static struct scsi_cmnd *NCR5380_select(/* Reselection interrupt */ goto out; } +if (!hostdata->selecting) { +/* Command was aborted */ +NCR5380_write (MODE_REG ,MR_BASE ); + goto out; + }if (err <0 ) {NCR5380_write (MODE_REG ,MR_BASE ); shost_printk(KERN_ERR, instance,
drivers/scsi/atari_NCR5380.c +11 -5
@@ -923,7 +923,6 @@ static void NCR5380_main(struct work_strstruct NCR5380_hostdata *hostdata = container_of(work, struct NCR5380_hostdata, main_task);struct Scsi_Host *instance = hostdata->host; -struct scsi_cmnd *cmd;int done;/*
@@ -936,8 +935,11 @@ static void NCR5380_main(struct work_str done =1 ;spin_lock_irq (&hostdata->lock); -while (!hostdata->connected && - (cmd =dequeue_next_cmd (instance))) { +while (!hostdata->connected && !hostdata->selecting) { +struct scsi_cmnd *cmd =dequeue_next_cmd (instance); + +if (!cmd) +break ;dsprintk (NDEBUG_MAIN , instance,"main: dequeued %p\n" , cmd);
@@ -960,8 +962,7 @@ static void NCR5380_main(struct work_str#ifdef SUPPORT_TAGS cmd_get_tag (cmd, cmd->cmnd[0 ] !=REQUEST_SENSE );#endif - cmd =NCR5380_select (instance, cmd); -if (!cmd) { +if (!NCR5380_select (instance, cmd)) {dsprintk (NDEBUG_MAIN , instance,"main: select complete\n" );maybe_release_dma_irq (instance); }else {
@@ -1257,6 +1258,11 @@ static struct scsi_cmnd *NCR5380_select(/* Reselection interrupt */ goto out; } +if (!hostdata->selecting) { +/* Command was aborted */ +NCR5380_write (MODE_REG ,MR_BASE ); + goto out; + }if (err <0 ) {NCR5380_write (MODE_REG ,MR_BASE ); shost_printk(KERN_ERR, instance,
Patches currently in stable-queue which might be from [email protected] are
queue-4.5/ncr5380-correctly-clear-command-pointers-and-lists-after-bus-reset.patch queue-4.5/ncr5380-call-scsi_eh_prep_cmnd-and-scsi_eh_restore_cmnd-as-and-when-appropriate.patch queue-4.5/ncr5380-forget-aborted-commands.patch queue-4.5/ncr5380-dont-release-lock-for-pio-transfer.patch queue-4.5/ncr5380-dont-re-enter-ncr5380_select.patch queue-4.5/ncr5380-fix-ncr5380_select-eh-checks-and-result-handling.patch