summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hisi_sas
diff options
context:
space:
mode:
authorJohn Garry2015-11-17 17:50:53 +0100
committerMartin K. Petersen2015-11-26 04:13:05 +0100
commitdc5da4cf8e4c29f82e4ead8cf4d4dad61c78fab9 (patch)
tree0a0235d35609d80b15576204d318f0502b2ab382 /drivers/scsi/hisi_sas
parenthisi_sas: Add abnormal irq handler (diff)
downloadkernel-qcow2-linux-dc5da4cf8e4c29f82e4ead8cf4d4dad61c78fab9.tar.gz
kernel-qcow2-linux-dc5da4cf8e4c29f82e4ead8cf4d4dad61c78fab9.tar.xz
kernel-qcow2-linux-dc5da4cf8e4c29f82e4ead8cf4d4dad61c78fab9.zip
hisi_sas: Add bcast interrupt handler
This is for expander broadcast event. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/hisi_sas')
-rw-r--r--drivers/scsi/hisi_sas/hisi_sas_v1_hw.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
index 1723dd453e06..ad50aed5a1cf 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
@@ -1333,6 +1333,35 @@ end:
return res;
}
+static irqreturn_t int_bcast_v1_hw(int irq, void *p)
+{
+ struct hisi_sas_phy *phy = p;
+ struct hisi_hba *hisi_hba = phy->hisi_hba;
+ struct asd_sas_phy *sas_phy = &phy->sas_phy;
+ struct sas_ha_struct *sha = &hisi_hba->sha;
+ struct device *dev = &hisi_hba->pdev->dev;
+ int phy_no = sas_phy->id;
+ u32 irq_value;
+ irqreturn_t res = IRQ_HANDLED;
+
+ irq_value = hisi_sas_phy_read32(hisi_hba, phy_no, CHL_INT2);
+
+ if (!(irq_value & CHL_INT2_SL_RX_BC_ACK_MSK)) {
+ dev_err(dev, "bcast: irq_value = %x not set enable bit",
+ irq_value);
+ res = IRQ_NONE;
+ goto end;
+ }
+
+ sha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD);
+
+end:
+ hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT2,
+ CHL_INT2_SL_RX_BC_ACK_MSK);
+
+ return res;
+}
+
static irqreturn_t int_abnormal_v1_hw(int irq, void *p)
{
struct hisi_sas_phy *phy = p;
@@ -1438,12 +1467,14 @@ static irqreturn_t cq_interrupt_v1_hw(int irq, void *p)
}
static const char phy_int_names[HISI_SAS_PHY_INT_NR][32] = {
+ {"Bcast"},
{"Phy Up"},
{"Abnormal"},
};
static const char cq_int_name[32] = "cq";
static irq_handler_t phy_interrupts[HISI_SAS_PHY_INT_NR] = {
+ int_bcast_v1_hw,
int_phyup_v1_hw,
int_abnormal_v1_hw
};