Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4208828ybi; Tue, 11 Jun 2019 02:50:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSO21rUCGLaIFw+44lYF3Vmu5dMd9QPYWmnYIFOCCCDRywIocG5x2T0wHmrGFIAyBeMjBI X-Received: by 2002:a17:90a:374f:: with SMTP id u73mr1584546pjb.4.1560246600240; Tue, 11 Jun 2019 02:50:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560246600; cv=none; d=google.com; s=arc-20160816; b=xrPtftK2ETCz3/oPlBPd65exVouego3jE4/8yoqh28whajyChXwovT6Zvf32Bz+U7G ZqND5dBuHYPROH03h02hCJt64NJsn4N+qmY+SgA+18vB38vhtppvM+EwCkQ11k58D0/W QkFyQ2Lkdpvx+R1oIKZ+LTf612WZcbn6eUaRf8cUCnPP9KxwWWqNjcKjkFlABJGdAs9F auq9TR/UTJ1g+S5f6xvz6Cxo+VbFIkPpDWDMUdakyt4v33YtCkjs1fLQkO5SHvhQrK9Q Byq39OzG8XD7mq479ceTfM4zImmc+Yz4OuE7pUbLnMvXRjWGGf0UABGjDyxAm87saCRn IKZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date; bh=Ii3xG4EDeQuCjGZVhnP0IR+KzzeoNg5V3v4jTCLlwKg=; b=svFJ2/oa6Cm+fP3B1paZ8bcfmJ9qZDQCL+dIxfSvkmoi2FLssp0Wuz+YIa8g/sWzFI w6W6P2Eq5zsJ7eFbtmgGMxNby6Rn4XQzJH00vcfaXC3gC58Hmn90b5mzwgNgpcMl5xbj tF2Qx5xJGHv/p4Cmz+efQQBXBYDzR8qBopjm0v0JkJpUcT2xLk5apZuts4g74l1YFk4K KCK42NHYxwo3l7b2/R3SEhzTglK7Zch2s0dQ/HD59gEheLkpUoyyjg5wQi5JhQuxLjy0 EZ9YDqTsDUt9MFpLwTxJlKHFX2c46xjBV6xAp9evH9jsdVSohzeMMfEbb+0Arbvj1B8J M8vw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u17si4940979pfc.210.2019.06.11.02.49.44; Tue, 11 Jun 2019 02:50:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404507AbfFKJdi (ORCPT + 99 others); Tue, 11 Jun 2019 05:33:38 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:35740 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404137AbfFKJdh (ORCPT ); Tue, 11 Jun 2019 05:33:37 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id 8B17722915; Tue, 11 Jun 2019 05:33:33 -0400 (EDT) Date: Tue, 11 Jun 2019 19:33:38 +1000 (AEST) From: Finn Thain To: Michael Schmitz cc: "James E.J. Bottomley" , "Martin K. Petersen" , 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 In-Reply-To: <58081aba-4e77-3c8e-847e-0698cf80e426@gmail.com> Message-ID: References: <61f0c0f6aaf8fa96bf3dade5475615b2cfbc8846.1560043151.git.fthain@telegraphics.com.au> <58081aba-4e77-3c8e-847e-0698cf80e426@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 11 Jun 2019, Michael Schmitz wrote: > 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. > Unfortunately I can't confirm that this is the same patch as the one you tested as I no longer have that commit. But Stan did test a wide variety of targets and I'm confident that the reselection code path was covered. -- > 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 > > Cc: stable@vger.kernel.org # v4.9+ > > Fixes: 8b00c3d5d40d ("ncr5380: Implement new eh_abort_handler") > > Tested-by: Stan Johnson > > Signed-off-by: Finn Thain > > --- > > 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; > > >