All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Marc Zyngier <maz@kernel.org>
Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski <brgl@bgdev.pl>,
	Thierry Reding <thierry.reding@gmail.com>,
	Joey Gouly <joey.gouly@arm.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Hector Martin <marcan@marcan.st>, Sven Peter <sven@svenpeter.dev>,
	Alyssa Rosenzweig <alyssa@rosenzweig.io>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Andy Gross <agross@kernel.org>,
	Jeffrey Hugo <jeffrey.l.hugo@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Basavaraj Natikar <Basavaraj.Natikar@amd.com>,
	Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
	linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org, kernel-team@android.com
Subject: Re: [PATCH v2 00/10] gpiolib: Handle immutable irq_chip structures
Date: Tue, 19 Apr 2022 23:56:17 +0200	[thread overview]
Message-ID: <CACRpkdbdo=Es8VU_td6S3LCVCsYpcWC=pW1SGDXEAe2Gp8uZcA@mail.gmail.com> (raw)
In-Reply-To: <20220405135444.199295-1-maz@kernel.org>

On Tue, Apr 5, 2022 at 3:55 PM Marc Zyngier <maz@kernel.org> wrote:

> Not only this breaks when an irq_chip structure is made const (which
> really should be the default case), but it also forces this structure
> to be copied at nauseam for each instance of the GPIO block, which is
> a waste of memory.
>
> My current approach is to add a new irq_chip flag (IRQCHIP_IMMUTABLE)
> which does what it says on the tin: don't you dare writing to them.
> Gpiolib is further updated not to install its own callbacks, and it
> becomes the responsibility of the driver to call into the gpiolib when
> required. This is similar to what we do for other subsystems such as
> PCI-MSI.
>
> 5 drivers are updated to this new model: M1, QC, Tegra, pl061 and AMD
> (as I actively use them) keeping a single irq_chip structure, marking
> it const, and exposing the new flag.
>
> Nothing breaks, the volume of change is small, the memory usage goes
> down and we have fewer callbacks that can be used as attack vectors.
> What's not to love?
>
> * From v1 [1]:
>   - pl061 and AMD drivers converted
>   - New helpers to keep the changes small
>   - New warning for non-converted drivers
>   - Documentation and TODO updates
>
> [1] https://lore.kernel.org/r/20220223154405.54912-1-maz@kernel.org
>
> Marc Zyngier (10):
>   gpio: Don't fiddle with irqchips marked as immutable
>   gpio: Expose the gpiochip_irq_re[ql]res helpers
>   gpio: Add helpers to ease the transition towards immutable irq_chip
>   gpio: tegra186: Make the irqchip immutable
>   gpio: pl061: Make the irqchip immutable
>   pinctrl: apple-gpio: Make the irqchip immutable
>   pinctrl: msmgpio: Make the irqchip immutable
>   pinctrl: amd: Make the irqchip immutable
>   gpio: Update TODO to mention immutable irq_chip structures
>   Documentation: Update the recommended pattern for GPIO irqchips

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

WARNING: multiple messages have this Message-ID (diff)
From: Linus Walleij <linus.walleij@linaro.org>
To: Marc Zyngier <maz@kernel.org>
Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski <brgl@bgdev.pl>,
	 Thierry Reding <thierry.reding@gmail.com>,
	Joey Gouly <joey.gouly@arm.com>,
	 Jonathan Hunter <jonathanh@nvidia.com>,
	Hector Martin <marcan@marcan.st>, Sven Peter <sven@svenpeter.dev>,
	Alyssa Rosenzweig <alyssa@rosenzweig.io>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	 Andy Gross <agross@kernel.org>,
	Jeffrey Hugo <jeffrey.l.hugo@gmail.com>,
	 Thomas Gleixner <tglx@linutronix.de>,
	Basavaraj Natikar <Basavaraj.Natikar@amd.com>,
	 Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
	linux-gpio@vger.kernel.org,  linux-tegra@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-arm-msm@vger.kernel.org, kernel-team@android.com
Subject: Re: [PATCH v2 00/10] gpiolib: Handle immutable irq_chip structures
Date: Tue, 19 Apr 2022 23:56:17 +0200	[thread overview]
Message-ID: <CACRpkdbdo=Es8VU_td6S3LCVCsYpcWC=pW1SGDXEAe2Gp8uZcA@mail.gmail.com> (raw)
In-Reply-To: <20220405135444.199295-1-maz@kernel.org>

On Tue, Apr 5, 2022 at 3:55 PM Marc Zyngier <maz@kernel.org> wrote:

> Not only this breaks when an irq_chip structure is made const (which
> really should be the default case), but it also forces this structure
> to be copied at nauseam for each instance of the GPIO block, which is
> a waste of memory.
>
> My current approach is to add a new irq_chip flag (IRQCHIP_IMMUTABLE)
> which does what it says on the tin: don't you dare writing to them.
> Gpiolib is further updated not to install its own callbacks, and it
> becomes the responsibility of the driver to call into the gpiolib when
> required. This is similar to what we do for other subsystems such as
> PCI-MSI.
>
> 5 drivers are updated to this new model: M1, QC, Tegra, pl061 and AMD
> (as I actively use them) keeping a single irq_chip structure, marking
> it const, and exposing the new flag.
>
> Nothing breaks, the volume of change is small, the memory usage goes
> down and we have fewer callbacks that can be used as attack vectors.
> What's not to love?
>
> * From v1 [1]:
>   - pl061 and AMD drivers converted
>   - New helpers to keep the changes small
>   - New warning for non-converted drivers
>   - Documentation and TODO updates
>
> [1] https://lore.kernel.org/r/20220223154405.54912-1-maz@kernel.org
>
> Marc Zyngier (10):
>   gpio: Don't fiddle with irqchips marked as immutable
>   gpio: Expose the gpiochip_irq_re[ql]res helpers
>   gpio: Add helpers to ease the transition towards immutable irq_chip
>   gpio: tegra186: Make the irqchip immutable
>   gpio: pl061: Make the irqchip immutable
>   pinctrl: apple-gpio: Make the irqchip immutable
>   pinctrl: msmgpio: Make the irqchip immutable
>   pinctrl: amd: Make the irqchip immutable
>   gpio: Update TODO to mention immutable irq_chip structures
>   Documentation: Update the recommended pattern for GPIO irqchips

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

  parent reply	other threads:[~2022-04-19 21:56 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-05 13:54 [PATCH v2 00/10] gpiolib: Handle immutable irq_chip structures Marc Zyngier
2022-04-05 13:54 ` Marc Zyngier
2022-04-05 13:54 ` [PATCH v2 01/10] gpio: Don't fiddle with irqchips marked as immutable Marc Zyngier
2022-04-05 13:54   ` Marc Zyngier
2022-04-05 13:54 ` [PATCH v2 02/10] gpio: Expose the gpiochip_irq_re[ql]res helpers Marc Zyngier
2022-04-05 13:54   ` Marc Zyngier
2022-04-05 13:54 ` [PATCH v2 03/10] gpio: Add helpers to ease the transition towards immutable irq_chip Marc Zyngier
2022-04-05 13:54   ` Marc Zyngier
2022-04-05 13:54 ` [PATCH v2 04/10] gpio: tegra186: Make the irqchip immutable Marc Zyngier
2022-04-05 13:54   ` Marc Zyngier
2022-04-05 13:54 ` [PATCH v2 05/10] gpio: pl061: " Marc Zyngier
2022-04-05 13:54   ` Marc Zyngier
2022-04-05 13:54 ` [PATCH v2 06/10] pinctrl: apple-gpio: " Marc Zyngier
2022-04-05 13:54   ` Marc Zyngier
2022-04-05 13:54 ` [PATCH v2 07/10] pinctrl: msmgpio: " Marc Zyngier
2022-04-05 13:54   ` Marc Zyngier
2022-04-05 13:54 ` [PATCH v2 08/10] pinctrl: amd: " Marc Zyngier
2022-04-05 13:54   ` Marc Zyngier
2022-04-05 13:54 ` [PATCH v2 09/10] gpio: Update TODO to mention immutable irq_chip structures Marc Zyngier
2022-04-05 13:54   ` Marc Zyngier
2022-04-05 13:54 ` [PATCH v2 10/10] Documentation: Update the recommended pattern for GPIO irqchips Marc Zyngier
2022-04-05 13:54   ` Marc Zyngier
2022-04-08 11:33   ` Andy Shevchenko
2022-04-08 11:33     ` Andy Shevchenko
2022-04-08 12:26     ` Marc Zyngier
2022-04-08 12:26       ` Marc Zyngier
2022-04-08 11:35 ` [PATCH v2 00/10] gpiolib: Handle immutable irq_chip structures Andy Shevchenko
2022-04-08 11:35   ` Andy Shevchenko
2022-04-18 19:38 ` Bartosz Golaszewski
2022-04-18 19:38   ` Bartosz Golaszewski
2022-04-19 21:56 ` Linus Walleij [this message]
2022-04-19 21:56   ` Linus Walleij

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='CACRpkdbdo=Es8VU_td6S3LCVCsYpcWC=pW1SGDXEAe2Gp8uZcA@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=Basavaraj.Natikar@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=agross@kernel.org \
    --cc=alyssa@rosenzweig.io \
    --cc=bjorn.andersson@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=jeffrey.l.hugo@gmail.com \
    --cc=joey.gouly@arm.com \
    --cc=jonathanh@nvidia.com \
    --cc=kernel-team@android.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=maz@kernel.org \
    --cc=sven@svenpeter.dev \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    /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.