aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hisi_sas
diff options
context:
space:
mode:
authorJohn Garry <john.garry@huawei.com>2015-11-17 11:50:53 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2015-11-25 22:13:05 -0500
commitdc5da4cf8e4c29f82e4ead8cf4d4dad61c78fab9 (patch)
tree0a0235d35609d80b15576204d318f0502b2ab382 /drivers/scsi/hisi_sas
parent184a4635340be6e0e804240ff889c3c82d6e4745 (diff)
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:
1333 return res; 1333 return res;
1334} 1334}
1335 1335
1336static irqreturn_t int_bcast_v1_hw(int irq, void *p)
1337{
1338 struct hisi_sas_phy *phy = p;
1339 struct hisi_hba *hisi_hba = phy->hisi_hba;
1340 struct asd_sas_phy *sas_phy = &phy->sas_phy;
1341 struct sas_ha_struct *sha = &hisi_hba->sha;
1342 struct device *dev = &hisi_hba->pdev->dev;
1343 int phy_no = sas_phy->id;
1344 u32 irq_value;
1345 irqreturn_t res = IRQ_HANDLED;
1346
1347 irq_value = hisi_sas_phy_read32(hisi_hba, phy_no, CHL_INT2);
1348
1349 if (!(irq_value & CHL_INT2_SL_RX_BC_ACK_MSK)) {
1350 dev_err(dev, "bcast: irq_value = %x not set enable bit",
1351 irq_value);
1352 res = IRQ_NONE;
1353 goto end;
1354 }
1355
1356 sha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD);
1357
1358end:
1359 hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT2,
1360 CHL_INT2_SL_RX_BC_ACK_MSK);
1361
1362 return res;
1363}
1364
1336static irqreturn_t int_abnormal_v1_hw(int irq, void *p) 1365static irqreturn_t int_abnormal_v1_hw(int irq, void *p)
1337{ 1366{
1338 struct hisi_sas_phy *phy = p; 1367 struct hisi_sas_phy *phy = p;
@@ -1438,12 +1467,14 @@ static irqreturn_t cq_interrupt_v1_hw(int irq, void *p)
1438} 1467}
1439 1468
1440static const char phy_int_names[HISI_SAS_PHY_INT_NR][32] = { 1469static const char phy_int_names[HISI_SAS_PHY_INT_NR][32] = {
1470 {"Bcast"},
1441 {"Phy Up"}, 1471 {"Phy Up"},
1442 {"Abnormal"}, 1472 {"Abnormal"},
1443}; 1473};
1444 1474
1445static const char cq_int_name[32] = "cq"; 1475static const char cq_int_name[32] = "cq";
1446static irq_handler_t phy_interrupts[HISI_SAS_PHY_INT_NR] = { 1476static irq_handler_t phy_interrupts[HISI_SAS_PHY_INT_NR] = {
1477 int_bcast_v1_hw,
1447 int_phyup_v1_hw, 1478 int_phyup_v1_hw,
1448 int_abnormal_v1_hw 1479 int_abnormal_v1_hw
1449}; 1480};