From patchwork Thu Aug 10 16:09:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 109816 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp2559738obb; Thu, 10 Aug 2017 08:42:54 -0700 (PDT) X-Received: by 10.98.7.132 with SMTP id 4mr12860657pfh.216.1502379774882; Thu, 10 Aug 2017 08:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502379774; cv=none; d=google.com; s=arc-20160816; b=CT10JohK5tHgJVUImNb6G2FfYgScTp4wQvbj4AxDafy5A5mR8N4Py0nIp39niLJeh5 Gzvf2aoax3k0ik7unnXJ/z3vLXPnrThm/ZomDv5PmkpifHUTAoRJpEb0b0aPYIWoic5D l5r5rdv+y4Y/TNVcuD2LgM4YXFx0SLTuUiGGo8H2E2JpcAiDMtN3PS87RhcVTTB/ImJC PTGQwEjzX67GSr1+k+vRqZZod3KFvI6sipnLKJs1g7CYPtUzFo3twwcJ4oJqgfFRkhcP x3kYww0IVp8gBwn8qJhBL3l9Cexfs8/DU7Qd7Z15hSc95HHsl75TDfZqwX/yuDiANKAk Fz5w== 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:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=p0tQKGCx+xgeky4TzQouBiQXZ1YpFYNpkEhhaDmSkVU=; b=FB/PHaUVXBz84flHYByzq4PN8088WM08Wc485vLUDvWnwW845gM3J3V3hM1OszL7Od qzLaciMYyzVTrZtVGe7Ys+o7AvnXJ1cjvTzxwet9Xpqy0OUKhIgYLrsPXASkw+ao0UbN Eqgza6bJvtahtahkiIkrP+oUFvbYVLPaZcGe6sk799N9KHQsxRbQ7uOpSzrCHS/MBQub QfH/jIM06tg/GspMV62EwwA6Wwy0ITexiMkl0JUQ99yQlqQojiJLaGBTzSM4HiOE4DIv 2i4LoJk1UbytPkNSVK/4qsvRR0ZZ2iuapWCAaePc1jsm+9tDeTZ0ZQcCCaGFt2t/DYA+ ZqQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-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 f1si4304522pfg.494.2017.08.10.08.42.54; Thu, 10 Aug 2017 08:42:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-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-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752950AbdHJPmx (ORCPT + 1 other); Thu, 10 Aug 2017 11:42:53 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3047 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752389AbdHJPmu (ORCPT ); Thu, 10 Aug 2017 11:42:50 -0400 Received: from 172.30.72.59 (EHLO DGGEMS402-HUB.china.huawei.com) ([172.30.72.59]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DEY38522; Thu, 10 Aug 2017 23:42:47 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.301.0; Thu, 10 Aug 2017 23:42:36 +0800 From: John Garry To: , CC: , , , , Xiang Chen , John Garry Subject: [PATCH 02/19] scsi: hisi_sas: avoid potential v2 hw interrupt issue Date: Fri, 11 Aug 2017 00:09:27 +0800 Message-ID: <1502381384-219889-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1502381384-219889-1-git-send-email-john.garry@huawei.com> References: <1502381384-219889-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090203.598C7EF7.006F, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 7538ead483c0eed7bf9e1a34911bc010 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Xiang Chen When some interrupts happen together, we need to process every interrupt one-by-one, and should not return immediately when one interrupt process is finished being processed. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index a6be33c..8c504b4 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -2606,6 +2606,7 @@ static irqreturn_t int_phy_updown_v2_hw(int irq_no, void *p) struct hisi_hba *hisi_hba = p; u32 irq_msk; int phy_no = 0; + irqreturn_t res = IRQ_NONE; irq_msk = (hisi_sas_read32(hisi_hba, HGC_INVLD_DQE_INFO) >> HGC_INVLD_DQE_INFO_FB_CH0_OFF) & 0x1ff; @@ -2620,15 +2621,15 @@ static irqreturn_t int_phy_updown_v2_hw(int irq_no, void *p) case CHL_INT0_SL_PHY_ENABLE_MSK: /* phy up */ if (phy_up_v2_hw(phy_no, hisi_hba) == - IRQ_NONE) - return IRQ_NONE; + IRQ_HANDLED) + res = IRQ_HANDLED; break; case CHL_INT0_NOT_RDY_MSK: /* phy down */ if (phy_down_v2_hw(phy_no, hisi_hba) == - IRQ_NONE) - return IRQ_NONE; + IRQ_HANDLED) + res = IRQ_HANDLED; break; case (CHL_INT0_NOT_RDY_MSK | @@ -2638,13 +2639,13 @@ static irqreturn_t int_phy_updown_v2_hw(int irq_no, void *p) if (reg_value & BIT(phy_no)) { /* phy up */ if (phy_up_v2_hw(phy_no, hisi_hba) == - IRQ_NONE) - return IRQ_NONE; + IRQ_HANDLED) + res = IRQ_HANDLED; } else { /* phy down */ if (phy_down_v2_hw(phy_no, hisi_hba) == - IRQ_NONE) - return IRQ_NONE; + IRQ_HANDLED) + res = IRQ_HANDLED; } break; @@ -2657,7 +2658,7 @@ static irqreturn_t int_phy_updown_v2_hw(int irq_no, void *p) phy_no++; } - return IRQ_HANDLED; + return res; } static void phy_bcast_v2_hw(int phy_no, struct hisi_hba *hisi_hba)