aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJohn Garry <john.garry@huawei.com>2016-12-06 07:44:07 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2016-12-07 18:55:58 -0500
commit26f3ba9600e5d4437bb7299d2b01003b0d93e853 (patch)
treef8a94df29c35fe84d3a8f198a86517f24bd75e6c /drivers/scsi
parentfad119b707f8cc01b259b8585af4f9688e57c9a7 (diff)
scsi: hisi_sas: support deferred probe for v2 hw
In the hip06 and hip07 SoCs, the interrupt lines from the SAS controllers are connected to mbigen hw module [1]. The mbigen module is probed with module_init, and, as such, is not guaranteed to probe before the SAS driver. So we need to support deferred probe. We check for probe deferral in the hw layer probe, so we not probe into the main layer and allocate shost, memories, etc., to later learn that we need to defer the probe. [1] ./Documentation/devicetree/bindings/interrupt-controller/hisilicon,mbigen-v2.txt Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Zhangfei Gao <zhangfei.gao@linaro.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/hisi_sas/hisi_sas_v2_hw.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index 93876c0137eb..b934aec1eebb 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -2790,6 +2790,18 @@ static const struct hisi_sas_hw hisi_sas_v2_hw = {
2790 2790
2791static int hisi_sas_v2_probe(struct platform_device *pdev) 2791static int hisi_sas_v2_probe(struct platform_device *pdev)
2792{ 2792{
2793 /*
2794 * Check if we should defer the probe before we probe the
2795 * upper layer, as it's hard to defer later on.
2796 */
2797 int ret = platform_get_irq(pdev, 0);
2798
2799 if (ret < 0) {
2800 if (ret != -EPROBE_DEFER)
2801 dev_err(&pdev->dev, "cannot obtain irq\n");
2802 return ret;
2803 }
2804
2793 return hisi_sas_probe(pdev, &hisi_sas_v2_hw); 2805 return hisi_sas_probe(pdev, &hisi_sas_v2_hw);
2794} 2806}
2795 2807