linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/8] net: pxa168_eth: Use platform_get_irq() to get the interrupt
Date: Sun, 26 Dec 2021 12:14:55 +0100	[thread overview]
Message-ID: <bb5a43e5-6036-3788-71ca-c411611e0ad9@gmail.com> (raw)
In-Reply-To: <CA+V-a8tuD-WKyRL_kwitqOyxJDMu1J14AtZ12LbSF9+8mj+=FQ@mail.gmail.com>

On 25.12.2021 13:19, Lad, Prabhakar wrote:
> Hi Andy,
> 
> Thank you for the review.
> 
> On Sat, Dec 25, 2021 at 11:24 AM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
>>
>>
>>
>> On Friday, December 24, 2021, Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:
>>>
>>> platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
>>> allocation of IRQ resources in DT core code, this causes an issue
>>> when using hierarchical interrupt domains using "interrupts" property
>>> in the node as this bypasses the hierarchical setup and messes up the
>>> irq chaining.
>>>
>>> In preparation for removal of static setup of IRQ resource from DT core
>>> code use platform_get_irq().
>>>
>>> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>>> ---
>>>  drivers/net/ethernet/marvell/pxa168_eth.c | 9 +++++----
>>>  1 file changed, 5 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
>>> index 1d607bc6b59e..52bef50f5a0d 100644
>>> --- a/drivers/net/ethernet/marvell/pxa168_eth.c
>>> +++ b/drivers/net/ethernet/marvell/pxa168_eth.c
>>> @@ -1388,7 +1388,6 @@ static int pxa168_eth_probe(struct platform_device *pdev)
>>>  {
>>>         struct pxa168_eth_private *pep = NULL;
>>>         struct net_device *dev = NULL;
>>> -       struct resource *res;
>>>         struct clk *clk;
>>>         struct device_node *np;
>>>         int err;
>>> @@ -1419,9 +1418,11 @@ static int pxa168_eth_probe(struct platform_device *pdev)
>>>                 goto err_netdev;
>>>         }
>>>
>>> -       res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
>>> -       BUG_ON(!res);
>>> -       dev->irq = res->start;
>>> +       err = platform_get_irq(pdev, 0);
>>> +       if (err == -EPROBE_DEFER)
>>
>>
>>  What about other errors?
>>
> Ouch I missed it...
>>
>>>
>>> +               goto err_netdev;
>>> +       BUG_ON(dev->irq < 0);
>>
>>
>> ??? What is this and how it supposed to work?
>>
> 
.. should have been BUG_ON(dev->irq < 0);

Usage of BUG_ON() is discouraged. Better handle the error w/o stopping
the whole system.

> 
> Cheers,
> Prabhakar
>>>
>>> +       dev->irq = err;
>>>         dev->netdev_ops = &pxa168_eth_netdev_ops;
>>>         dev->watchdog_timeo = 2 * HZ;
>>>         dev->base_addr = 0;
>>> --
>>> 2.17.1
>>>
>>
>>
>> --
>> With Best Regards,
>> Andy Shevchenko
>>
>>


  parent reply	other threads:[~2021-12-26 11:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-24 19:26 [PATCH 0/8] net: Use platform_get_irq*() variants to fetch IRQ's Lad Prabhakar
2021-12-24 19:26 ` [PATCH 1/8] ethernet: netsec: Use platform_get_irq() to get the interrupt Lad Prabhakar
2021-12-24 19:26 ` [PATCH 2/8] net: pxa168_eth: " Lad Prabhakar
     [not found]   ` <CAHp75VcurBNEcMFnAHTg8PTbJOhO7QA4iv1t4W=siC=D-AkHAw@mail.gmail.com>
2021-12-25 12:19     ` Lad, Prabhakar
2021-12-25 15:16       ` Andrew Lunn
2021-12-26 11:14       ` Heiner Kallweit [this message]
2021-12-26 14:24         ` Lad, Prabhakar
2021-12-24 19:26 ` [PATCH 3/8] fsl/fman: " Lad Prabhakar
2021-12-24 19:26 ` [PATCH 4/8] net: ethoc: " Lad Prabhakar
2021-12-24 19:26 ` [PATCH 5/8] net: xilinx: emaclite: " Lad Prabhakar
2021-12-24 19:26 ` [PATCH 6/8] wcn36xx: Use platform_get_irq_byname() " Lad Prabhakar
2022-01-17 12:44   ` Kalle Valo
2021-12-24 19:26 ` [PATCH 7/8] ath10k: Use platform_get_irq() " Lad Prabhakar
2022-01-17 12:41   ` Kalle Valo
2021-12-24 19:26 ` [PATCH 8/8] net: ethernet: ti: davinci_emac: " Lad Prabhakar
2021-12-25 16:58   ` Andy Shevchenko
2021-12-25 17:17     ` Lad, Prabhakar

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=bb5a43e5-6036-3788-71ca-c411611e0ad9@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=prabhakar.csengg@gmail.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=robh+dt@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).