lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1492510354-11300-2-git-send-email-yankejian@huawei.com>
Date:   Tue, 18 Apr 2017 18:12:32 +0800
From:   Yankejian <yankejian@...wei.com>
To:     <davem@...emloft.net>, <salil.mehta@...wei.com>,
        <yisen.zhuang@...wei.com>, <allenhuangsz10@...il.com>,
        <lipeng321@...wei.com>, <huangdaode@...ilicon.com>,
        <hjat.hejun@...wei.com>, <zhangping5@...wei.com>,
        <qichengming@...wei.com>, <qumingguang@...ilicon.com>,
        <zhouhuiru@...wei.com>
CC:     <netdev@...r.kernel.org>, <charles.chenxin@...wei.com>,
        <linuxarm@...wei.com>
Subject: [PATCH net-next 1/3] net: hns: support deferred probe when can not obtain irq

From: lipeng <lipeng321@...wei.com>

In the hip06 and hip07 SoCs, the interrupt lines from the
DSAF controllers are connected to mbigen hw module.
The mbigen module is probed with module_init, and, as such,
is not guaranteed to probe before the HNS 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 memories, etc., to later learn
that we need to defer the probe.

Signed-off-by: lipeng <lipeng321@...wei.com>
---
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
index 403ea9d..2da5b42 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
@@ -2971,6 +2971,18 @@ static int hns_dsaf_probe(struct platform_device *pdev)
 	struct dsaf_device *dsaf_dev;
 	int ret;
 
+	/*
+	 * Check if we should defer the probe before we probe the
+	 * dsaf, as it's hard to defer later on.
+	 */
+	ret = platform_get_irq(pdev, 0);
+	if (ret < 0) {
+		if (ret != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "Cannot obtain irq\n");
+
+		return ret;
+	}
+
 	dsaf_dev = hns_dsaf_alloc_dev(&pdev->dev, sizeof(struct dsaf_drv_priv));
 	if (IS_ERR(dsaf_dev)) {
 		ret = PTR_ERR(dsaf_dev);
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ