Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 6.1 36/38] platform/x86: touchscreen_dmi: Add Chuwi Vi8 (CWI501) DMI match
From: Sasha Levin @ 2023-02-09 11:14 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Hans de Goede, Sasha Levin, markgross, linux-input,
	platform-driver-x86
In-Reply-To: <20230209111459.1891941-1-sashal@kernel.org>

From: Hans de Goede <hdegoede@redhat.com>

[ Upstream commit eecf2acd4a580e9364e5087daf0effca60a240b7 ]

Add a DMI match for the CWI501 version of the Chuwi Vi8 tablet,
pointing to the same chuwi_vi8_data as the existing CWI506 version
DMI match.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230202103413.331459-1-hdegoede@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/platform/x86/touchscreen_dmi.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/platform/x86/touchscreen_dmi.c b/drivers/platform/x86/touchscreen_dmi.c
index f00995390fdfe..13802a3c3591d 100644
--- a/drivers/platform/x86/touchscreen_dmi.c
+++ b/drivers/platform/x86/touchscreen_dmi.c
@@ -1097,6 +1097,15 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
 			DMI_MATCH(DMI_BIOS_DATE, "05/07/2016"),
 		},
 	},
+	{
+		/* Chuwi Vi8 (CWI501) */
+		.driver_data = (void *)&chuwi_vi8_data,
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "i86"),
+			DMI_MATCH(DMI_BIOS_VERSION, "CHUWI.W86JLBNR01"),
+		},
+	},
 	{
 		/* Chuwi Vi8 (CWI506) */
 		.driver_data = (void *)&chuwi_vi8_data,
-- 
2.39.0


^ permalink raw reply related

* Re: [PATCH v4 02/18] ARM: s3c24xx: Use the right include
From: Linus Walleij @ 2023-02-09 10:45 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Andy Shevchenko, Arnd Bergmann, Bartosz Golaszewski,
	Tony Lindgren, Thomas Gleixner, Geert Uytterhoeven,
	Michael Ellerman, Christophe Leroy, Vincenzo Palazzo,
	Devarsh Thakkar, Michael Walle, Dmitry Torokhov, Dipen Patel,
	Thierry Reding, Stefan Schmidt, Miquel Raynal, Lee Jones,
	linux-gpio, linux-doc, linux-kernel, linux-doc-tw-discuss,
	linux-arm-kernel, linux-omap, linux-samsung-soc, linux-m68k,
	linuxppc-dev, linux-sh, linux-acpi, linux-tegra, linux-input,
	linux-media, linux-wpan, netdev, linux-wireless,
	brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, linux-arch,
	devicetree, Bartosz Golaszewski, Jonathan Corbet, Alex Shi,
	Yanteng Si, Hu Haowen, Russell King, Aaro Koskinen,
	Janusz Krzysztofik, Andrew Lunn, Sebastian Hesselbarth,
	Gregory Clement, Alim Akhtar, Nicholas Piggin, Yoshinori Sato,
	Rich Felker, Mun Yew Tham, Keerthy, Mika Westerberg,
	Thierry Reding, Jonathan Hunter, Mauro Carvalho Chehab,
	Alexander Aring, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Arend van Spriel, Franky Lin, Hante Meuleman,
	Kalle Valo, Qiang Zhao, Li Yang, Rob Herring, Frank Rowand
In-Reply-To: <30234963-33e5-e2d7-a6ef-112e89efbdd0@linaro.org>

On Wed, Feb 8, 2023 at 6:39 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:

> On 08/02/2023 18:33, Andy Shevchenko wrote:
> > From: Linus Walleij <linus.walleij@linaro.org>
> >
> > The file s3c64xx.c is including <linux/gpio.h> despite using no
> > symbols from the file, however it needs it to implicitly bring in
> > of_have_populated_dt() so include <linux/of.h> explicitly instead.
> >
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> >  arch/arm/mach-s3c/s3c64xx.c | 2 +-
>
> It's not s3c24xx anymore, so subject prefix:
> ARM: s3c64xx:

My mistake, mea culpa.

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH v4 18/18] gpiolib: Clean up headers
From: Linus Walleij @ 2023-02-09 10:44 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Arnd Bergmann, Bartosz Golaszewski, Tony Lindgren,
	Thomas Gleixner, Krzysztof Kozlowski, Geert Uytterhoeven,
	Michael Ellerman, Christophe Leroy, Vincenzo Palazzo,
	Devarsh Thakkar, Michael Walle, Dmitry Torokhov, Dipen Patel,
	Thierry Reding, Stefan Schmidt, Miquel Raynal, Lee Jones,
	linux-gpio, linux-doc, linux-kernel, linux-doc-tw-discuss,
	linux-arm-kernel, linux-omap, linux-samsung-soc, linux-m68k,
	linuxppc-dev, linux-sh, linux-acpi, linux-tegra, linux-input,
	linux-media, linux-wpan, netdev, linux-wireless,
	brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, linux-arch,
	devicetree, Bartosz Golaszewski, Jonathan Corbet, Alex Shi,
	Yanteng Si, Hu Haowen, Russell King, Aaro Koskinen,
	Janusz Krzysztofik, Andrew Lunn, Sebastian Hesselbarth,
	Gregory Clement, Alim Akhtar, Nicholas Piggin, Yoshinori Sato,
	Rich Felker, Mun Yew Tham, Keerthy, Mika Westerberg,
	Thierry Reding, Jonathan Hunter, Mauro Carvalho Chehab,
	Alexander Aring, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Arend van Spriel, Franky Lin, Hante Meuleman,
	Kalle Valo, Qiang Zhao, Li Yang, Rob Herring, Frank Rowand
In-Reply-To: <20230208173343.37582-19-andriy.shevchenko@linux.intel.com>

On Wed, Feb 8, 2023 at 6:34 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> There is a few things done:
> - include only the headers we are direct user of
> - when pointer is in use, provide a forward declaration
> - add missing headers
> - group generic headers and subsystem headers
> - sort each group alphabetically
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH v4 13/18] gpio: reg: Add missing header(s)
From: Linus Walleij @ 2023-02-09 10:43 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Arnd Bergmann, Bartosz Golaszewski, Tony Lindgren,
	Thomas Gleixner, Krzysztof Kozlowski, Geert Uytterhoeven,
	Michael Ellerman, Christophe Leroy, Vincenzo Palazzo,
	Devarsh Thakkar, Michael Walle, Dmitry Torokhov, Dipen Patel,
	Thierry Reding, Stefan Schmidt, Miquel Raynal, Lee Jones,
	linux-gpio, linux-doc, linux-kernel, linux-doc-tw-discuss,
	linux-arm-kernel, linux-omap, linux-samsung-soc, linux-m68k,
	linuxppc-dev, linux-sh, linux-acpi, linux-tegra, linux-input,
	linux-media, linux-wpan, netdev, linux-wireless,
	brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, linux-arch,
	devicetree, Bartosz Golaszewski, Jonathan Corbet, Alex Shi,
	Yanteng Si, Hu Haowen, Russell King, Aaro Koskinen,
	Janusz Krzysztofik, Andrew Lunn, Sebastian Hesselbarth,
	Gregory Clement, Alim Akhtar, Nicholas Piggin, Yoshinori Sato,
	Rich Felker, Mun Yew Tham, Keerthy, Mika Westerberg,
	Thierry Reding, Jonathan Hunter, Mauro Carvalho Chehab,
	Alexander Aring, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Arend van Spriel, Franky Lin, Hante Meuleman,
	Kalle Valo, Qiang Zhao, Li Yang, Rob Herring, Frank Rowand
In-Reply-To: <20230208173343.37582-14-andriy.shevchenko@linux.intel.com>

On Wed, Feb 8, 2023 at 6:34 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> Do not imply that some of the generic headers may be always included.
> Instead, include explicitly what we are direct user of.
>
> While at it, split out the GPIO group of headers.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH v4 12/18] gpio: aggregator: Add missing header(s)
From: Linus Walleij @ 2023-02-09 10:43 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Arnd Bergmann, Bartosz Golaszewski, Tony Lindgren,
	Thomas Gleixner, Krzysztof Kozlowski, Geert Uytterhoeven,
	Michael Ellerman, Christophe Leroy, Vincenzo Palazzo,
	Devarsh Thakkar, Michael Walle, Dmitry Torokhov, Dipen Patel,
	Thierry Reding, Stefan Schmidt, Miquel Raynal, Lee Jones,
	linux-gpio, linux-doc, linux-kernel, linux-doc-tw-discuss,
	linux-arm-kernel, linux-omap, linux-samsung-soc, linux-m68k,
	linuxppc-dev, linux-sh, linux-acpi, linux-tegra, linux-input,
	linux-media, linux-wpan, netdev, linux-wireless,
	brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, linux-arch,
	devicetree, Bartosz Golaszewski, Jonathan Corbet, Alex Shi,
	Yanteng Si, Hu Haowen, Russell King, Aaro Koskinen,
	Janusz Krzysztofik, Andrew Lunn, Sebastian Hesselbarth,
	Gregory Clement, Alim Akhtar, Nicholas Piggin, Yoshinori Sato,
	Rich Felker, Mun Yew Tham, Keerthy, Mika Westerberg,
	Thierry Reding, Jonathan Hunter, Mauro Carvalho Chehab,
	Alexander Aring, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Arend van Spriel, Franky Lin, Hante Meuleman,
	Kalle Valo, Qiang Zhao, Li Yang, Rob Herring, Frank Rowand,
	Geert Uytterhoeven
In-Reply-To: <20230208173343.37582-13-andriy.shevchenko@linux.intel.com>

On Wed, Feb 8, 2023 at 6:34 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> Do not imply that some of the generic headers may be always included.
> Instead, include explicitly what we are direct user of.
>
> While at it, drop unused linux/gpio.h and split out the GPIO group of
> headers.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

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

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH v4 17/18] gpiolib: Group forward declarations in consumer.h
From: Linus Walleij @ 2023-02-09 10:42 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Arnd Bergmann, Bartosz Golaszewski, Tony Lindgren,
	Thomas Gleixner, Krzysztof Kozlowski, Geert Uytterhoeven,
	Michael Ellerman, Christophe Leroy, Vincenzo Palazzo,
	Devarsh Thakkar, Michael Walle, Dmitry Torokhov, Dipen Patel,
	Thierry Reding, Stefan Schmidt, Miquel Raynal, Lee Jones,
	linux-gpio, linux-doc, linux-kernel, linux-doc-tw-discuss,
	linux-arm-kernel, linux-omap, linux-samsung-soc, linux-m68k,
	linuxppc-dev, linux-sh, linux-acpi, linux-tegra, linux-input,
	linux-media, linux-wpan, netdev, linux-wireless,
	brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, linux-arch,
	devicetree, Bartosz Golaszewski, Jonathan Corbet, Alex Shi,
	Yanteng Si, Hu Haowen, Russell King, Aaro Koskinen,
	Janusz Krzysztofik, Andrew Lunn, Sebastian Hesselbarth,
	Gregory Clement, Alim Akhtar, Nicholas Piggin, Yoshinori Sato,
	Rich Felker, Mun Yew Tham, Keerthy, Mika Westerberg,
	Thierry Reding, Jonathan Hunter, Mauro Carvalho Chehab,
	Alexander Aring, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Arend van Spriel, Franky Lin, Hante Meuleman,
	Kalle Valo, Qiang Zhao, Li Yang, Rob Herring, Frank Rowand
In-Reply-To: <20230208173343.37582-18-andriy.shevchenko@linux.intel.com>

On Wed, Feb 8, 2023 at 6:34 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> For better maintenance group the forward declarations together.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH v4 16/18] gpiolib: Deduplicate forward declarations in consumer.h
From: Linus Walleij @ 2023-02-09 10:42 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Arnd Bergmann, Bartosz Golaszewski, Tony Lindgren,
	Thomas Gleixner, Krzysztof Kozlowski, Geert Uytterhoeven,
	Michael Ellerman, Christophe Leroy, Vincenzo Palazzo,
	Devarsh Thakkar, Michael Walle, Dmitry Torokhov, Dipen Patel,
	Thierry Reding, Stefan Schmidt, Miquel Raynal, Lee Jones,
	linux-gpio, linux-doc, linux-kernel, linux-doc-tw-discuss,
	linux-arm-kernel, linux-omap, linux-samsung-soc, linux-m68k,
	linuxppc-dev, linux-sh, linux-acpi, linux-tegra, linux-input,
	linux-media, linux-wpan, netdev, linux-wireless,
	brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, linux-arch,
	devicetree, Bartosz Golaszewski, Jonathan Corbet, Alex Shi,
	Yanteng Si, Hu Haowen, Russell King, Aaro Koskinen,
	Janusz Krzysztofik, Andrew Lunn, Sebastian Hesselbarth,
	Gregory Clement, Alim Akhtar, Nicholas Piggin, Yoshinori Sato,
	Rich Felker, Mun Yew Tham, Keerthy, Mika Westerberg,
	Thierry Reding, Jonathan Hunter, Mauro Carvalho Chehab,
	Alexander Aring, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Arend van Spriel, Franky Lin, Hante Meuleman,
	Kalle Valo, Qiang Zhao, Li Yang, Rob Herring, Frank Rowand
In-Reply-To: <20230208173343.37582-17-andriy.shevchenko@linux.intel.com>

On Wed, Feb 8, 2023 at 6:34 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> The struct fwnode_handle pointer is used in both branches of ifdeffery,
> no need to have a copy of the same in each of them, just make it global.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH v4 14/18] gpio: regmap: Add missing header(s)
From: Linus Walleij @ 2023-02-09 10:41 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Arnd Bergmann, Bartosz Golaszewski, Tony Lindgren,
	Thomas Gleixner, Krzysztof Kozlowski, Geert Uytterhoeven,
	Michael Ellerman, Christophe Leroy, Vincenzo Palazzo,
	Devarsh Thakkar, Michael Walle, Dmitry Torokhov, Dipen Patel,
	Thierry Reding, Stefan Schmidt, Miquel Raynal, Lee Jones,
	linux-gpio, linux-doc, linux-kernel, linux-doc-tw-discuss,
	linux-arm-kernel, linux-omap, linux-samsung-soc, linux-m68k,
	linuxppc-dev, linux-sh, linux-acpi, linux-tegra, linux-input,
	linux-media, linux-wpan, netdev, linux-wireless,
	brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, linux-arch,
	devicetree, Bartosz Golaszewski, Jonathan Corbet, Alex Shi,
	Yanteng Si, Hu Haowen, Russell King, Aaro Koskinen,
	Janusz Krzysztofik, Andrew Lunn, Sebastian Hesselbarth,
	Gregory Clement, Alim Akhtar, Nicholas Piggin, Yoshinori Sato,
	Rich Felker, Mun Yew Tham, Keerthy, Mika Westerberg,
	Thierry Reding, Jonathan Hunter, Mauro Carvalho Chehab,
	Alexander Aring, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Arend van Spriel, Franky Lin, Hante Meuleman,
	Kalle Valo, Qiang Zhao, Li Yang, Rob Herring, Frank Rowand
In-Reply-To: <20230208173343.37582-15-andriy.shevchenko@linux.intel.com>

On Wed, Feb 8, 2023 at 6:34 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> Do not imply that some of the generic headers may be always included.
> Instead, include explicitly what we are direct user of.
>
> While at it, split out the GPIO group of headers.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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

Yours,
Linus Walleij

^ permalink raw reply

* Re: remove arch/sh
From: John Paul Adrian Glaubitz @ 2023-02-09  9:15 UTC (permalink / raw)
  To: Rob Landley, Randy Dunlap, Christoph Hellwig
  Cc: Yoshinori Sato, Rich Felker, Arnd Bergmann, Greg Kroah-Hartman,
	Laurent Pinchart, Kieran Bingham, Geert Uytterhoeven,
	linux-kernel, linux-watchdog, devicetree, linux-arch, dmaengine,
	dri-devel, linux-renesas-soc, linux-i2c, linux-input, linux-media,
	linux-mmc, linux-mtd, netdev, linux-gpio, linux-rtc, linux-spi,
	linux-serial, linux-usb, linux-fbdev, alsa-devel, linux-sh
In-Reply-To: <1c6e7a19-a650-1852-6f74-ca5547db44c4@landley.net>

On Wed, 2023-02-08 at 21:09 -0600, Rob Landley wrote:
> > Geert has suggested to wait with adding a tree source to the entry until I get my
> > own kernel.org account. I have enough GPG signatures from multiple kernel developers
> > on my GPG key, so I think it shouldn't be too difficult to qualify for an account.
> 
> So you're not planning to use https://lk.j-core.org/J-Core-Developers/sh-linux
> but push to kernel.org and ask Linus to pull from there?

Yes, that's what Geert recommended.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply

* Re: [PATCH v2 3/5] HID: dualsense_remove: manually unregister leds
From: Benjamin Tissoires @ 2023-02-09  8:59 UTC (permalink / raw)
  To: Pietro Borrello
  Cc: Jiri Kosina, Hanno Zulla, Pavel Machek, Lee Jones,
	Roderick Colenbrander, Sven Eckelmann, linux-leds,
	Cristiano Giuffrida, Bos, H.J., Jakob Koschel, linux-input,
	linux-kernel, Jiri Kosina, Roderick Colenbrander
In-Reply-To: <20230125-hid-unregister-leds-v2-3-689cc62fc878@diag.uniroma1.it>

On Jan 31 2023, Pietro Borrello wrote:
> Unregister the LED controllers before device removal, to prevent
> unnecessary runs of dualsense_player_led_set_brightness().
> 
> Fixes: 8c0ab553b072 ("HID: playstation: expose DualSense player LEDs through LED class.")
> Signed-off-by: Pietro Borrello <borrello@diag.uniroma1.it>
> 
> ---
> 
> Contrary to the other patches in this series, failing to unregister
> the led controller does not results into a use-after-free thanks
> to the output_worker_initialized variable and the spinlock checks.

And so we don't need that patch (nor for hid-sony.c) because we have a
guard against scheduling a worker job when the device is being removed.

So please drop 3,4,5 from this series, they are just making the code
worse.

Cheers,
Benjamin

> 
> Changes in v2:
> - Unregister multicolor led controller
> - Clarify UAF
> - Link to v1: https://lore.kernel.org/all/20230125-hid-unregister-leds-v1-3-9a5192dcef16@diag.uniroma1.it/
> ---
>  drivers/hid/hid-playstation.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
> index 27c40894acab..f23186ca2d76 100644
> --- a/drivers/hid/hid-playstation.c
> +++ b/drivers/hid/hid-playstation.c
> @@ -1503,11 +1503,17 @@ static void dualsense_remove(struct ps_device *ps_dev)
>  {
>  	struct dualsense *ds = container_of(ps_dev, struct dualsense, base);
>  	unsigned long flags;
> +	int i;
>  
>  	spin_lock_irqsave(&ds->base.lock, flags);
>  	ds->output_worker_initialized = false;
>  	spin_unlock_irqrestore(&ds->base.lock, flags);
>  
> +	for (i = 0; i < ARRAY_SIZE(ds->player_leds); i++)
> +		devm_led_classdev_unregister(&ps_dev->hdev->dev, &ds->player_leds[i]);
> +
> +	devm_led_classdev_multicolor_unregister(&ps_dev->hdev->dev, &ds->lightbar);
> +
>  	cancel_work_sync(&ds->output_worker);
>  }
>  
> 
> -- 
> 2.25.1


^ permalink raw reply

* Re: [PATCH v2 1/5] HID: bigben_remove: manually unregister leds
From: Benjamin Tissoires @ 2023-02-09  8:55 UTC (permalink / raw)
  To: Pietro Borrello
  Cc: Jiri Kosina, Hanno Zulla, Pavel Machek, Lee Jones,
	Roderick Colenbrander, Sven Eckelmann, linux-leds,
	Cristiano Giuffrida, Bos, H.J., Jakob Koschel, linux-input,
	linux-kernel, Jiri Kosina, Roderick Colenbrander
In-Reply-To: <20230125-hid-unregister-leds-v2-1-689cc62fc878@diag.uniroma1.it>

Hi Pietro,

On Jan 31 2023, Pietro Borrello wrote:
> Unregister the LED controllers before device removal, as
> bigben_set_led() may schedule bigben->worker after the structure has
> been freed, causing a use-after-free.
> 
> Fixes: 4eb1b01de5b9 ("HID: hid-bigbenff: fix race condition for scheduled work during removal")
> Signed-off-by: Pietro Borrello <borrello@diag.uniroma1.it>
> ---
>  drivers/hid/hid-bigbenff.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/hid/hid-bigbenff.c b/drivers/hid/hid-bigbenff.c
> index e8b16665860d..d3201b755595 100644
> --- a/drivers/hid/hid-bigbenff.c
> +++ b/drivers/hid/hid-bigbenff.c
> @@ -306,9 +306,14 @@ static enum led_brightness bigben_get_led(struct led_classdev *led)
>  
>  static void bigben_remove(struct hid_device *hid)
>  {
> +	int n;
>  	struct bigben_device *bigben = hid_get_drvdata(hid);
>  
>  	bigben->removed = true;
> +	for (n = 0; n < NUM_LEDS; n++) {
> +		if (bigben->leds[n])
> +			devm_led_classdev_unregister(&hid->dev, bigben->leds[n]);
> +	}
>  	cancel_work_sync(&bigben->worker);

I don't think this is the correct fix. It would seem that we are
suddenly making the assumption that the devm mechanism would do things
in the wrong order, when the devm_led_classdev_unregister() should be
called *before* the devm_free() of the struct bigben_device.

However, you can trigger a bug, and thus we can analyse a little bit
further what is happening:

* user calls a function on the LED
* bigben_set_led() is called
* .remove() is being called at roughly the same time:
  - bigben->removed is set to true
  - cancel_work_sync() is called
* at that point, bigben_set_led() can not crash because
  led_classdev_unregister() flushes all of its workers, and thus
  prevents the call for dev_kfree(struct bigben_device)
* but now bigben_set_led() calls schedule_work()
* led_classdev_unregister() is now done and devm_kfree() is called for
  struct bigben_device
* now the led worker kicks in, and tries to access struct bigben_device
  and derefences it to get the value of bigben->removed (and
  bigben->report), which crashes.

So without your patch, the problem seems to be that we call a
schedule_work *after* we set bigben->removed to true and we call
cancel_work_sync().

And if you look at the hid-playstation driver, you'll see that the
schedule_work() call is encapsulated in a spinlock and a check to
ds->output_worker_initialized.

And this is why you can not reproduce on the hid-playstation driver,
because it is guarded against scheduling a worker when the driver is
being removed.

I think I prefer a lot more the playstation solution: having to manually
call a devm_release_free always feels wrong in a normal path. And also
by doing so, you might paper another problem that might happen on an
error path in probe for instance. Also, this means that the pattern you
saw is specific to some drivers, not all depending on how they make use
of workers.

Would you mind respinning that series with those comments?

Cheers,
Benjamin


>  	hid_hw_stop(hid);
>  }
> 
> -- 
> 2.25.1


^ permalink raw reply

* [PATCH 00/24 v2] Documentation: correct lots of spelling errors (series 1)
From: Randy Dunlap @ 2023-02-09  7:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Jonathan Corbet, Russell King, Jens Axboe,
	Vladimir Oltean, Steffen Klassert, Daniel Jordan, Akinobu Mita,
	Helge Deller, Dmitry Torokhov, Henrik Rydberg, Karsten Keil,
	Jiri Kosina, Miroslav Benes, Petr Mladek, Josh Poimboeuf,
	Peter Zijlstra, Ingo Molnar, Will Deacon, Jérôme Glisse,
	Naoya Horiguchi, Miaohe Lin, Jonas Bonn, Stefan Kristiansson,
	Stafford Horne, Bjorn Helgaas, Lorenzo Pieralisi, Marc Zyngier,
	Michael Ellerman, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Juri Lelli, Vincent Guittot, David Howells,
	Jarkko Sakkinen, Paul Moore, James Morris, Serge E. Hallyn,
	Daniel Bristot de Oliveira, Steven Rostedt, Masami Hiramatsu,
	Mathieu Poirier, Suzuki K Poulose, Evgeniy Polyakov, Fenghua Yu,
	Reinette Chatre, Thomas Gleixner, Borislav Petkov, Chris Zankel,
	Max Filippov, coresight, dri-devel, keyrings, linux-block,
	linux-crypto, linux-doc, linux-fbdev, linux-input, linux-pci,
	linux-s390, linux-scsi, linux-sgx, linux-trace-devel,
	linux-trace-kernel, live-patching, linux-security-module,
	linux-usb, netdev, linux-mm, openrisc, linux-arm-kernel,
	linux-xtensa, linuxppc-dev, x86

Correct many spelling errors in Documentation/ as reported by codespell.

Maintainers of specific kernel subsystems are only Cc-ed on their
respective patches, not the entire series.

These patches are based on linux-next-20230209.


 [PATCH 01/24] Documentation: arm: correct spelling
 [PATCH 02/24] Documentation: block: correct spelling
 [PATCH 03/24] Documentation: core-api: correct spelling
 [PATCH 04/24] Documentation: fault-injection: correct spelling
 [PATCH 05/24] Documentation: fb: correct spelling
 [PATCH 06/24] Documentation: features: correct spelling
 [PATCH 07/24] Documentation: input: correct spelling
 [PATCH 08/24] Documentation: isdn: correct spelling
 [PATCH 09/24] Documentation: livepatch: correct spelling
 [PATCH 10/24] Documentation: locking: correct spelling
 [PATCH 11/24] Documentation: mm: correct spelling
 [PATCH 12/24] Documentation: openrisc: correct spelling
 [PATCH 13/24] Documentation: PCI: correct spelling
 [PATCH 14/24] Documentation: powerpc: correct spelling
 [PATCH 15/24] Documentation: s390: correct spelling
 [PATCH 16/24] Documentation: scheduler: correct spelling
 [PATCH 17/24] Documentation: security: correct spelling
 [PATCH 18/24] Documentation: timers: correct spelling
 [PATCH 19/24] Documentation: tools/rtla: correct spelling
 [PATCH 20/24] Documentation: trace/rv: correct spelling
 [PATCH 21/24] Documentation: trace: correct spelling
 [PATCH 22/24] Documentation: w1: correct spelling
 [PATCH 23/24] Documentation: x86: correct spelling
 [PATCH 24/24] Documentation: xtensa: correct spelling


diffstat:
 Documentation/PCI/endpoint/pci-vntb-howto.rst                    |    2 +-
 Documentation/PCI/msi-howto.rst                                  |    2 +-
 Documentation/arm/arm.rst                                        |    2 +-
 Documentation/arm/ixp4xx.rst                                     |    4 ++--
 Documentation/arm/keystone/knav-qmss.rst                         |    2 +-
 Documentation/arm/stm32/stm32-dma-mdma-chaining.rst              |    6 +++---
 Documentation/arm/sunxi/clocks.rst                               |    2 +-
 Documentation/arm/swp_emulation.rst                              |    2 +-
 Documentation/arm/tcm.rst                                        |    2 +-
 Documentation/arm/vlocks.rst                                     |    2 +-
 Documentation/block/data-integrity.rst                           |    2 +-
 Documentation/core-api/packing.rst                               |    2 +-
 Documentation/core-api/padata.rst                                |    2 +-
 Documentation/fault-injection/fault-injection.rst                |    2 +-
 Documentation/fb/sm712fb.rst                                     |    2 +-
 Documentation/fb/sstfb.rst                                       |    2 +-
 Documentation/features/core/thread-info-in-task/arch-support.txt |    2 +-
 Documentation/input/devices/iforce-protocol.rst                  |    2 +-
 Documentation/input/multi-touch-protocol.rst                     |    2 +-
 Documentation/isdn/interface_capi.rst                            |    2 +-
 Documentation/isdn/m_isdn.rst                                    |    2 +-
 Documentation/livepatch/reliable-stacktrace.rst                  |    2 +-
 Documentation/locking/lockdep-design.rst                         |    4 ++--
 Documentation/locking/locktorture.rst                            |    2 +-
 Documentation/locking/locktypes.rst                              |    2 +-
 Documentation/locking/preempt-locking.rst                        |    2 +-
 Documentation/mm/hmm.rst                                         |    4 ++--
 Documentation/mm/hwpoison.rst                                    |    2 +-
 Documentation/openrisc/openrisc_port.rst                         |    4 ++--
 Documentation/power/suspend-and-interrupts.rst                   |    2 +-
 Documentation/powerpc/kasan.txt                                  |    2 +-
 Documentation/powerpc/papr_hcalls.rst                            |    2 +-
 Documentation/powerpc/qe_firmware.rst                            |    4 ++--
 Documentation/powerpc/vas-api.rst                                |    4 ++--
 Documentation/s390/pci.rst                                       |    4 ++--
 Documentation/s390/vfio-ccw.rst                                  |    2 +-
 Documentation/scheduler/sched-bwc.rst                            |    2 +-
 Documentation/scheduler/sched-energy.rst                         |    4 ++--
 Documentation/security/digsig.rst                                |    4 ++--
 Documentation/security/keys/core.rst                             |    2 +-
 Documentation/security/secrets/coco.rst                          |    2 +-
 Documentation/timers/hrtimers.rst                                |    2 +-
 Documentation/tools/rtla/rtla-timerlat-top.rst                   |    2 +-
 Documentation/trace/coresight/coresight-etm4x-reference.rst      |    2 +-
 Documentation/trace/events.rst                                   |    6 +++---
 Documentation/trace/fprobe.rst                                   |    2 +-
 Documentation/trace/ftrace-uses.rst                              |    2 +-
 Documentation/trace/hwlat_detector.rst                           |    2 +-
 Documentation/trace/rv/runtime-verification.rst                  |    2 +-
 Documentation/trace/uprobetracer.rst                             |    2 +-
 Documentation/w1/w1-netlink.rst                                  |    2 +-
 Documentation/x86/boot.rst                                       |    2 +-
 Documentation/x86/buslock.rst                                    |    2 +-
 Documentation/x86/mds.rst                                        |    2 +-
 Documentation/x86/resctrl.rst                                    |    2 +-
 Documentation/x86/sgx.rst                                        |    2 +-
 Documentation/xtensa/atomctl.rst                                 |    2 +-
 57 files changed, 70 insertions(+), 70 deletions(-)


Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Vladimir Oltean <olteanv@gmail.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Daniel Jordan <daniel.m.jordan@oracle.com>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Helge Deller <deller@gmx.de>
?Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Henrik Rydberg <rydberg@bitmath.org>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Miroslav Benes <mbenes@suse.cz>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Will Deacon <will@kernel.org>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Paul Moore <paul@paul-moore.com>
Cc: James Morris <jmorris@namei.org>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>

Cc: coresight@lists.linaro.org
Cc: dri-devel@lists.freedesktop.org
Cc: keyrings@vger.kernel.org
Cc: linux-block@vger.kernel.org
Cc: linux-crypto@vger.kernel.org
Cc: linux-doc@vger.kernel.org
Cc: linux-fbdev@vger.kernel.org
Cc: linux-input@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: linux-scsi@vger.kernel.org
Cc: linux-sgx@vger.kernel.org
Cc: linux-trace-devel@vger.kernel.org
Cc: linux-trace-kernel@vger.kernel.org
Cc: live-patching@vger.kernel.org
Cc: linux-security-module@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: openrisc@lists.librecores.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-xtensa@linux-xtensa.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: x86@kernel.org

^ permalink raw reply

* [PATCH 07/24] Documentation: input: correct spelling
From: Randy Dunlap @ 2023-02-09  7:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Dmitry Torokhov, Henrik Rydberg, linux-input,
	Jonathan Corbet, linux-doc
In-Reply-To: <20230209071400.31476-1-rdunlap@infradead.org>

Correct spelling problems for Documentation/input/ as reported
by codespell.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Henrik Rydberg <rydberg@bitmath.org>
Cc: linux-input@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
---
 Documentation/input/devices/iforce-protocol.rst |    2 +-
 Documentation/input/multi-touch-protocol.rst    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff -- a/Documentation/input/devices/iforce-protocol.rst b/Documentation/input/devices/iforce-protocol.rst
--- a/Documentation/input/devices/iforce-protocol.rst
+++ b/Documentation/input/devices/iforce-protocol.rst
@@ -49,7 +49,7 @@ OP DATA
 == ====
 
 The 2B, LEN and CS fields have disappeared, probably because USB handles
-frames and data corruption is handled or unsignificant.
+frames and data corruption is handled or insignificant.
 
 First, I describe effects that are sent by the device to the computer
 
diff -- a/Documentation/input/multi-touch-protocol.rst b/Documentation/input/multi-touch-protocol.rst
--- a/Documentation/input/multi-touch-protocol.rst
+++ b/Documentation/input/multi-touch-protocol.rst
@@ -383,7 +383,7 @@ Finger Tracking
 ---------------
 
 The process of finger tracking, i.e., to assign a unique trackingID to each
-initiated contact on the surface, is a Euclidian Bipartite Matching
+initiated contact on the surface, is a Euclidean Bipartite Matching
 problem.  At each event synchronization, the set of actual contacts is
 matched to the set of contacts from the previous synchronization. A full
 implementation can be found in [#f3]_.

^ permalink raw reply

* Re: (subset) [PATCH 0/7] arm: qcom: Fix touchscreen voltage for sc7280-herobrine boards
From: Bjorn Andersson @ 2023-02-09  4:22 UTC (permalink / raw)
  To: Douglas Anderson, Jiri Kosina, Rob Herring, Benjamin Tissoires,
	Krzysztof Kozlowski
  Cc: Andy Gross, Stephen Kitt, Dmitry Torokhov, linux-input,
	Konrad Dybcio, devicetree, linux-kernel, linux-arm-msm
In-Reply-To: <20230207024816.525938-1-dianders@chromium.org>

On Mon, 6 Feb 2023 18:48:09 -0800, Douglas Anderson wrote:
> Trying to figure out how to talk to the touchscreen properly on
> sc7280-herobrine boards was a long and difficult process. Many
> Engineering hours were spent deciding how exactly one should talk over
> i2c to a peripheral. In the end, a solution has been found and this
> patch series attempts to implement it in a way that will work for all
> herobrine-based boards.
> 
> [...]

Applied, thanks!

[1/7] arm64: dts: qcom: sc7280: On QCard, regulator L3C should be 1.8V
      commit: 428df177013bad1a0a062878e3d5224122b7a5fe
[2/7] arm64: dts: qcom: sc7280: Add 3ms ramp to herobrine's pp3300_left_in_mlb
      commit: 4261cea17a2f5e0ec78eb3ceebb68dddb918aee9
[3/7] arm64: dts: qcom: sc7280: Hook up the touchscreen IO rail on villager
      commit: d90b98f5702dccc41a5885b65361573654fcaabf
[7/7] arm64: dts: qcom: sc7280: Hook up the touchscreen IO rail on evoker
      commit: ef29188fe0b4de5c04b833378db92d3a3e0709e8

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply

* [PATCH] Input: synaptics-rmi4 -  Modify mismatched function name
From: Jiapeng Chong @ 2023-02-09  4:07 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, linux-kernel, Jiapeng Chong, Abaci Robot

No functional modification involved.

drivers/input/rmi4/rmi_bus.c:300: warning: expecting prototype for rmi_register_function_handler(). Prototype was for __rmi_register_function_handler() instead.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4012
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/input/rmi4/rmi_bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/rmi4/rmi_bus.c b/drivers/input/rmi4/rmi_bus.c
index 50a0134b6901..f2e093b0b998 100644
--- a/drivers/input/rmi4/rmi_bus.c
+++ b/drivers/input/rmi4/rmi_bus.c
@@ -285,7 +285,7 @@ void rmi_unregister_function(struct rmi_function *fn)
 }
 
 /**
- * rmi_register_function_handler - register a handler for an RMI function
+ * __rmi_register_function_handler - register a handler for an RMI function
  * @handler: RMI handler that should be registered.
  * @owner: pointer to module that implements the handler
  * @mod_name: name of the module implementing the handler
-- 
2.20.1.7.g153144c


^ permalink raw reply related

* Re: remove arch/sh
From: Rob Landley @ 2023-02-09  3:09 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz, Randy Dunlap, Christoph Hellwig
  Cc: Yoshinori Sato, Rich Felker, Arnd Bergmann, Greg Kroah-Hartman,
	Laurent Pinchart, Kieran Bingham, Geert Uytterhoeven,
	linux-kernel, linux-watchdog, devicetree, linux-arch, dmaengine,
	dri-devel, linux-renesas-soc, linux-i2c, linux-input, linux-media,
	linux-mmc, linux-mtd, netdev, linux-gpio, linux-rtc, linux-spi,
	linux-serial, linux-usb, linux-fbdev, alsa-devel, linux-sh
In-Reply-To: <f6317e9073362b13b10df57de23e63945becea32.camel@physik.fu-berlin.de>

On 2/8/23 06:13, John Paul Adrian Glaubitz wrote:
> Hi Randy!
> 
> On Tue, 2023-02-07 at 17:31 -0800, Randy Dunlap wrote:
>> 
>> On 2/7/23 01:06, John Paul Adrian Glaubitz wrote:
>> > Hello Christoph!
>> > 
>> > On Fri, 2023-02-03 at 08:14 +0100, Christoph Hellwig wrote:
>> > > On Mon, Jan 16, 2023 at 09:52:10AM +0100, John Paul Adrian Glaubitz wrote:
>> > > > We have had a discussion between multiple people invested in the SuperH port and
>> > > > I have decided to volunteer as a co-maintainer of the port to support Rich Felker
>> > > > when he isn't available.
>> > > 
>> > > So, this still isn't reflected in MAINTAINERS in linux-next.  When
>> > > do you plan to take over?  What platforms will remain supported and
>> > > what can we start dropping due to being unused and unmaintained?
>> > 
>> > I'm getting everything ready now with Geert's help and I have a probably dumb
>> > question regarding the MAINTAINERS file change: Shall I just add myself as an
>> > additional maintainer first or shall I also drop Yoshinori Sato?
>> > 
>> > Also, is it desirable to add a "T:" entry for the kernel tree?
>> 
>> Yes, definitely.
> 
> Geert has suggested to wait with adding a tree source to the entry until I get my
> own kernel.org account. I have enough GPG signatures from multiple kernel developers
> on my GPG key, so I think it shouldn't be too difficult to qualify for an account.

So you're not planning to use https://lk.j-core.org/J-Core-Developers/sh-linux
but push to kernel.org and ask Linus to pull from there?

> Adrian

Rob

^ permalink raw reply

* Re: remove arch/sh
From: Rob Landley @ 2023-02-09  3:06 UTC (permalink / raw)
  To: Randy Dunlap, Geert Uytterhoeven, John Paul Adrian Glaubitz
  Cc: Christoph Hellwig, Yoshinori Sato, Rich Felker, Arnd Bergmann,
	Greg Kroah-Hartman, Laurent Pinchart, Kieran Bingham,
	Geert Uytterhoeven, linux-kernel, linux-watchdog, devicetree,
	linux-arch, dmaengine, dri-devel, linux-renesas-soc, linux-i2c,
	linux-input, linux-media, linux-mmc, linux-mtd, netdev,
	linux-gpio, linux-rtc, linux-spi, linux-serial, linux-usb,
	linux-fbdev, alsa-devel, linux-sh
In-Reply-To: <f6a60193-a5d1-c42c-158a-4b0bfe9c7538@infradead.org>

On 2/3/23 09:57, Randy Dunlap wrote:
> Hi--
> 
> On 2/3/23 02:33, Geert Uytterhoeven wrote:
>> Hi Adrian,
>> 
>> On Fri, Feb 3, 2023 at 11:29 AM John Paul Adrian Glaubitz
>> <glaubitz@physik.fu-berlin.de> wrote:
>>> On Fri, 2023-02-03 at 09:30 +0100, Christoph Hellwig wrote:
>>>> On Fri, Feb 03, 2023 at 09:24:46AM +0100, John Paul Adrian Glaubitz wrote:
>>>>> Since this is my very first time stepping up as a kernel maintainer, I was hoping
>>>>> to get some pointers on what to do to make this happen.
>>>>>
>>>>> So far, we have set up a new kernel tree and I have set up a local development and
>>>>> test environment for SH kernels using my SH7785LCR board as the target platform.
>>>>>
>>>>> Do I just need to send a patch asking to change the corresponding entry in the
>>>>> MAINTAINERS file?
>>>>
>>>> I'm not sure a there is a document, but:
>>>>
>>>>  - add the MAINTAINERS change to your tree
>>>>  - ask Stephen to get your tree included in linux-next
>>>>
>>>> then eventually send a pull request to Linus with all of that.  Make
>>>> sure it's been in linux-next for a while.
>>>
>>> OK, thanks for the pointers! Will try to get this done by next week.
>>>
>>> We're still discussing among SuperH developer community whether there will be a second
>>> maintainer, so please bear with us a few more days. I will collect patches in the
>>> meantime.
>> 
>> Thanks a lot!
>> 
>> If you need any help with process, setup, ... don't hesitate to ask
>> (on e.g. #renesas-soc on Libera).
> 
> While Adrian and Geert are reading this, I have a question:
> 
> Is this "sh64" still accurate and applicable?

I hadn't noticed it was there... Randy Dunlap added that in 2018 (commit
09b1565324cba). I wonder why?

> from Documentation/kbuild/kbuild.rst:

There isn't an active 64 bit superh architecture for the moment: sh5 was a
prototype that never shipped in volume, and support was removed in commit
37744feebc08. From the j-core side j64 hasn't shipped yet either (still planned
last I heard, but j-core went downmarket first instead due to customer demand,
and multi-issue is on the roadmap before 64 bit address space).

The general trend in linux kernel architectures has been to merge 32 and 64 bit
anyway, and just have the .config set CONFIG_64BIT to distinguish: arch/x86 was
created by merging arch/i386 and arch/x86_64 in 2007, arch/powerpc merged the 32
and 64 bit directories in 2005, arch/s390 and s390x are in the same dir,
arch/mips... (For some reason arm and arm64 are still split, but that might be
fallout from Arm Ltd trying to distinguish aarrcchh6644 from "arm" for some
reason? Dunno.)

I wonder why is this going the other way? I thought $ARCH mostly just specified
the subdirectory under arch/ with a few historical aliases in the top level
Makefile:

# Additional ARCH settings for x86
ifeq ($(ARCH),i386)
        SRCARCH := x86
endif
ifeq ($(ARCH),x86_64)
        SRCARCH := x86
endif

# Additional ARCH settings for sparc
ifeq ($(ARCH),sparc32)
       SRCARCH := sparc
endif
ifeq ($(ARCH),sparc64)
       SRCARCH := sparc
endif

# Additional ARCH settings for parisc
ifeq ($(ARCH),parisc64)
       SRCARCH := parisc
endif

But you could always just specify the correct ARCH directory directly and it
would work. (Always did when I tried it, although I haven't built sparc in years
because there's no musl-libc support, and never built parisc64 because I
couldn't get it to work with uClibc even before musl. I _am_ still building both
32 bit and 64 bit x86 with ARCH=x86 both times...)

> But some architectures such as x86 and sparc have aliases.
> 
> - x86: i386 for 32 bit, x86_64 for 64 bit
> - sh: sh for 32 bit, sh64 for 64 bit <<<<<<<<<<<<<<<
> - sparc: sparc32 for 32 bit, sparc64 for 64 bit

Randy also added the sparc alias in commit 5ba800962a80. That at least exists in
the top level Makefile.

Did he mean parisc64 and typoed sh64? Because that's the only other alias in the
top level Makefile...

In any case, these are historical aliases for old builds, which can probably get
yanked because it should be a trivial fix to use the right ARCH= value for
modern builds? (I'd think?)

You'd even be able to build a 64 bit version of ARCH=i386 just fine if it wasn't
for the ONE place in arch/x86/Kconfig that actually checks:

config 64BIT
        bool "64-bit kernel" if "$(ARCH)" = "x86"
        default "$(ARCH)" != "i386"

Same for arch/sparc/Kconfig:

config 64BIT
        bool "64-bit kernel" if "$(ARCH)" = "sparc"
        default "$(ARCH)" = "sparc64"

Nothing else anywhere seems to care...

> Thanks.

Rob

^ permalink raw reply

* [PATCH] input/misc: hp_sdc_rtc: mark an unused function as __maybe_unused
From: Randy Dunlap @ 2023-02-09  1:01 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, David Howells, Helge Deller, linux-m68k,
	James E.J. Bottomley, linux-parisc, Al Viro, Dmitry Torokhov,
	linux-input

When CONFIG_PROC_FS is not set, one procfs-related function is not
used, causing a build error or warning.
Mark this function as __maybe_unused to quieten the build.

../drivers/input/misc/hp_sdc_rtc.c:268:12: warning: 'hp_sdc_rtc_proc_show' defined but not used [-Wunused-function]
  268 | static int hp_sdc_rtc_proc_show(struct seq_file *m, void *v)
      |            ^~~~~~~~~~~~~~~~~~~~

Fixes: c18bd9a1ff47 ("hp_sdc_rtc: Don't use create_proc_read_entry()")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-m68k@lists.linux-m68k.org
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: linux-parisc@vger.kernel.org
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
---
 drivers/input/misc/hp_sdc_rtc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -- a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c
--- a/drivers/input/misc/hp_sdc_rtc.c
+++ b/drivers/input/misc/hp_sdc_rtc.c
@@ -265,7 +265,7 @@ static inline int hp_sdc_rtc_read_ct(str
 	return 0;
 }
 
-static int hp_sdc_rtc_proc_show(struct seq_file *m, void *v)
+static int __maybe_unused hp_sdc_rtc_proc_show(struct seq_file *m, void *v)
 {
 #define YN(bit) ("no")
 #define NY(bit) ("yes")

^ permalink raw reply

* Re: [PATCH v4 02/18] ARM: s3c24xx: Use the right include
From: Krzysztof Kozlowski @ 2023-02-08 18:02 UTC (permalink / raw)
  To: Andy Shevchenko, Arnd Bergmann, Linus Walleij,
	Bartosz Golaszewski, Tony Lindgren, Thomas Gleixner,
	Geert Uytterhoeven, Michael Ellerman, Christophe Leroy,
	Vincenzo Palazzo, Devarsh Thakkar, Michael Walle, Dmitry Torokhov,
	Dipen Patel, Thierry Reding, Stefan Schmidt, Miquel Raynal,
	Lee Jones, linux-gpio, linux-doc, linux-kernel,
	linux-doc-tw-discuss, linux-arm-kernel, linux-omap,
	linux-samsung-soc, linux-m68k, linuxppc-dev, linux-sh, linux-acpi,
	linux-tegra, linux-input, linux-media, linux-wpan, netdev,
	linux-wireless, brcm80211-dev-list.pdl, SHA-cyfmac-dev-list,
	linux-arch, devicetree
  Cc: Bartosz Golaszewski, Jonathan Corbet, Alex Shi, Yanteng Si,
	Hu Haowen, Russell King, Aaro Koskinen, Janusz Krzysztofik,
	Andrew Lunn, Sebastian Hesselbarth, Gregory Clement, Alim Akhtar,
	Nicholas Piggin, Yoshinori Sato, Rich Felker, Mun Yew Tham,
	Keerthy, Mika Westerberg, Thierry Reding, Jonathan Hunter,
	Mauro Carvalho Chehab, Alexander Aring, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Arend van Spriel,
	Franky Lin, Hante Meuleman, Kalle Valo, Qiang Zhao, Li Yang,
	Rob Herring, Frank Rowand
In-Reply-To: <20230208173343.37582-3-andriy.shevchenko@linux.intel.com>

On 08/02/2023 18:33, Andy Shevchenko wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
> 
> The file s3c64xx.c is including <linux/gpio.h> despite using no
> symbols from the file, however it needs it to implicitly bring in
> of_have_populated_dt() so include <linux/of.h> explicitly instead.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply

* Re: [PATCH v4 02/18] ARM: s3c24xx: Use the right include
From: Krzysztof Kozlowski @ 2023-02-08 17:39 UTC (permalink / raw)
  To: Andy Shevchenko, Arnd Bergmann, Linus Walleij,
	Bartosz Golaszewski, Tony Lindgren, Thomas Gleixner,
	Geert Uytterhoeven, Michael Ellerman, Christophe Leroy,
	Vincenzo Palazzo, Devarsh Thakkar, Michael Walle, Dmitry Torokhov,
	Dipen Patel, Thierry Reding, Stefan Schmidt, Miquel Raynal,
	Lee Jones, linux-gpio, linux-doc, linux-kernel,
	linux-doc-tw-discuss, linux-arm-kernel, linux-omap,
	linux-samsung-soc, linux-m68k, linuxppc-dev, linux-sh, linux-acpi,
	linux-tegra, linux-input, linux-media, linux-wpan, netdev,
	linux-wireless, brcm80211-dev-list.pdl, SHA-cyfmac-dev-list,
	linux-arch, devicetree
  Cc: Bartosz Golaszewski, Jonathan Corbet, Alex Shi, Yanteng Si,
	Hu Haowen, Russell King, Aaro Koskinen, Janusz Krzysztofik,
	Andrew Lunn, Sebastian Hesselbarth, Gregory Clement, Alim Akhtar,
	Nicholas Piggin, Yoshinori Sato, Rich Felker, Mun Yew Tham,
	Keerthy, Mika Westerberg, Thierry Reding, Jonathan Hunter,
	Mauro Carvalho Chehab, Alexander Aring, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Arend van Spriel,
	Franky Lin, Hante Meuleman, Kalle Valo, Qiang Zhao, Li Yang,
	Rob Herring, Frank Rowand
In-Reply-To: <20230208173343.37582-3-andriy.shevchenko@linux.intel.com>

On 08/02/2023 18:33, Andy Shevchenko wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
> 
> The file s3c64xx.c is including <linux/gpio.h> despite using no
> symbols from the file, however it needs it to implicitly bring in
> of_have_populated_dt() so include <linux/of.h> explicitly instead.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  arch/arm/mach-s3c/s3c64xx.c | 2 +-

It's not s3c24xx anymore, so subject prefix:
ARM: s3c64xx:


Best regards,
Krzysztof


^ permalink raw reply

* Re: [PATCH v4 02/18] ARM: s3c24xx: Use the right include
From: Andy Shevchenko @ 2023-02-08 17:43 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Arnd Bergmann, Linus Walleij, Bartosz Golaszewski, Tony Lindgren,
	Thomas Gleixner, Geert Uytterhoeven, Michael Ellerman,
	Christophe Leroy, Vincenzo Palazzo, Devarsh Thakkar,
	Michael Walle, Dmitry Torokhov, Dipen Patel, Thierry Reding,
	Stefan Schmidt, Miquel Raynal, Lee Jones, linux-gpio, linux-doc,
	linux-kernel, linux-doc-tw-discuss, linux-arm-kernel, linux-omap,
	linux-samsung-soc, linux-m68k, linuxppc-dev, linux-sh, linux-acpi,
	linux-tegra, linux-input, linux-media, linux-wpan, netdev,
	linux-wireless, brcm80211-dev-list.pdl, SHA-cyfmac-dev-list,
	linux-arch, devicetree, Bartosz Golaszewski, Jonathan Corbet,
	Alex Shi, Yanteng Si, Hu Haowen, Russell King, Aaro Koskinen,
	Janusz Krzysztofik, Andrew Lunn, Sebastian Hesselbarth,
	Gregory Clement, Alim Akhtar, Nicholas Piggin, Yoshinori Sato,
	Rich Felker, Mun Yew Tham, Keerthy, Mika Westerberg,
	Thierry Reding, Jonathan Hunter, Mauro Carvalho Chehab,
	Alexander Aring, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Arend van Spriel, Franky Lin, Hante Meuleman,
	Kalle Valo, Qiang Zhao, Li Yang, Rob Herring, Frank Rowand
In-Reply-To: <30234963-33e5-e2d7-a6ef-112e89efbdd0@linaro.org>

On Wed, Feb 08, 2023 at 06:39:12PM +0100, Krzysztof Kozlowski wrote:
> On 08/02/2023 18:33, Andy Shevchenko wrote:

...

> It's not s3c24xx anymore, so subject prefix:
> ARM: s3c64xx:

Fixed locally, thanks.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply

* [PATCH v4 18/18] gpiolib: Clean up headers
From: Andy Shevchenko @ 2023-02-08 17:33 UTC (permalink / raw)
  To: Andy Shevchenko, Arnd Bergmann, Linus Walleij,
	Bartosz Golaszewski, Tony Lindgren, Thomas Gleixner,
	Krzysztof Kozlowski, Geert Uytterhoeven, Michael Ellerman,
	Christophe Leroy, Vincenzo Palazzo, Devarsh Thakkar,
	Michael Walle, Dmitry Torokhov, Dipen Patel, Thierry Reding,
	Stefan Schmidt, Miquel Raynal, Lee Jones, linux-gpio, linux-doc,
	linux-kernel, linux-doc-tw-discuss, linux-arm-kernel, linux-omap,
	linux-samsung-soc, linux-m68k, linuxppc-dev, linux-sh, linux-acpi,
	linux-tegra, linux-input, linux-media, linux-wpan, netdev,
	linux-wireless, brcm80211-dev-list.pdl, SHA-cyfmac-dev-list,
	linux-arch, devicetree
  Cc: Bartosz Golaszewski, Jonathan Corbet, Alex Shi, Yanteng Si,
	Hu Haowen, Russell King, Aaro Koskinen, Janusz Krzysztofik,
	Andrew Lunn, Sebastian Hesselbarth, Gregory Clement, Alim Akhtar,
	Nicholas Piggin, Yoshinori Sato, Rich Felker, Mun Yew Tham,
	Keerthy, Mika Westerberg, Thierry Reding, Jonathan Hunter,
	Mauro Carvalho Chehab, Alexander Aring, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Arend van Spriel,
	Franky Lin, Hante Meuleman, Kalle Valo, Qiang Zhao, Li Yang,
	Rob Herring, Frank Rowand
In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com>

There is a few things done:
- include only the headers we are direct user of
- when pointer is in use, provide a forward declaration
- add missing headers
- group generic headers and subsystem headers
- sort each group alphabetically

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpiolib-acpi.c   | 10 ++++++----
 drivers/gpio/gpiolib-acpi.h   |  1 -
 drivers/gpio/gpiolib-of.c     |  6 ++++--
 drivers/gpio/gpiolib-of.h     |  1 -
 drivers/gpio/gpiolib-swnode.c |  5 +++--
 drivers/gpio/gpiolib-sysfs.c  | 21 ++++++++++++++++-----
 drivers/gpio/gpiolib.c        |  9 ++++++---
 include/linux/gpio.h          | 10 ++++------
 include/linux/gpio/consumer.h | 14 ++++++++++----
 include/linux/gpio/driver.h   | 30 +++++++++++++++++++++++-------
 10 files changed, 72 insertions(+), 35 deletions(-)

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index bb583cea366c..3871dade186a 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -7,17 +7,19 @@
  *          Mika Westerberg <mika.westerberg@linux.intel.com>
  */
 
+#include <linux/acpi.h>
 #include <linux/dmi.h>
 #include <linux/errno.h>
-#include <linux/gpio/consumer.h>
-#include <linux/gpio/driver.h>
-#include <linux/gpio/machine.h>
 #include <linux/export.h>
-#include <linux/acpi.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/mutex.h>
 #include <linux/pinctrl/pinctrl.h>
 
+#include <linux/gpio/consumer.h>
+#include <linux/gpio/driver.h>
+#include <linux/gpio/machine.h>
+
 #include "gpiolib.h"
 #include "gpiolib-acpi.h"
 
diff --git a/drivers/gpio/gpiolib-acpi.h b/drivers/gpio/gpiolib-acpi.h
index 5fa315b3c912..a6f3be0bb921 100644
--- a/drivers/gpio/gpiolib-acpi.h
+++ b/drivers/gpio/gpiolib-acpi.h
@@ -9,7 +9,6 @@
 #define GPIOLIB_ACPI_H
 
 #include <linux/err.h>
-#include <linux/errno.h>
 #include <linux/types.h>
 
 #include <linux/gpio/consumer.h>
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 0f699af438b0..1436cdb5fa26 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -10,14 +10,16 @@
 #include <linux/device.h>
 #include <linux/err.h>
 #include <linux/errno.h>
-#include <linux/module.h>
 #include <linux/io.h>
-#include <linux/gpio/consumer.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_gpio.h>
 #include <linux/pinctrl/pinctrl.h>
 #include <linux/slab.h>
+#include <linux/string.h>
+
+#include <linux/gpio/consumer.h>
 #include <linux/gpio/machine.h>
 
 #include "gpiolib.h"
diff --git a/drivers/gpio/gpiolib-of.h b/drivers/gpio/gpiolib-of.h
index e5bb065d82ef..6b3a5347c5d9 100644
--- a/drivers/gpio/gpiolib-of.h
+++ b/drivers/gpio/gpiolib-of.h
@@ -4,7 +4,6 @@
 #define GPIOLIB_OF_H
 
 #include <linux/err.h>
-#include <linux/errno.h>
 #include <linux/types.h>
 
 #include <linux/notifier.h>
diff --git a/drivers/gpio/gpiolib-swnode.c b/drivers/gpio/gpiolib-swnode.c
index dd9ccac214d1..b5a6eaf3729b 100644
--- a/drivers/gpio/gpiolib-swnode.c
+++ b/drivers/gpio/gpiolib-swnode.c
@@ -6,13 +6,14 @@
  */
 #include <linux/err.h>
 #include <linux/errno.h>
-#include <linux/gpio/consumer.h>
-#include <linux/gpio/driver.h>
 #include <linux/kernel.h>
 #include <linux/printk.h>
 #include <linux/property.h>
 #include <linux/string.h>
 
+#include <linux/gpio/consumer.h>
+#include <linux/gpio/driver.h>
+
 #include "gpiolib.h"
 #include "gpiolib-swnode.h"
 
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index 6e4267944f80..c1cbf71329f0 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -1,18 +1,29 @@
 // SPDX-License-Identifier: GPL-2.0
+
+#include <linux/bitops.h>
+#include <linux/device.h>
 #include <linux/idr.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/kdev_t.h>
+#include <linux/kstrtox.h>
+#include <linux/list.h>
 #include <linux/mutex.h>
-#include <linux/device.h>
+#include <linux/printk.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
+#include <linux/string.h>
 #include <linux/sysfs.h>
+#include <linux/types.h>
+
 #include <linux/gpio/consumer.h>
 #include <linux/gpio/driver.h>
-#include <linux/interrupt.h>
-#include <linux/kdev_t.h>
-#include <linux/slab.h>
-#include <linux/ctype.h>
 
 #include "gpiolib.h"
 #include "gpiolib-sysfs.h"
 
+struct kernfs_node;
+
 #define GPIO_IRQF_TRIGGER_NONE		0
 #define GPIO_IRQF_TRIGGER_FALLING	BIT(0)
 #define GPIO_IRQF_TRIGGER_RISING	BIT(1)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 99a2c77c3711..900f6573c070 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -6,22 +6,25 @@
 #include <linux/debugfs.h>
 #include <linux/device.h>
 #include <linux/err.h>
+#include <linux/errno.h>
 #include <linux/file.h>
 #include <linux/fs.h>
-#include <linux/gpio.h>
-#include <linux/gpio/driver.h>
-#include <linux/gpio/machine.h>
 #include <linux/idr.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/pinctrl/consumer.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 
+#include <linux/gpio.h>
+#include <linux/gpio/driver.h>
+#include <linux/gpio/machine.h>
+
 #include <uapi/linux/gpio.h>
 
 #include "gpiolib-acpi.h"
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index a86953696e47..8528353e073b 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -12,9 +12,10 @@
 #ifndef __LINUX_GPIO_H
 #define __LINUX_GPIO_H
 
-#include <linux/errno.h>
 #include <linux/types.h>
 
+struct device;
+
 /* see Documentation/driver-api/gpio/legacy.rst */
 
 /* make these flag values available regardless of GPIO kconfig options */
@@ -134,19 +135,16 @@ void gpio_free_array(const struct gpio *array, size_t num);
 
 /* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */
 
-struct device;
-
 int devm_gpio_request(struct device *dev, unsigned gpio, const char *label);
 int devm_gpio_request_one(struct device *dev, unsigned gpio,
 			  unsigned long flags, const char *label);
 
 #else /* ! CONFIG_GPIOLIB */
 
-#include <linux/bug.h>
 #include <linux/kernel.h>
 
-struct device;
-struct gpio_chip;
+#include <asm/bug.h>
+#include <asm/errno.h>
 
 static inline bool gpio_is_valid(int number)
 {
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index 5432e5d5fbfb..1c4385a00f88 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -3,15 +3,14 @@
 #define __LINUX_GPIO_CONSUMER_H
 
 #include <linux/bits.h>
-#include <linux/bug.h>
-#include <linux/compiler_types.h>
-#include <linux/err.h>
+#include <linux/types.h>
 
 struct acpi_device;
 struct device;
 struct fwnode_handle;
-struct gpio_desc;
+
 struct gpio_array;
+struct gpio_desc;
 
 /**
  * struct gpio_descs - Struct containing an array of descriptors that can be
@@ -185,8 +184,11 @@ struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,
 
 #else /* CONFIG_GPIOLIB */
 
+#include <linux/err.h>
 #include <linux/kernel.h>
 
+#include <asm/bug.h>
+
 static inline int gpiod_count(struct device *dev, const char *con_id)
 {
 	return 0;
@@ -616,6 +618,8 @@ struct gpio_desc *acpi_get_and_request_gpiod(char *path, unsigned int pin, char
 
 #else  /* CONFIG_GPIOLIB && CONFIG_ACPI */
 
+#include <linux/err.h>
+
 static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev,
 			      const struct acpi_gpio_mapping *gpios)
 {
@@ -647,6 +651,8 @@ void gpiod_unexport(struct gpio_desc *desc);
 
 #else  /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */
 
+#include <asm/errno.h>
+
 static inline int gpiod_export(struct gpio_desc *desc,
 			       bool direction_may_change)
 {
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 262a84ce9bcb..5c6db5533be6 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -2,27 +2,35 @@
 #ifndef __LINUX_GPIO_DRIVER_H
 #define __LINUX_GPIO_DRIVER_H
 
-#include <linux/device.h>
-#include <linux/irq.h>
+#include <linux/bits.h>
 #include <linux/irqchip/chained_irq.h>
 #include <linux/irqdomain.h>
+#include <linux/irqhandler.h>
 #include <linux/lockdep.h>
 #include <linux/pinctrl/pinconf-generic.h>
 #include <linux/pinctrl/pinctrl.h>
 #include <linux/property.h>
+#include <linux/spinlock_types.h>
 #include <linux/types.h>
 
+#ifdef CONFIG_GENERIC_MSI_IRQ
 #include <asm/msi.h>
+#endif
 
-struct gpio_desc;
+struct device;
+struct irq_chip;
+struct irq_data;
+struct module;
 struct of_phandle_args;
+struct pinctrl_dev;
 struct seq_file;
-struct gpio_device;
-struct module;
-enum gpiod_flags;
-enum gpio_lookup_flags;
 
 struct gpio_chip;
+struct gpio_desc;
+struct gpio_device;
+
+enum gpio_lookup_flags;
+enum gpiod_flags;
 
 union gpio_irq_fwspec {
 	struct irq_fwspec	fwspec;
@@ -679,6 +687,10 @@ bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gc,
 int gpiochip_irqchip_add_domain(struct gpio_chip *gc,
 				struct irq_domain *domain);
 #else
+
+#include <asm/bug.h>
+#include <asm/errno.h>
+
 static inline int gpiochip_irqchip_add_domain(struct gpio_chip *gc,
 					      struct irq_domain *domain)
 {
@@ -756,6 +768,10 @@ struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc);
 
 #else /* CONFIG_GPIOLIB */
 
+#include <linux/err.h>
+
+#include <asm/bug.h>
+
 static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc)
 {
 	/* GPIO can never have been requested */
-- 
2.39.1


^ permalink raw reply related

* [PATCH v4 17/18] gpiolib: Group forward declarations in consumer.h
From: Andy Shevchenko @ 2023-02-08 17:33 UTC (permalink / raw)
  To: Andy Shevchenko, Arnd Bergmann, Linus Walleij,
	Bartosz Golaszewski, Tony Lindgren, Thomas Gleixner,
	Krzysztof Kozlowski, Geert Uytterhoeven, Michael Ellerman,
	Christophe Leroy, Vincenzo Palazzo, Devarsh Thakkar,
	Michael Walle, Dmitry Torokhov, Dipen Patel, Thierry Reding,
	Stefan Schmidt, Miquel Raynal, Lee Jones, linux-gpio, linux-doc,
	linux-kernel, linux-doc-tw-discuss, linux-arm-kernel, linux-omap,
	linux-samsung-soc, linux-m68k, linuxppc-dev, linux-sh, linux-acpi,
	linux-tegra, linux-input, linux-media, linux-wpan, netdev,
	linux-wireless, brcm80211-dev-list.pdl, SHA-cyfmac-dev-list,
	linux-arch, devicetree
  Cc: Bartosz Golaszewski, Jonathan Corbet, Alex Shi, Yanteng Si,
	Hu Haowen, Russell King, Aaro Koskinen, Janusz Krzysztofik,
	Andrew Lunn, Sebastian Hesselbarth, Gregory Clement, Alim Akhtar,
	Nicholas Piggin, Yoshinori Sato, Rich Felker, Mun Yew Tham,
	Keerthy, Mika Westerberg, Thierry Reding, Jonathan Hunter,
	Mauro Carvalho Chehab, Alexander Aring, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Arend van Spriel,
	Franky Lin, Hante Meuleman, Kalle Valo, Qiang Zhao, Li Yang,
	Rob Herring, Frank Rowand
In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com>

For better maintenance group the forward declarations together.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/gpio/consumer.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index a7eb8aa1e54c..5432e5d5fbfb 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -7,6 +7,7 @@
 #include <linux/compiler_types.h>
 #include <linux/err.h>
 
+struct acpi_device;
 struct device;
 struct fwnode_handle;
 struct gpio_desc;
@@ -602,8 +603,6 @@ struct acpi_gpio_mapping {
 	unsigned int quirks;
 };
 
-struct acpi_device;
-
 #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_ACPI)
 
 int acpi_dev_add_driver_gpios(struct acpi_device *adev,
-- 
2.39.1


^ permalink raw reply related

* [PATCH v4 14/18] gpio: regmap: Add missing header(s)
From: Andy Shevchenko @ 2023-02-08 17:33 UTC (permalink / raw)
  To: Andy Shevchenko, Arnd Bergmann, Linus Walleij,
	Bartosz Golaszewski, Tony Lindgren, Thomas Gleixner,
	Krzysztof Kozlowski, Geert Uytterhoeven, Michael Ellerman,
	Christophe Leroy, Vincenzo Palazzo, Devarsh Thakkar,
	Michael Walle, Dmitry Torokhov, Dipen Patel, Thierry Reding,
	Stefan Schmidt, Miquel Raynal, Lee Jones, linux-gpio, linux-doc,
	linux-kernel, linux-doc-tw-discuss, linux-arm-kernel, linux-omap,
	linux-samsung-soc, linux-m68k, linuxppc-dev, linux-sh, linux-acpi,
	linux-tegra, linux-input, linux-media, linux-wpan, netdev,
	linux-wireless, brcm80211-dev-list.pdl, SHA-cyfmac-dev-list,
	linux-arch, devicetree
  Cc: Bartosz Golaszewski, Jonathan Corbet, Alex Shi, Yanteng Si,
	Hu Haowen, Russell King, Aaro Koskinen, Janusz Krzysztofik,
	Andrew Lunn, Sebastian Hesselbarth, Gregory Clement, Alim Akhtar,
	Nicholas Piggin, Yoshinori Sato, Rich Felker, Mun Yew Tham,
	Keerthy, Mika Westerberg, Thierry Reding, Jonathan Hunter,
	Mauro Carvalho Chehab, Alexander Aring, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Arend van Spriel,
	Franky Lin, Hante Meuleman, Kalle Valo, Qiang Zhao, Li Yang,
	Rob Herring, Frank Rowand
In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com>

Do not imply that some of the generic headers may be always included.
Instead, include explicitly what we are direct user of.

While at it, split out the GPIO group of headers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-regmap.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c
index fca17d478984..c08c8e528867 100644
--- a/drivers/gpio/gpio-regmap.c
+++ b/drivers/gpio/gpio-regmap.c
@@ -5,11 +5,17 @@
  * Copyright 2020 Michael Walle <michael@walle.cc>
  */
 
-#include <linux/gpio/driver.h>
-#include <linux/gpio/regmap.h>
-#include <linux/kernel.h>
+#include <linux/bits.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/io.h>
 #include <linux/module.h>
 #include <linux/regmap.h>
+#include <linux/slab.h>
+#include <linux/types.h>
+
+#include <linux/gpio/driver.h>
+#include <linux/gpio/regmap.h>
 
 struct gpio_regmap {
 	struct device *parent;
-- 
2.39.1


^ permalink raw reply related

* [PATCH v4 13/18] gpio: reg: Add missing header(s)
From: Andy Shevchenko @ 2023-02-08 17:33 UTC (permalink / raw)
  To: Andy Shevchenko, Arnd Bergmann, Linus Walleij,
	Bartosz Golaszewski, Tony Lindgren, Thomas Gleixner,
	Krzysztof Kozlowski, Geert Uytterhoeven, Michael Ellerman,
	Christophe Leroy, Vincenzo Palazzo, Devarsh Thakkar,
	Michael Walle, Dmitry Torokhov, Dipen Patel, Thierry Reding,
	Stefan Schmidt, Miquel Raynal, Lee Jones, linux-gpio, linux-doc,
	linux-kernel, linux-doc-tw-discuss, linux-arm-kernel, linux-omap,
	linux-samsung-soc, linux-m68k, linuxppc-dev, linux-sh, linux-acpi,
	linux-tegra, linux-input, linux-media, linux-wpan, netdev,
	linux-wireless, brcm80211-dev-list.pdl, SHA-cyfmac-dev-list,
	linux-arch, devicetree
  Cc: Bartosz Golaszewski, Jonathan Corbet, Alex Shi, Yanteng Si,
	Hu Haowen, Russell King, Aaro Koskinen, Janusz Krzysztofik,
	Andrew Lunn, Sebastian Hesselbarth, Gregory Clement, Alim Akhtar,
	Nicholas Piggin, Yoshinori Sato, Rich Felker, Mun Yew Tham,
	Keerthy, Mika Westerberg, Thierry Reding, Jonathan Hunter,
	Mauro Carvalho Chehab, Alexander Aring, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Arend van Spriel,
	Franky Lin, Hante Meuleman, Kalle Valo, Qiang Zhao, Li Yang,
	Rob Herring, Frank Rowand
In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com>

Do not imply that some of the generic headers may be always included.
Instead, include explicitly what we are direct user of.

While at it, split out the GPIO group of headers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-reg.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-reg.c b/drivers/gpio/gpio-reg.c
index d35169bde25a..73c7260d89c0 100644
--- a/drivers/gpio/gpio-reg.c
+++ b/drivers/gpio/gpio-reg.c
@@ -4,11 +4,19 @@
  *
  * Copyright (C) 2016 Russell King
  */
-#include <linux/gpio/driver.h>
-#include <linux/gpio/gpio-reg.h>
+#include <linux/bits.h>
+#include <linux/container_of.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/errno.h>
 #include <linux/io.h>
+#include <linux/irqdomain.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
+#include <linux/types.h>
+
+#include <linux/gpio/driver.h>
+#include <linux/gpio/gpio-reg.h>
 
 struct gpio_reg {
 	struct gpio_chip gc;
-- 
2.39.1


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox