From patchwork Thu May 31 12:50:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 137384 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp6563453lji; Thu, 31 May 2018 05:54:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ9La2edVvlis6zZ99rZpU2zf0XYmsZ0HPb28KKvEa2WBv/oekTOSHTpU+IbpAJ34S0/2f8 X-Received: by 2002:a65:65c8:: with SMTP id y8-v6mr5510823pgv.320.1527771253170; Thu, 31 May 2018 05:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527771253; cv=none; d=google.com; s=arc-20160816; b=W5cM0uV5KqUxlkX0aJxnCbOTTii/iL2Y/MVZzJ0aXqVoY9ycrcJ6k+FITpynAf+gzN ZInT/S8Pwe0VvdL/TavlPST/BEOFdnIDB2aIxuHkBsSy07RmSrCRaXCm4fqJac3apzZH frYFq8b/tDzjfiT0WkF5LNY86OlDw1ywoVKsdDGF0nLeUYLBIYk3f4zPViUhd/woILcd oS+1o/KNXra40uGhN0hYWnFApEnUZ3ktp7fym9MDSejdicUBLej37qAita6RIzPMkHbW ku/xcg/reqQvZQwAzrwJRD1vXsAXpmUkZGg2qAEoO8C3Se19cmHyQPM5B9aEh6hbND8c s5IA== 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=euqTva8NR/TLhpx7x8QlQ0uKLcNI4wv5Vqy04cEe4RI=; b=wuZ4awDTwM1vX53Pce0Ols8i/uIR9ae6x7QIJxHCUxNBco33UBa4PZZeS2Is29xL2X 5dBlViPw4kPUUSK9o/v0E8tWMT6XML2qVwHuJbIqSFiuhHpaOOYaLlJrtaqog2RptGhQ 8txRcK2e6BuL737CjShYVhNx1vE1D+oEmHqid5X+RJxcbltHdh8Em6fktevhACcB1RZM yYa79g59vg9/MKzUbWWmXrHApRLQLVOD1vCXDZJufV1NP6IeU9ZcGyqz2sJEoDoJ4t4B FxcftDA4qaw1U4bjsKeioIBMLUsyJttr0rD693VvL3/XegBrJ0yiRgkuDLOM8FaLQjm3 C3FA== 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 b60-v6si37427586plc.270.2018.05.31.05.54.12; Thu, 31 May 2018 05:54:13 -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 S1755287AbeEaMyK (ORCPT + 30 others); Thu, 31 May 2018 08:54:10 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:38663 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1755050AbeEaMwW (ORCPT ); Thu, 31 May 2018 08:52:22 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 9A90154E10C2D; Thu, 31 May 2018 20:52:15 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.382.0; Thu, 31 May 2018 20:52:10 +0800 From: John Garry To: , CC: , , , Xiaofei Tan , "John Garry" Subject: [PATCH 2/9] scsi: hisi_sas: Only process broadcast change in phy_bcast_v3_hw() Date: Thu, 31 May 2018 20:50:43 +0800 Message-ID: <1527771050-200916-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1527771050-200916-1-git-send-email-john.garry@huawei.com> References: <1527771050-200916-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiaofei Tan There are many BROADCAST primitives generated by the host. We are only interested in BROADCAST (CHANGE) primitives currently, so only process this. We have applied this processing for v2 hw before, and it is also needed for v3 hw. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 9f1e2d0..0a126a82 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -131,6 +131,9 @@ #define SL_CONTROL_NOTIFY_EN_MSK (0x1 << SL_CONTROL_NOTIFY_EN_OFF) #define SL_CTA_OFF 17 #define SL_CTA_MSK (0x1 << SL_CTA_OFF) +#define RX_PRIMS_STATUS (PORT_BASE + 0x98) +#define RX_BCAST_CHG_OFF 1 +#define RX_BCAST_CHG_MSK (0x1 << RX_BCAST_CHG_OFF) #define TX_ID_DWORD0 (PORT_BASE + 0x9c) #define TX_ID_DWORD1 (PORT_BASE + 0xa0) #define TX_ID_DWORD2 (PORT_BASE + 0xa4) @@ -1256,9 +1259,12 @@ static irqreturn_t phy_bcast_v3_hw(int phy_no, struct hisi_hba *hisi_hba) struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no]; struct asd_sas_phy *sas_phy = &phy->sas_phy; struct sas_ha_struct *sas_ha = &hisi_hba->sha; + u32 bcast_status; hisi_sas_phy_write32(hisi_hba, phy_no, SL_RX_BCAST_CHK_MSK, 1); - sas_ha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD); + bcast_status = hisi_sas_phy_read32(hisi_hba, phy_no, RX_PRIMS_STATUS); + if (bcast_status & RX_BCAST_CHG_MSK) + sas_ha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD); hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0, CHL_INT0_SL_RX_BCST_ACK_MSK); hisi_sas_phy_write32(hisi_hba, phy_no, SL_RX_BCAST_CHK_MSK, 0);