From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Subject: Re: [PATCH] net/smsc911x: Fix deferred probe for interrupt Date: Mon, 31 Aug 2015 20:05:02 +0300 Message-ID: <55E4893E.2010309@cogentembedded.com> References: <1440787815-24655-1-git-send-email-tony@atomide.com> <55E22540.3060307@cogentembedded.com> <55E45E9E.1090900@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, linux-omap@vger.kernel.org, Steve Glendinning To: Grygorii Strashko , Tony Lindgren , David Miller , Geert Uytterhoeven Return-path: Received: from mail-la0-f42.google.com ([209.85.215.42]:35948 "EHLO mail-la0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753340AbbHaRFG (ORCPT ); Mon, 31 Aug 2015 13:05:06 -0400 Received: by labnh1 with SMTP id nh1so50444114lab.3 for ; Mon, 31 Aug 2015 10:05:04 -0700 (PDT) In-Reply-To: <55E45E9E.1090900@ti.com> Sender: netdev-owner@vger.kernel.org List-ID: Hello. On 08/31/2015 05:03 PM, Grygorii Strashko wrote: >>> The interrupt handler may not be available when smsc911x probes if the >>> interrupt handler is a GPIO controller for example. Let's fix that >>> by adding handling for -EPROBE_DEFER. >> >>> Cc: Steve Glendinning >>> Signed-off-by: Tony Lindgren >>> --- >>> drivers/net/ethernet/smsc/smsc911x.c | 5 ++++- >>> 1 file changed, 4 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/net/ethernet/smsc/smsc911x.c >>> b/drivers/net/ethernet/smsc/smsc911x.c >>> index 959aeea..cb9f166f 100644 >>> --- a/drivers/net/ethernet/smsc/smsc911x.c >>> +++ b/drivers/net/ethernet/smsc/smsc911x.c >>> @@ -2435,7 +2435,10 @@ static int smsc911x_drv_probe(struct >>> platform_device *pdev) >>> res_size = resource_size(res); >>> >>> irq = platform_get_irq(pdev, 0); >>> - if (irq <= 0) { >>> + if (irq == -EPROBE_DEFER) { >>> + retval = -EPROBE_DEFER; >>> + goto out_0; >>> + } else if (irq <= 0) { >>> pr_warn("Could not allocate irq resource\n"); >>> retval = -ENODEV; >> >> I'd propagate the error code from platfrom_get_irq() instead (in >> fact, I've submitted a couple of such patches yesterday and they have >> been already merged). > Have you paid some attention on current platform_get_irq_() implementation? > The platform_get_irq() can return 0 in case of DT-boot. This is what's indeed worth filtering out and converting to -ENODEV. ;-) But my patches just ignored this possibility. I'm not at all fond of Linus' idea about IRQ0 being invalid, BTW... WBR, Sergei