From: Matthias Brugger <matthias.bgg@gmail.com>
To: netdev@vger.kernel.org
Cc: netdev@vger.kernel.org, charles.chenxin@huawei.com, linuxarm@huawei.com
Subject: Re: [PATCH net v2 1/3] net: hns: support deferred probe when can not obtain irq
Date: Mon, 24 Apr 2017 12:28:33 +0200 [thread overview]
Message-ID: <f9ebfcdf-daa2-2722-1f12-fb34e24adc24@gmail.com> (raw)
In-Reply-To: <1492760684-117205-2-git-send-email-yankejian@huawei.com>
On 21/04/17 09:44, Yankejian wrote:
> From: lipeng <lipeng321@huawei.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.
>
Why? This looks like a hack.
From what I see, we can handle EPROBE_DEFER easily inside hns_ppe_init
checking the return value of hns_rcb_get_cfg. Like you do in 2/3 of this
series.
Regards,
Matthias
> Signed-off-by: lipeng <lipeng321@huawei.com>
> Reviewed-by: Yisen Zhuang <yisen.zhuang@huawei.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);
>
next prev parent reply other threads:[~2017-04-24 10:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-21 7:44 [PATCH net v2 0/3] net: hns: bug fix for HNS driver Yankejian
2017-04-21 7:44 ` [PATCH net v2 1/3] net: hns: support deferred probe when can not obtain irq Yankejian
2017-04-24 10:28 ` Matthias Brugger [this message]
[not found] ` <a64b254a-d5b4-287e-1f76-ec6f8189609a@huawei.com>
2017-04-24 14:47 ` Matthias Brugger
2017-04-25 8:21 ` lipeng (Y)
2017-04-21 7:44 ` [PATCH net v2 2/3] net: hns: support deferred probe when no mdio Yankejian
2017-04-21 7:44 ` [PATCH net v3 3/3] net: hns: fixed bug that skb used after kfree Yankejian
2017-04-24 16:24 ` [PATCH net v2 0/3] net: hns: bug fix for HNS driver David Miller
2017-04-26 3:05 ` lipeng (Y)
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=f9ebfcdf-daa2-2722-1f12-fb34e24adc24@gmail.com \
--to=matthias.bgg@gmail.com \
--cc=charles.chenxin@huawei.com \
--cc=linuxarm@huawei.com \
--cc=netdev@vger.kernel.org \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).