Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3983955ybi; Mon, 10 Jun 2019 22:10:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZEklc2ojTa3F81NPsMlCSRrxb2ML4IzDq9q/YfRE3NAL4Bc4PS7UrPqVkutY3ZurXJmFP X-Received: by 2002:a62:1456:: with SMTP id 83mr26817831pfu.228.1560229827036; Mon, 10 Jun 2019 22:10:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560229827; cv=none; d=google.com; s=arc-20160816; b=wCSvjwhx3A6T6k4Cu+dQgAYnDjrqk9sOArP7cd5mxnm7Urj27KcKvTrYZ28NkDs+XT AL34FtQn086VirHGNRwNx3vrRn3mlUcAm0nb0uN7hPz1swdm+dA5hLfZrQsr9JZIlLox g4E1jP0aqMcenOPPIE0C6cKbsZcCpb8bO9Aq6kQ88qsa125maXto+t1fQTDkfhU8zaCl /V3ziNRiMA4fSf1dJ6cZoP7LsCNdz+uOmPKh3jLZfB10ZhpsTL40evtwwRoZQrTjaRHW 8WmGNeOODGUewya9JLq0ujW4DQWr1OXTSOFea9IsTF5FamWq0W1P6kGxU9E0F8BFLuJx fQbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature; bh=wkWM1sR/IFbO5oMe7Lbr307SWhapRDl2FwvCP8Cm0DQ=; b=k7jtFsm7aJHNfM3U+l6I4jOpTY5fhr7WpFs8FjO6SLUxDC2x5R+Jz2t4kf23I4zda+ cUezWCsvr1egzb1DxX4CdLqjs/T7lR0gjLoDRE8vpM61peJIDvIGlWvT9/r79e0Kpopt e5zx1SnLvhzwObyHz9pyW+0XoBTLzQ+VbgiqhJegXSJgVoxGwmoOYWkR2k12+ZsRcXMf +gnVfBtz+MDA5GpYK40KJFAtR900ScvhTmqeIlGcl9Sp439GpJ6vwBrVEnY8QwkB1udd G1NohgNnblR0ER47pSP/1wTIvkzlxDo1rlqylEUYZtXN9V1Bxy+AUGyxTrPnMppR/sr2 y4aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H7KQ4YE1; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si3260433pgj.337.2019.06.10.22.10.03; Mon, 10 Jun 2019 22:10:27 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H7KQ4YE1; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391144AbfFKFHX (ORCPT + 99 others); Tue, 11 Jun 2019 01:07:23 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:46333 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390387AbfFKFHX (ORCPT ); Tue, 11 Jun 2019 01:07:23 -0400 Received: by mail-pf1-f196.google.com with SMTP id 81so6610238pfy.13; Mon, 10 Jun 2019 22:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=wkWM1sR/IFbO5oMe7Lbr307SWhapRDl2FwvCP8Cm0DQ=; b=H7KQ4YE1BdcqVmVdPo9Iv1b26xjwbPzBiKEs1JStOXdfVbwqIPfct7MN0R6bN7QT6m JA76QZ3UGggm0pmIB5/aBuD0PzfNpEEoagwkJURiuS1X6vnhKlpTmgdipsdq2aCPPrpu UfWFQEAfNIKLQ4YKexBGnhWagD8E0j0rs4F0JARjkzajr2VV35WarHi54MYU7x4rs9kg NWhlzlqjAP/zZmTTqr2yOFcaasCu9xTNRmUly9t8rTSvjPJQ00VtnGm29qqCtywALFsG 9tVUQC0Xm8KUikPMJA7Vw1WcfnQbzTez+s/l3nS8mBgkhGq2+t4t3ai1QTqNXppm3+n9 lhbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=wkWM1sR/IFbO5oMe7Lbr307SWhapRDl2FwvCP8Cm0DQ=; b=IfKN8CUUwIq+38/aoDqKIUbw7lq5p4+b36OdG53SFgeiCwXPc2QCXjkx+T82WhkMb+ 9ENYdr33HSXUTDDYCVenmwAEbRBXoHp9NQ/zpbCXHy+3rUooAycO2mmvVlaLxbjrC/dG 34WswqJk3Bv31sjbhr9+d2rGCpRR1LFIHcAcfLPitBnZ+4WIP8GD6zSWelqXuOausuJi TbgIQCNUTuePPEB09DyBGcIjIgLlbVqyGmsPeTboF9KWB1vg8Q7DDm9iX6/u/QhDvCeg UqXhawDfsVzvf4bz5q9VGho6o08kQS6auzqiE+XFRRgxKIO6LOhUwgtBLPIcnQblxoNU mpgg== X-Gm-Message-State: APjAAAW9RAeRR/LyCBfLOTqg9PVIx6dikF/w90M7K+nR00Wdrl9kyH1y HYtkPj7TkiZY55L1YJXI6FxAZeXI X-Received: by 2002:aa7:8502:: with SMTP id v2mr2666466pfn.98.1560229642113; Mon, 10 Jun 2019 22:07:22 -0700 (PDT) Received: from [192.168.1.101] (122-58-182-39-adsl.sparkbb.co.nz. [122.58.182.39]) by smtp.gmail.com with ESMTPSA id p27sm8751478pfq.136.2019.06.10.22.07.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 22:07:21 -0700 (PDT) Subject: Re: [PATCH v2 2/7] scsi: NCR5380: Always re-enable reselection interrupt To: Finn Thain , "James E.J. Bottomley" , "Martin K. Petersen" References: <61f0c0f6aaf8fa96bf3dade5475615b2cfbc8846.1560043151.git.fthain@telegraphics.com.au> Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org From: Michael Schmitz Message-ID: <58081aba-4e77-3c8e-847e-0698cf80e426@gmail.com> Date: Tue, 11 Jun 2019 17:07:16 +1200 User-Agent: Mozilla/5.0 (X11; Linux ppc; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <61f0c0f6aaf8fa96bf3dade5475615b2cfbc8846.1560043151.git.fthain@telegraphics.com.au> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > 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; >