linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Liu <jason.hui.liu@nxp.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: "will@kernel.org" <will@kernel.org>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"sashal@kernel.org" <sashal@kernel.org>,
	"maz@kernel.org" <maz@kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 1/1] arm64: kexec: no need to do irq_chip->irq_mask if it already masked
Date: Wed, 5 Aug 2020 06:30:13 +0000	[thread overview]
Message-ID: <VI1PR0402MB3824CCEEB23EF38126BEF50DAE4B0@VI1PR0402MB3824.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20200804102025.GA15199@bogus>


> -----Original Message-----
> From: Sudeep Holla <sudeep.holla@arm.com>
> Sent: Tuesday, August 4, 2020 6:20 PM
> To: Jason Liu <jason.hui.liu@nxp.com>
> Cc: will@kernel.org; catalin.marinas@arm.com; ashal@kernel.org;
> maz@kernel.org; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 1/1] arm64: kexec: no need to do irq_chip->irq_mask if it
> already masked
> 
> +Marc Z
> 
> On Tue, Aug 04, 2020 at 04:56:57PM +0800, Jason Liu wrote:
> > No need to do the irq_chip->irq_mask() if it already masked.
> > BTW, unconditionally do the irq_chip->irq_mask() will also bring
> > issues when the irq_chip in the runtime PM suspend. Accessing
> > registers of the irq_chip will bring in the exceptions. For example on the i.MX:
> >
> 
> The change looks good and is inline with the additional checks we do for eoi
> and disable. However, the imx_irqsteer_irq_mask is not safe to be called with
> runtime suspend. 

Yes, you are right. imx_irqsteer_irq_mask can not be called with irqchip runtime suspend.
IMO, this might apply to all platforms which implement the irq_chip->mask function with
directly access the registers.

> What happens if some driver using the irq on this chip calls
> disable_irq when this irqchip is suspended ?

IMO, only free_irq will call the irq_chip_pm_put which will bring the irqchip to suspend if that irq is the last user.
Otherwise, the irqchip is in active state. free_irq will set the IRQ state to DISABLED and MASKED.
So, if the irqchip in suspend state, which means all the irqs(associated with irqchip) were DISABLED and MASKED.
If call the common API disable_irq, that is fine due to the disable_irq will nop if the irq was DISABLED and masked. 

> 
> --
> Regards,
> Sudeep

  reply	other threads:[~2020-08-05  6:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04  8:56 [PATCH 1/1] arm64: kexec: no need to do irq_chip->irq_mask if it already masked Jason Liu
2020-08-04 10:20 ` Sudeep Holla
2020-08-05  6:30   ` Jason Liu [this message]
2020-08-04 10:58 ` Marc Zyngier
2020-08-04 11:38   ` Sudeep Holla
2020-08-05  6:31     ` Jason Liu
2020-08-05  8:17       ` Marc Zyngier
2020-08-06 10:05         ` Jason Liu
2020-08-06 12:25           ` Marc Zyngier
2020-08-13  6:03             ` Jason Liu
2020-08-13 10:08               ` Marc Zyngier
2020-08-05  8:47       ` Sudeep Holla
2020-08-06 10:09         ` Jason Liu
  -- strict thread matches above, loose matches on Subject: below --
2020-07-02  9:27 Jason Liu

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=VI1PR0402MB3824CCEEB23EF38126BEF50DAE4B0@VI1PR0402MB3824.eurprd04.prod.outlook.com \
    --to=jason.hui.liu@nxp.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=sashal@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=will@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).