From: John Garry <john.garry@huawei.com> To: <jejb@linux.vnet.ibm.com>, <martin.petersen@oracle.com> Cc: <linux-scsi@vger.kernel.org>, <linuxarm@huawei.com>, <linux-kernel@vger.kernel.org>, Xiaofei Tan <tanxiaofei@huawei.com>, "John Garry" <john.garry@huawei.com> 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 [thread overview] Message-ID: <1527771050-200916-3-git-send-email-john.garry@huawei.com> (raw) In-Reply-To: <1527771050-200916-1-git-send-email-john.garry@huawei.com> From: Xiaofei Tan <tanxiaofei@huawei.com> 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 <tanxiaofei@huawei.com> Signed-off-by: John Garry <john.garry@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- 1.9.1
WARNING: multiple messages have this Message-ID (diff)
From: John Garry <john.garry@huawei.com> To: jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linuxarm@huawei.com, linux-kernel@vger.kernel.org, Xiaofei Tan <tanxiaofei@huawei.com>, John Garry <john.garry@huawei.com> 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 [thread overview] Message-ID: <1527771050-200916-3-git-send-email-john.garry@huawei.com> (raw) In-Reply-To: <1527771050-200916-1-git-send-email-john.garry@huawei.com> From: Xiaofei Tan <tanxiaofei@huawei.com> 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 <tanxiaofei@huawei.com> Signed-off-by: John Garry <john.garry@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- 1.9.1
next prev parent reply other threads:[~2018-05-31 12:54 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-05-31 12:50 [PATCH 0/9] hisi_sas: some misc changes John Garry 2018-05-31 12:50 ` John Garry 2018-05-31 12:50 ` [PATCH 1/9] scsi: hisi_sas: Use dmam_alloc_coherent() John Garry 2018-05-31 12:50 ` John Garry 2018-05-31 12:50 ` John Garry [this message] 2018-05-31 12:50 ` [PATCH 2/9] scsi: hisi_sas: Only process broadcast change in phy_bcast_v3_hw() John Garry 2018-05-31 12:50 ` [PATCH 3/9] scsi: hisi_sas: Fix the conflict between dev gone and host reset John Garry 2018-05-31 12:50 ` John Garry 2018-05-31 12:50 ` [PATCH 4/9] scsi: hisi_sas: Adjust task reject period during " John Garry 2018-05-31 12:50 ` John Garry 2018-05-31 12:50 ` [PATCH 5/9] scsi: hisi_sas: Add a flag to filter PHY events during reset John Garry 2018-05-31 12:50 ` John Garry 2018-05-31 12:50 ` [PATCH 6/9] scsi: hisi_sas: Release all remaining resources in clear nexus ha John Garry 2018-05-31 12:50 ` John Garry 2018-05-31 12:50 ` [PATCH 7/9] scsi: hisi_sas: Pre-allocate slot DMA buffers John Garry 2018-05-31 12:50 ` John Garry 2018-05-31 12:50 ` [PATCH 8/9] scsi: hisi_sas: Add missing PHY spinlock init John Garry 2018-05-31 12:50 ` John Garry 2018-05-31 12:50 ` [PATCH 9/9] scsi: hisi_sas: Update a couple of register settings for v3 hw John Garry 2018-05-31 12:50 ` John Garry 2018-06-08 1:42 ` [PATCH 0/9] hisi_sas: some misc changes Martin K. Petersen 2018-06-08 1:42 ` Martin K. Petersen
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1527771050-200916-3-git-send-email-john.garry@huawei.com \ --to=john.garry@huawei.com \ --cc=jejb@linux.vnet.ibm.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-scsi@vger.kernel.org \ --cc=linuxarm@huawei.com \ --cc=martin.petersen@oracle.com \ --cc=tanxiaofei@huawei.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.