All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Wolfram Sang <wsa@kernel.org>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Oleksij Rempel <linux@rempel-privat.de>,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	NXP Linux Team <linux-imx@nxp.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Shawn Guo <shawnguo@kernel.org>,
	linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH] i2c: imx: Fix external abort on early interrupt
Date: Fri, 12 Jun 2020 15:09:15 +0200	[thread overview]
Message-ID: <20200612130915.GA26279@pi3> (raw)
In-Reply-To: <20200612130003.GB18557@ninjato>

On Fri, Jun 12, 2020 at 03:00:03PM +0200, Wolfram Sang wrote:
> On Fri, Jun 12, 2020 at 02:18:06PM +0200, Marc Kleine-Budde wrote:
> > On 6/12/20 1:51 PM, Wolfram Sang wrote:
> > > 
> > >> This basically kills the concept of devm for interrupts. Some other
> > > 
> > > It only works when you can ensure you have all interrupts disabled (and
> > > none pending) in remove() or the error paths of probe() etc.
> > 
> > But when requesting the interrupt as shared the interrupt handler can get called
> > any time, even if you have disabled the IRQ source in your IP core....The shared
> > IRQ debug code tests this.
> 
> Yes, so you'd need something like
> 
> 	if (clks_are_off)
> 		return IRQ_NONE;

Maybe then:
	if (pm_runtime_enabled())?

The device structure should be valid at this point so the call should
work.


> 
> or skip devm_ for interrupts and handle it manually. (IIRC the input
> subsystem really frowns upon devm + irqs for such reasons)
> 
> D'accord?

I guess dream of managing every resource automatically is an utopia :)

Best regards,
Krzysztof



WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Wolfram Sang <wsa@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Oleksij Rempel <linux@rempel-privat.de>,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	NXP Linux Team <linux-imx@nxp.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH] i2c: imx: Fix external abort on early interrupt
Date: Fri, 12 Jun 2020 15:09:15 +0200	[thread overview]
Message-ID: <20200612130915.GA26279@pi3> (raw)
In-Reply-To: <20200612130003.GB18557@ninjato>

On Fri, Jun 12, 2020 at 03:00:03PM +0200, Wolfram Sang wrote:
> On Fri, Jun 12, 2020 at 02:18:06PM +0200, Marc Kleine-Budde wrote:
> > On 6/12/20 1:51 PM, Wolfram Sang wrote:
> > > 
> > >> This basically kills the concept of devm for interrupts. Some other
> > > 
> > > It only works when you can ensure you have all interrupts disabled (and
> > > none pending) in remove() or the error paths of probe() etc.
> > 
> > But when requesting the interrupt as shared the interrupt handler can get called
> > any time, even if you have disabled the IRQ source in your IP core....The shared
> > IRQ debug code tests this.
> 
> Yes, so you'd need something like
> 
> 	if (clks_are_off)
> 		return IRQ_NONE;

Maybe then:
	if (pm_runtime_enabled())?

The device structure should be valid at this point so the call should
work.


> 
> or skip devm_ for interrupts and handle it manually. (IIRC the input
> subsystem really frowns upon devm + irqs for such reasons)
> 
> D'accord?

I guess dream of managing every resource automatically is an utopia :)

Best regards,
Krzysztof



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

  reply	other threads:[~2020-06-12 13:09 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10 13:46 [PATCH] i2c: imx: Fix external abort on early interrupt Krzysztof Kozlowski
2020-06-10 13:46 ` Krzysztof Kozlowski
2020-06-12  5:51 ` Oleksij Rempel
2020-06-12  5:51   ` Oleksij Rempel
2020-06-12  7:38   ` Krzysztof Kozlowski
2020-06-12  7:38     ` Krzysztof Kozlowski
2020-06-12  8:02     ` Oleksij Rempel
2020-06-12  8:02       ` Oleksij Rempel
2020-06-12  8:23       ` Krzysztof Kozlowski
2020-06-12  8:23         ` Krzysztof Kozlowski
2020-06-12  9:05 ` Wolfram Sang
2020-06-12  9:05   ` Wolfram Sang
2020-06-12  9:29   ` Krzysztof Kozlowski
2020-06-12  9:29     ` Krzysztof Kozlowski
2020-06-12  9:56     ` Wolfram Sang
2020-06-12  9:56       ` Wolfram Sang
2020-06-12 10:21       ` Krzysztof Kozlowski
2020-06-12 10:21         ` Krzysztof Kozlowski
2020-06-12 10:31         ` Oleksij Rempel
2020-06-12 10:31           ` Oleksij Rempel
2020-06-12 10:34           ` Marc Kleine-Budde
2020-06-12 10:34             ` Marc Kleine-Budde
2020-06-12 10:44             ` Krzysztof Kozlowski
2020-06-12 10:44               ` Krzysztof Kozlowski
2020-06-12 10:50               ` Marc Kleine-Budde
2020-06-12 10:50                 ` Marc Kleine-Budde
2020-06-12 10:39           ` Krzysztof Kozlowski
2020-06-12 10:39             ` Krzysztof Kozlowski
2020-06-12 11:51             ` Wolfram Sang
2020-06-12 11:51               ` Wolfram Sang
2020-06-12 12:18               ` Marc Kleine-Budde
2020-06-12 12:18                 ` Marc Kleine-Budde
2020-06-12 13:00                 ` Wolfram Sang
2020-06-12 13:00                   ` Wolfram Sang
2020-06-12 13:09                   ` Krzysztof Kozlowski [this message]
2020-06-12 13:09                     ` Krzysztof Kozlowski
2020-06-15  7:37                   ` Aisheng Dong
2020-06-15  7:37                     ` Aisheng Dong

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=20200612130915.GA26279@pi3 \
    --to=krzk@kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rempel-privat.de \
    --cc=mkl@pengutronix.de \
    --cc=o.rempel@pengutronix.de \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=wsa@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 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.