Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4563584pja; Thu, 21 Nov 2019 21:56:58 -0800 (PST) X-Google-Smtp-Source: APXvYqxXp0+qXv0GlFLoldlSBv7p7228KP325opPwX6440iwPa11PTKRbpiVBuor5okRJ2vgpOZM X-Received: by 2002:a17:906:32d3:: with SMTP id k19mr19608538ejk.75.1574402218016; Thu, 21 Nov 2019 21:56:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574402218; cv=none; d=google.com; s=arc-20160816; b=we+C+lBAPcvvSEDMa6kia/yFbpD6Dl2M05gcFC9Y3mkGSVhd1M6n2j+qd33EA7EY7l M4vFM4dMg9rPk4dl+cSEGSG/S1tXdk9OGC2FiUkh5wxSQtbeEY55bbodQYteHIRFAPjz Ve89aUkuXR3e3Wo9OR3/Qd+7MSJkPCJW07vPZyPNPrT/V9JUdX6B1QVMOmFySMPspqB9 yAECw9Wr9+euZfIoMxcEMOCvm0OogxdlStQqBhOTSwIaVUhV5Lz6v3jNtSUMry51Ckcw 1wgvNesw6QmA3utpefs1UiguvXmQGtFbmuxLvIU8M14mWBTE4LO4eso7Xt19PFEOC+0h Y+pA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=t1Adm0O7oUefWCnqrAISqpS856gpAUuzn0zZY9GWN68=; b=sy0Hk0BGWhlDw1ytUnRheRifjgyaEacsGT/Z/nW3Wu14EdALECnw1De1YyHxpSt+fL cCIEtafZsOXuYkGGUktZVj1Os0iza1YggPZ+YhdTZf8tcAbqRB4Pg7m5EfbxCTAYWZuQ YcTlplVjEBvk9P06+mLN92DbPsXLGfROjvBwt/ZYaE4AH0pSE0VqTLBfE6QegqgDoXZA JIvNa7OpKFpxELWQM5fzvku3Q0Oqyg3HrBnfvFnj0zX3DtouvPvUP9CvENf1STwUsTlp FtVRJE/AlB3+JJcLtbGvJxDxdW92D3TzGfgI79eHyK5eGXiZKxXS+dv8etriZepVYolK O78w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cszmBtxU; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g17si3771473edq.176.2019.11.21.21.56.33; Thu, 21 Nov 2019 21:56:58 -0800 (PST) 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=@kernel.org header.s=default header.b=cszmBtxU; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727175AbfKVFyU (ORCPT + 99 others); Fri, 22 Nov 2019 00:54:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:59212 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727613AbfKVFxM (ORCPT ); Fri, 22 Nov 2019 00:53:12 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 80D5B2072D; Fri, 22 Nov 2019 05:53:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574401991; bh=Br6czqm7QHjAlEQVygEZv/kGKjVi2PDAWm0cepnf6qw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cszmBtxUWx8xZQv3TPhQ65jCFksBXTZAqi1FnhoyUNt45Abl1G/pa0RvsLJE8aiyB wNH1UfZuNBefdL9sRE7Dxh7ZtaWQoSsaNB5/Z2/y6HK+0OEKrtt7XIEojwU/vJ/LeV EFEZaiwSVjwRBA+TB+XuNE2ENDCXVRBIOH7JEwT4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Xiang Chen , John Garry , "Martin K . Petersen" , Sasha Levin , linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 209/219] scsi: hisi_sas: shutdown axi bus to avoid exception CQ returned Date: Fri, 22 Nov 2019 00:49:00 -0500 Message-Id: <20191122054911.1750-201-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122054911.1750-1-sashal@kernel.org> References: <20191122054911.1750-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiang Chen [ Upstream commit 5c31b0c677531c2b8b4e29b3cfb923df663f39b7 ] When injecting 2 bit ECC error, it will cause fatal AXI interrupts. Before the recovery of SAS controller reset, the internal of SAS controller is in error. If CQ interrupts return at the time, actually it is exception CQ interrupt, and it may cause resource release in disorder. To avoid the exception situation, shutdown AXI bus after fatal AXI interrupt. In SAS controller reset, it will restart AXI bus. For later version of v3 hw, hardware will shutdown AXI bus for this situation, so just fix current ver of v3 hw. Signed-off-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 3922b17e2ea39..675768ee648e7 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -1520,6 +1520,7 @@ static irqreturn_t fatal_axi_int_v3_hw(int irq_no, void *p) u32 irq_value, irq_msk; struct hisi_hba *hisi_hba = p; struct device *dev = hisi_hba->dev; + struct pci_dev *pdev = hisi_hba->pci_dev; int i; irq_msk = hisi_sas_read32(hisi_hba, ENT_INT_SRC_MSK3); @@ -1551,6 +1552,17 @@ static irqreturn_t fatal_axi_int_v3_hw(int irq_no, void *p) error->msg, irq_value); queue_work(hisi_hba->wq, &hisi_hba->rst_work); } + + if (pdev->revision < 0x21) { + u32 reg_val; + + reg_val = hisi_sas_read32(hisi_hba, + AXI_MASTER_CFG_BASE + + AM_CTRL_GLOBAL); + reg_val |= AM_CTRL_SHUTDOWN_REQ_MSK; + hisi_sas_write32(hisi_hba, AXI_MASTER_CFG_BASE + + AM_CTRL_GLOBAL, reg_val); + } } if (irq_value & BIT(ENT_INT_SRC3_ITC_INT_OFF)) { -- 2.20.1