public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Schmitz <schmitzmic@gmail.com>
To: Finn Thain <fthain@telegraphics.com.au>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v2 2/7] scsi: NCR5380: Always re-enable reselection interrupt
Date: Tue, 11 Jun 2019 17:07:16 +1200	[thread overview]
Message-ID: <58081aba-4e77-3c8e-847e-0698cf80e426@gmail.com> (raw)
In-Reply-To: <61f0c0f6aaf8fa96bf3dade5475615b2cfbc8846.1560043151.git.fthain@telegraphics.com.au>

Hi Finn,

IIRC I'd tested that change as well - didn't change broken target 
behaviour but no regressions in other respects. Add my tested-by if needed.

Cheers,

	Michael


Am 09.06.2019 um 13:19 schrieb Finn Thain:
> The reselection interrupt gets disabled during selection and must be
> re-enabled when hostdata->connected becomes NULL. If it isn't re-enabled
> a disconnected command may time-out or the target may wedge the bus while
> trying to reselect the host. This can happen after a command is aborted.
>
> Fix this by enabling the reselection interrupt in NCR5380_main() after
> calls to NCR5380_select() and NCR5380_information_transfer() return.
>
> Cc: Michael Schmitz <schmitzmic@gmail.com>
> Cc: stable@vger.kernel.org # v4.9+
> Fixes: 8b00c3d5d40d ("ncr5380: Implement new eh_abort_handler")
> Tested-by: Stan Johnson <userm57@yahoo.com>
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
> ---
>  drivers/scsi/NCR5380.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
> index fe0535affc14..08e3ea8159b3 100644
> --- a/drivers/scsi/NCR5380.c
> +++ b/drivers/scsi/NCR5380.c
> @@ -709,6 +709,8 @@ static void NCR5380_main(struct work_struct *work)
>  			NCR5380_information_transfer(instance);
>  			done = 0;
>  		}
> +		if (!hostdata->connected)
> +			NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
>  		spin_unlock_irq(&hostdata->lock);
>  		if (!done)
>  			cond_resched();
> @@ -1110,8 +1112,6 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
>  		spin_lock_irq(&hostdata->lock);
>  		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
>  		NCR5380_reselect(instance);
> -		if (!hostdata->connected)
> -			NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
>  		shost_printk(KERN_ERR, instance, "reselection after won arbitration?\n");
>  		goto out;
>  	}
> @@ -1119,7 +1119,6 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
>  	if (err < 0) {
>  		spin_lock_irq(&hostdata->lock);
>  		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
> -		NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
>
>  		/* Can't touch cmd if it has been reclaimed by the scsi ML */
>  		if (!hostdata->selecting)
> @@ -1157,7 +1156,6 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
>  	if (err < 0) {
>  		shost_printk(KERN_ERR, instance, "select: REQ timeout\n");
>  		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
> -		NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
>  		goto out;
>  	}
>  	if (!hostdata->selecting) {
> @@ -1826,9 +1824,6 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
>  					 */
>  					NCR5380_write(TARGET_COMMAND_REG, 0);
>
> -					/* Enable reselect interrupts */
> -					NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
> -
>  					maybe_release_dma_irq(instance);
>  					return;
>  				case MESSAGE_REJECT:
> @@ -1860,8 +1855,6 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
>  					 */
>  					NCR5380_write(TARGET_COMMAND_REG, 0);
>
> -					/* Enable reselect interrupts */
> -					NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
>  #ifdef SUN3_SCSI_VME
>  					dregs->csr |= CSR_DMA_ENABLE;
>  #endif
> @@ -1964,7 +1957,6 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
>  					cmd->result = DID_ERROR << 16;
>  					complete_cmd(instance, cmd);
>  					maybe_release_dma_irq(instance);
> -					NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
>  					return;
>  				}
>  				msgout = NOP;
>

  reply	other threads:[~2019-06-11  5:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-09  1:19 [PATCH v2 0/7] NCR5380 drivers: fixes and other improvements Finn Thain
2019-06-09  1:19 ` [PATCH v2 1/7] Revert "scsi: ncr5380: Increase register polling limit" Finn Thain
2019-06-09  1:19 ` [PATCH v2 6/7] scsi: mac_scsi: Enable PDMA on Mac IIfx Finn Thain
2019-06-09  1:19 ` [PATCH v2 4/7] scsi: mac_scsi: Increase PIO/PDMA transfer length threshold Finn Thain
2019-06-09  1:19 ` [PATCH v2 2/7] scsi: NCR5380: Always re-enable reselection interrupt Finn Thain
2019-06-11  5:07   ` Michael Schmitz [this message]
2019-06-11  9:33     ` Finn Thain
2019-06-11 23:46       ` Michael Schmitz
2019-06-19  0:47         ` Martin K. Petersen
2019-06-19  1:47           ` Michael Schmitz
2019-06-09  1:19 ` [PATCH v2 3/7] scsi: NCR5380: Handle PDMA failure reliably Finn Thain
2019-06-09  1:19 ` [PATCH v2 7/7] scsi: mac_scsi: Treat Last Byte Sent time-out as failure Finn Thain
2019-06-09  1:19 ` [PATCH v2 5/7] scsi: mac_scsi: Fix pseudo DMA implementation, take 2 Finn Thain
2019-06-19  2:40 ` [PATCH v2 0/7] NCR5380 drivers: fixes and other improvements Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58081aba-4e77-3c8e-847e-0698cf80e426@gmail.com \
    --to=schmitzmic@gmail.com \
    --cc=fthain@telegraphics.com.au \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox