All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Maxime Ripard <mripard@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
	linux-input@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/4] Input: ep93xx_keypad - Fix handling of platform_get_irq() error
Date: Tue, 15 Sep 2020 17:55:53 -0700	[thread overview]
Message-ID: <20200916005553.GF1681290@dtor-ws> (raw)
In-Reply-To: <CAJKOXPd0=oe0vZyxTJ0sF7U4THk3B=UPofKdKdXm_4s3td13Uw@mail.gmail.com>

On Tue, Sep 15, 2020 at 06:05:22PM +0200, Krzysztof Kozlowski wrote:
> On Mon, 14 Sep 2020 at 08:51, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> >
> > Hi Krzysztof,
> >
> > On Fri, Aug 28, 2020 at 04:57:41PM +0200, Krzysztof Kozlowski wrote:
> > > platform_get_irq() returns -ERRNO on error.  In such case comparison
> > > to 0 would pass the check.
> >
> > platform_get_irq() is a bit of a mess. Historically we allowed defining
> > interrupt resource with r->start == 0 and for such cases non-OF non-ACPI
> > code will return 0 from platform_get_irq() to indicate that IRQ is not
> > assigned.
> >
> > We either need to stop doing this in platform_get_irq(), or the
> > conditions in this patch and followups should be "irq <= 0" and we need
> > to make sure we do not accidentally return 0 from probe ...
> 
> Hi,
> 
> It's then contradictory to platform_get_irq documentation which
> explicitly says - zero will not be returned on error. This was also
> clarified in commit e330b9a6bb35 ("platform: don't return 0 from
> platform_get_irq[_byname]() on error").

It was for OF/ACPI, but not for resources described via DEFINE_RES_IRQ
or other means. However I see we added a big fat WARN_ON() in case if we
end up returning 0 still, so I will be applying your patches.

Thanks.

-- 
Dmitry

WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org,
	Chen-Yu Tsai <wens@csie.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Maxime Ripard <mripard@kernel.org>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH v2 1/4] Input: ep93xx_keypad - Fix handling of platform_get_irq() error
Date: Tue, 15 Sep 2020 17:55:53 -0700	[thread overview]
Message-ID: <20200916005553.GF1681290@dtor-ws> (raw)
In-Reply-To: <CAJKOXPd0=oe0vZyxTJ0sF7U4THk3B=UPofKdKdXm_4s3td13Uw@mail.gmail.com>

On Tue, Sep 15, 2020 at 06:05:22PM +0200, Krzysztof Kozlowski wrote:
> On Mon, 14 Sep 2020 at 08:51, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> >
> > Hi Krzysztof,
> >
> > On Fri, Aug 28, 2020 at 04:57:41PM +0200, Krzysztof Kozlowski wrote:
> > > platform_get_irq() returns -ERRNO on error.  In such case comparison
> > > to 0 would pass the check.
> >
> > platform_get_irq() is a bit of a mess. Historically we allowed defining
> > interrupt resource with r->start == 0 and for such cases non-OF non-ACPI
> > code will return 0 from platform_get_irq() to indicate that IRQ is not
> > assigned.
> >
> > We either need to stop doing this in platform_get_irq(), or the
> > conditions in this patch and followups should be "irq <= 0" and we need
> > to make sure we do not accidentally return 0 from probe ...
> 
> Hi,
> 
> It's then contradictory to platform_get_irq documentation which
> explicitly says - zero will not be returned on error. This was also
> clarified in commit e330b9a6bb35 ("platform: don't return 0 from
> platform_get_irq[_byname]() on error").

It was for OF/ACPI, but not for resources described via DEFINE_RES_IRQ
or other means. However I see we added a big fat WARN_ON() in case if we
end up returning 0 still, so I will be applying your patches.

Thanks.

-- 
Dmitry

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-09-16  0:56 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-28 14:57 [PATCH v2 1/4] Input: ep93xx_keypad - Fix handling of platform_get_irq() error Krzysztof Kozlowski
2020-08-28 14:57 ` Krzysztof Kozlowski
2020-08-28 14:57 ` [PATCH v2 2/4] Input: omap4-keypad " Krzysztof Kozlowski
2020-08-28 14:57   ` Krzysztof Kozlowski
2020-09-16  0:53   ` Dmitry Torokhov
2020-09-16  0:53     ` Dmitry Torokhov
2020-09-16  6:06     ` Krzysztof Kozlowski
2020-09-16  6:06       ` Krzysztof Kozlowski
2020-09-16  6:25       ` Dmitry Torokhov
2020-09-16  6:25         ` Dmitry Torokhov
2020-08-28 14:57 ` [PATCH v2 3/4] Input: twl4030_keypad " Krzysztof Kozlowski
2020-08-28 14:57   ` Krzysztof Kozlowski
2020-08-28 14:57 ` [PATCH v2 4/4] Input: sun4i-ps2 " Krzysztof Kozlowski
2020-08-28 14:57   ` Krzysztof Kozlowski
2020-08-28 15:34   ` Chen-Yu Tsai
2020-08-28 15:34     ` Chen-Yu Tsai
2020-09-16  1:01   ` Dmitry Torokhov
2020-09-16  1:01     ` Dmitry Torokhov
2020-09-16  6:08     ` Krzysztof Kozlowski
2020-09-16  6:08       ` Krzysztof Kozlowski
2020-09-11 15:31 ` [PATCH v2 1/4] Input: ep93xx_keypad " Krzysztof Kozlowski
2020-09-11 15:31   ` Krzysztof Kozlowski
2020-09-14  6:51 ` Dmitry Torokhov
2020-09-14  6:51   ` Dmitry Torokhov
2020-09-15 16:05   ` Krzysztof Kozlowski
2020-09-15 16:05     ` Krzysztof Kozlowski
2020-09-16  0:55     ` Dmitry Torokhov [this message]
2020-09-16  0:55       ` Dmitry Torokhov

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=20200916005553.GF1681290@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mripard@kernel.org \
    --cc=wens@csie.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.