* Re: [PATCH 11/42] drivers/hid: Convert snprintf to sysfs_emit
From: Bruno Prémont @ 2024-02-24 16:59 UTC (permalink / raw)
To: Li Zhijian
Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires, Jonathan Cameron,
Srinivas Pandruvada, linux-input
In-Reply-To: <20240116045151.3940401-9-lizhijian@fujitsu.com>
Hi Li,
While only looking for the snprintf() in your coccinelle analysis you
probably also want to look for sprintf() (see e.g. else clause in
hid-sensor-custom.c and scnprintf() (see picolcd_fb_update_rate_show
in hid-picolcd_fb.c) to replace more s*printf() calls with sysfs_emit*
variants.
diff --git a/drivers/hid/hid-picolcd_fb.c b/drivers/hid/hid-picolcd_fb.c
index d726aaafb146..03074d25d662 100644
--- a/drivers/hid/hid-picolcd_fb.c
+++ b/drivers/hid/hid-picolcd_fb.c
@@ -459,9 +459,9 @@ static ssize_t picolcd_fb_update_rate_show(struct device *dev,
if (ret >= PAGE_SIZE)
break;
else if (i == fb_update_rate)
- ret += scnprintf(buf+ret, PAGE_SIZE-ret, "[%u] ", i);
+ ret += sysfs_emit_at(buf, ret, "[%u] ", i);
else
- ret += scnprintf(buf+ret, PAGE_SIZE-ret, "%u ", i);
+ ret += sysfs_emit_at(buf, ret, "%u ", i);
if (ret > 0)
buf[min(ret, (size_t)PAGE_SIZE)-1] = '\n';
return ret;
For hid-picolcd-*.c,
Acked-by: Bruno Prémont <bonbons@linux-vserver.org>
but preferably with the scnprintf() case is covered too.
Cheers,
Bruno
On Tue, 16 Jan 2024 12:51:20 +0800 Li Zhijian wrote:
> Per Documentation/filesystems/sysfs.rst, show() should only use sysfs_emit()
> or sysfs_emit_at() when formatting the value to be returned to user space.
>
> coccinelle complains that there are still a couple of functions that use
> snprintf(). Convert them to sysfs_emit().
>
> > ./drivers/hid/hid-picolcd_core.c:259:9-17: WARNING: please use sysfs_emit
> > ./drivers/hid/hid-picolcd_core.c:304:8-16: WARNING: please use sysfs_emit
> > ./drivers/hid/hid-sensor-custom.c:375:10-18: WARNING: please use sysfs_emi
>
> No functional change intended
>
> CC: "Bruno Prémont" <bonbons@linux-vserver.org>
> CC: Jiri Kosina <jikos@kernel.org>
> CC: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> CC: Jonathan Cameron <jic23@kernel.org>
> CC: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> CC: linux-input@vger.kernel.org
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
> ---
> drivers/hid/hid-picolcd_core.c | 6 +++---
> drivers/hid/hid-sensor-custom.c | 3 +--
> 2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/hid/hid-picolcd_core.c b/drivers/hid/hid-picolcd_core.c
> index bbda231a7ce3..fa46fb6eab3f 100644
> --- a/drivers/hid/hid-picolcd_core.c
> +++ b/drivers/hid/hid-picolcd_core.c
> @@ -256,9 +256,9 @@ static ssize_t picolcd_operation_mode_show(struct device *dev,
> struct picolcd_data *data = dev_get_drvdata(dev);
>
> if (data->status & PICOLCD_BOOTLOADER)
> - return snprintf(buf, PAGE_SIZE, "[bootloader] lcd\n");
> + return sysfs_emit(buf, "[bootloader] lcd\n");
> else
> - return snprintf(buf, PAGE_SIZE, "bootloader [lcd]\n");
> + return sysfs_emit(buf, "bootloader [lcd]\n");
> }
>
> static ssize_t picolcd_operation_mode_store(struct device *dev,
> @@ -301,7 +301,7 @@ static ssize_t picolcd_operation_mode_delay_show(struct device *dev,
> {
> struct picolcd_data *data = dev_get_drvdata(dev);
>
> - return snprintf(buf, PAGE_SIZE, "%hu\n", data->opmode_delay);
> + return sysfs_emit(buf, "%hu\n", data->opmode_delay);
> }
>
> static ssize_t picolcd_operation_mode_delay_store(struct device *dev,
> diff --git a/drivers/hid/hid-sensor-custom.c b/drivers/hid/hid-sensor-custom.c
> index d85398721659..4fe8dccf671d 100644
> --- a/drivers/hid/hid-sensor-custom.c
> +++ b/drivers/hid/hid-sensor-custom.c
> @@ -372,8 +372,7 @@ static ssize_t show_value(struct device *dev, struct device_attribute *attr,
> sizeof(struct hid_custom_usage_desc),
> usage_id_cmp);
> if (usage_desc)
> - return snprintf(buf, PAGE_SIZE, "%s\n",
> - usage_desc->desc);
> + return sysfs_emit(buf, "%s\n", usage_desc->desc);
> else
> return sprintf(buf, "not-specified\n");
Shouldn't the sprintf() in the else clause be replaced as well?
> } else
^ permalink raw reply related
* [PATCH v8 00/38] ep93xx device tree conversion
From: Nikita Shubin via B4 Relay @ 2024-02-26 7:29 UTC (permalink / raw)
To: Hartley Sweeten, Alexander Sverdlin, Russell King,
Lukasz Majewski, Linus Walleij, Bartosz Golaszewski,
Andy Shevchenko, Michael Turquette, Stephen Boyd,
Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Nikita Shubin, Vinod Koul, Wim Van Sebroeck, Guenter Roeck,
Thierry Reding, Uwe Kleine-König, Mark Brown,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Damien Le Moal, Sergey Shtylyov, Dmitry Torokhov, Liam Girdwood,
Jaroslav Kysela, Takashi Iwai, Ralf Baechle, Wu, Aaron, Lee Jones,
Olof Johansson, Niklas Cassel
Cc: linux-arm-kernel, linux-kernel, linux-gpio, linux-clk, linux-pm,
devicetree, dmaengine, linux-watchdog, linux-pwm, linux-spi,
netdev, linux-mtd, linux-ide, linux-input, linux-sound,
Arnd Bergmann, Bartosz Golaszewski, Krzysztof Kozlowski,
Andy Shevchenko, Andrew Lunn, Andy Shevchenko
The goal is to receive ACKs for all patches in series to merge it via Arnd branch.
No major changes since last version (v7) all changes are cosmetics.
Following patches require attention from Stephen Boyd, as they were converted to aux_dev as suggested:
- ARM: ep93xx: add regmap aux_dev
- clk: ep93xx: add DT support for Cirrus EP93xx
Following patches require attention from Vinod Koul:
- dma: cirrus: Convert to DT for Cirrus EP93xx
- dma: cirrus: remove platform code
Following patches dropped from series:
- ARM: ep93xx: Add terminator to gpiod_lookup_table (taken)
Patches should be formated with '--histogram'
---
Changes in v8:
soc: Add SoC driver for Cirrus ep93xx
- fixed freeing adev instead of rdev
- use __free() and no_free_ptr() for rdev allocation
- s/of_device_get_match_data()/device_get_match_data()/
ata: pata_ep93xx: add device tree support
- more appropriate usage of dev_err_probe()
pinctrl: add a Cirrus ep93xx SoC pin controller
- 8 per row in ide_9312_pins
mtd: rawnand: add support for ts72xx
- fwnode_handle_put() for fwnode in ts72xx_nand_remove()
- Link to v7: https://lore.kernel.org/r/20240118-ep93xx-v7-0-d953846ae771@maquefel.me
Changes in v7:
mtd: rawnand: add support for ts72xx
- fixed KConfig description
ARM: ep93xx: Add terminator to gpiod_lookup_table
- + Reported-by, Fixes
ARM: ep93xx: add regmap aux_dev
- + trailing comma
- - #include <linux/spinlock.h>
clk: ep93xx: add DT support for Cirrus EP93xx
- dropped unused defines
- return from default in ep93xx_mux_get_parent()
- use guard() in ep93xx_mux_set_parent_lock()
- <math.h> header for abs_diff()
- fixed comments
pinctrl: add a Cirrus ep93xx SoC pin controller
- dropped comments for DEVCFG defines
- <linux/array_size.h> for ARRAY_SIZE()
- + default in ep93xx_get_group_name()
- correct cast for id->driver_data
- s/device_set_of_node_from_dev()/device_set_node()/
power: reset: Add a driver for the ep93xx reset
- Add <linux/container_of.h>, <linux/errno.h>, <linux/slab.h>
- Add <linux/module.h>, <linux/mod_devicetable.h>
- Remove <platform_device.h>
spi: ep93xx: add DT support for Cirrus EP93xx
- Replace with ret = dev_err_probe(...);
ata: pata_ep93xx: add device tree support
- fixed wrong rebase with some partes leaked in "ata: pata_ep93xx: remove legacy pinctrl use"
- fix dma_request_chan() error processing
dma: cirrus: Convert to DT for Cirrus EP93xx
- fixed commit message (dropped explicit "only")
- fixed clk_get() processing to defer probe and log spamming
- refactor ep93xx_m2p_dma_filter()
- dropped blank line in ep93xx_m2p_dma_of_xlate()
- refactor ep93xx_m2m_dma_of_xlate()
dma: cirrus: remove platform code
- s/dma/DMA/ in commit message
soc: Add SoC driver for Cirrus ep93xx
- add period
- use cleanup and guard() for spinlocking
- correct cast for device_get_match_data()
- dropped dev_info() with SoC revision - i can't find it anywhere since 2.6 :/,
don't know why i was so sured that ep93xx always printed that
ata: pata_ep93xx: remove legacy pinctrl use
- made error handling in DMA as Uwe suggested
- Link to v6: https://lore.kernel.org/r/20231212-ep93xx-v6-0-c307b8ac9aa8@maquefel.me
Changes in v6:
- clk: ep93xx: add DT support for Cirrus EP93xx
- s/spin_lock_irqsave()/guard()/
- refactor index check in ep93xx_mux_set_parent_lock() to something more readable
- use in_range in ep93xx_mux_set_parent_lock()/ep93xx_ddiv_set_rate()
- use GENMASK() in ep93xx_ddiv_recalc_rate()
- comment reserved bit in ep93xx_ddiv_set_rate()
- move out from loop ClkDiv value assigment
- some style fixes
Andy, i was i asked to set index of XTALI explicitly, i am not setting ddiv_pdata
there becouse only XTALI is jnown in advance, and i think setting them in one place is more convenient.
- pinctrl: add a Cirrus ep93xx SoC pin controller
- drop OF from Kconfig
- droped linux/of.h include
- add space to */ where it is applicable
- add coma in multiline assigment
- "return NULL" as default case in ep93xx_get_group_name()
- fixed casting id->driver_data
- use device_set_of_node_from_dev()
- use dev_err_probe()
- power: reset: Add a driver for the ep93xx reset
- drop linux/of.h include
- soc: Add SoC driver for Cirrus ep93xx
- s/GPL-2.0/GPL-2.0-only/
- drop linux/kernel.h include
- + blank line before linux/soc/cirrus/ep93xx.h
- + blank line after ep93xx_get_soc_rev()
- + coma for pinctrl_names
- valid casting to int for of_device_get_match_data() return value
- mtd: rawnand: add support for ts72xx
- return as part of switch case
- s/iowrite8/iowrite8_rep/
- net: cirrus: add DT support for Cirrus EP93xx
- fix header sorting
- dma: cirrus: Convert to DT for Cirrus EP93xx
- use devm_clk_get
- use is_slave_direction
Changes in v5:
- gpio: ep93xx: split device in multiple
- ordered headers
- use irqd_to_hwirq()
- s/platform_get_irq()/platform_get_irq_optional()/
- [PATCH v4 02/42] ARM: ep93xx: add swlocked prototypes
- replaced with ARM: ep93xx: add regmap aux_dev
- [PATCH v4 03/42] dt-bindings: clock: Add Cirrus EP93xx
- fixed identation
- removed EP93XX_CLK_END
- and dropped it
- clock bindings moved to syscon with renaming to cirrus,ep9301-syscon.h
- clk: ep93xx: add DT support for Cirrus EP93xx
- convert to auxiliary and use parent device tree node
- moved all clocks except XTALI here
- used devm version everywhere and *_parent_hw() instead of passing name where it's possible
- unfortunately devm_clk_hw_register_fixed_rate doesn't have a parent index version
- [PATCH v4 05/42] dt-bindings: pinctrl: Add Cirrus EP93xx
- "unevaluatedProperties: false" for pins
- returned "additionalProperties: false" where it was
- and dropped it
- pinctrl: add a Cirrus ep93xx SoC pin controller
- sorted includes
- convert to auxiliary and use parent device tree node
- power: reset: Add a driver for the ep93xx reset
- convert to auxiliary device
- dt-bindings: soc: Add Cirrus EP93xx
- dropped all ref to reboot, clk, pinctrl subnodes
- added pins, as it's now used for pinctrl
- added #clock-cells, as it's now used for clk
- dt-bindings: pwm: Add Cirrus EP93xx
- $ref to pwm.yaml
- fixed 'pwm-cells'
- s/additionalProperties/unevaluatedProperties/
- soc: Add SoC driver for Cirrus ep93xx
- removed clocks, they are moved to clk auxiliary driver, as we dropped the clk dt node
- removed all swlocked exported functions
- dropped static spinlock
- added instantiating auxiliary reboot, clk, pinctrl
- dt-bindings: spi: Add Cirrus EP93xx
- Document DMA support
- spi: ep93xx: add DT support for Cirrus EP93xx
- dropped CONFIG_OF and SPI/DMA platform data entirely
- s/master/host/
- reworked DMA setup so we can use probe defer
- dt-bindings: dma: Add Cirrus EP93xx
- dropped bindings header (moved ports description to YAML)
- changed '#dma-cells' to 2, we use port, direction in cells so we can drop platform code completely
- dma: cirrus: add DT support for Cirrus EP93xx
- dropped platform probing completely
- dropped struct ep93xx_dma_data replaced with internal struct ep93xx_dma_chan_cfg with port/direction
- added xlate functions for m2m/m2p
- we require filters to set dma_cfg before hw_setup
- dt-bindings: ata: Add Cirrus EP93xx
- Document DMA support
- ata: pata_ep93xx: add device tree support
- drop DMA platform header with data
- use DMA OF so we can defer probing until DMA is up
- ARM: dts: add Cirrus EP93XX SoC .dtsi
- ARM: dts: ep93xx: add ts7250 board
- ARM: dts: ep93xx: Add EDB9302 DT
- replaced "eclk: clock-controller" to syscon reference
- replaced "pinctrl: pinctrl" to syscon reference
- gpios are now "enabled" by default
- reworked i2s node
- change all dma nodes and refs
- new additions to I2S
- Document DMA
- Document Audio Port usage
- drop legacy DMA support
- Link to v4: https://lore.kernel.org/r/20230915-ep93xx-v4-0-a1d779dcec10@maquefel.me
Changes in v4:
- gpio: ep93xx: split device in multiple
- s/generic_handle_irq/generic_handle_domain_irq/
- s/int offset/irq_hw_number_t offset/ though now it looks a bit odd to me
- drop i = 0
- drop 'error'
- use dev_err_probe withour printing devname once again
dt-bindings: clock: Add Cirrus EP93xx
- renamed cirrus,ep93xx-clock.h -> cirrus,ep9301-clk.h
clk: ep93xx: add DT support for Cirrus EP93xx
- drop unused includes
- use .name only for xtali, pll1, pll2 parents
- convert // to /*
- pass clk_parent_data instead of char* clock name
dt-bindings: pinctrl: Add Cirrus EP93xx
- s/additionalProperties/unevaluatedProperties/
dt-bindings: soc: Add Cirrus EP93xx
- move syscon to soc directory
- add vendor prefix
- make reboot same style as pinctrl, clk
- use absolute path for ref
- expand example
soc: Add SoC driver for Cirrus ep93xx
- s/0xf0000000/GENMASK(31, 28)/
- s/ret/ep93xx_chip_revision(map)/
- drop symbol exports
- convert to platform driver
dt-bindings: rtc: Add Cirrus EP93xx
- allOf: with $ref to rtc.yaml
- s/additionalProperties/unevaluatedProperties/
dt-bindings: watchdog: Add Cirrus EP93x
- drop description
- reword
power: reset: Add a driver for the ep93xx reset
- lets use 'GPL-2.0+' instead of '(GPL-2.0)'
- s/of_device/of/
- drop mdelay with warning
- return 0 at the end
net: cirrus: add DT support for Cirrus EP93xx
- fix leaking np
mtd: nand: add support for ts72xx
- +bits.h
- drop comment
- ok to fwnode_get_next_child_node
- use goto to put handle and nand and report error
ARM: dts: add Cirrus EP93XX SoC .dtsi
- add simple-bus for ebi, as we don't require to setup anything
- add arm,pl011 compatible to uart nodes
- drop i2c-gpio, as it's isn't used anywhere
ARM: dts: ep93xx: add ts7250 board
- generic node name for temperature-sensor
- drop i2c
- move nand, rtc, watchdog to ebi node
- Link to v3: https://lore.kernel.org/r/20230605-ep93xx-v3-0-3d63a5f1103e@maquefel.me
---
Alexander Sverdlin (3):
ASoC: ep93xx: Drop legacy DMA support
ARM: dts: ep93xx: Add EDB9302 DT
ASoC: cirrus: edb93xx: Delete driver
Nikita Shubin (35):
gpio: ep93xx: split device in multiple
ARM: ep93xx: add regmap aux_dev
clk: ep93xx: add DT support for Cirrus EP93xx
pinctrl: add a Cirrus ep93xx SoC pin controller
power: reset: Add a driver for the ep93xx reset
dt-bindings: soc: Add Cirrus EP93xx
soc: Add SoC driver for Cirrus ep93xx
dt-bindings: dma: Add Cirrus EP93xx
dma: cirrus: Convert to DT for Cirrus EP93xx
dt-bindings: watchdog: Add Cirrus EP93x
watchdog: ep93xx: add DT support for Cirrus EP93xx
dt-bindings: pwm: Add Cirrus EP93xx
pwm: ep93xx: add DT support for Cirrus EP93xx
dt-bindings: spi: Add Cirrus EP93xx
spi: ep93xx: add DT support for Cirrus EP93xx
dt-bindings: net: Add Cirrus EP93xx
net: cirrus: add DT support for Cirrus EP93xx
dt-bindings: mtd: Add ts7200 nand-controller
mtd: rawnand: add support for ts72xx
dt-bindings: ata: Add Cirrus EP93xx
ata: pata_ep93xx: add device tree support
dt-bindings: input: Add Cirrus EP93xx keypad
input: keypad: ep93xx: add DT support for Cirrus EP93xx
wdt: ts72xx: add DT support for ts72xx
gpio: ep93xx: add DT support for gpio-ep93xx
ASoC: dt-bindings: ep93xx: Document DMA support
ASoC: dt-bindings: ep93xx: Document Audio Port support
ARM: dts: add Cirrus EP93XX SoC .dtsi
ARM: dts: ep93xx: add ts7250 board
ARM: ep93xx: DT for the Cirrus ep93xx SoC platforms
pwm: ep93xx: drop legacy pinctrl
ata: pata_ep93xx: remove legacy pinctrl use
ARM: ep93xx: delete all boardfiles
ARM: ep93xx: soc: drop defines
dma: cirrus: remove platform code
.../bindings/arm/cirrus/cirrus,ep9301.yaml | 38 +
.../bindings/ata/cirrus,ep9312-pata.yaml | 42 +
.../bindings/dma/cirrus,ep9301-dma-m2m.yaml | 84 ++
.../bindings/dma/cirrus,ep9301-dma-m2p.yaml | 144 ++
.../bindings/input/cirrus,ep9307-keypad.yaml | 87 ++
.../devicetree/bindings/mtd/technologic,nand.yaml | 45 +
.../devicetree/bindings/net/cirrus,ep9301-eth.yaml | 59 +
.../devicetree/bindings/pwm/cirrus,ep9301-pwm.yaml | 53 +
.../bindings/soc/cirrus/cirrus,ep9301-syscon.yaml | 94 ++
.../bindings/sound/cirrus,ep9301-i2s.yaml | 16 +
.../devicetree/bindings/spi/cirrus,ep9301-spi.yaml | 70 +
.../bindings/watchdog/cirrus,ep9301-wdt.yaml | 42 +
arch/arm/Makefile | 1 -
arch/arm/boot/dts/cirrus/Makefile | 4 +
arch/arm/boot/dts/cirrus/ep93xx-bk3.dts | 126 ++
arch/arm/boot/dts/cirrus/ep93xx-edb9302.dts | 182 +++
arch/arm/boot/dts/cirrus/ep93xx-ts7250.dts | 145 ++
arch/arm/boot/dts/cirrus/ep93xx.dtsi | 441 ++++++
arch/arm/mach-ep93xx/Kconfig | 20 +-
arch/arm/mach-ep93xx/Makefile | 11 -
arch/arm/mach-ep93xx/clock.c | 733 ----------
arch/arm/mach-ep93xx/core.c | 1018 --------------
arch/arm/mach-ep93xx/dma.c | 114 --
arch/arm/mach-ep93xx/edb93xx.c | 368 -----
arch/arm/mach-ep93xx/ep93xx-regs.h | 38 -
arch/arm/mach-ep93xx/gpio-ep93xx.h | 111 --
arch/arm/mach-ep93xx/hardware.h | 25 -
arch/arm/mach-ep93xx/irqs.h | 76 --
arch/arm/mach-ep93xx/platform.h | 42 -
arch/arm/mach-ep93xx/soc.h | 212 ---
arch/arm/mach-ep93xx/timer-ep93xx.c | 143 --
arch/arm/mach-ep93xx/ts72xx.c | 422 ------
arch/arm/mach-ep93xx/ts72xx.h | 94 --
arch/arm/mach-ep93xx/vision_ep9307.c | 321 -----
drivers/ata/pata_ep93xx.c | 107 +-
drivers/clk/Kconfig | 8 +
drivers/clk/Makefile | 1 +
drivers/clk/clk-ep93xx.c | 840 ++++++++++++
drivers/dma/ep93xx_dma.c | 287 +++-
drivers/gpio/gpio-ep93xx.c | 345 ++---
drivers/input/keyboard/ep93xx_keypad.c | 74 +-
drivers/mtd/nand/raw/Kconfig | 6 +
drivers/mtd/nand/raw/Makefile | 1 +
drivers/mtd/nand/raw/technologic-nand-controller.c | 222 +++
drivers/net/ethernet/cirrus/ep93xx_eth.c | 63 +-
drivers/pinctrl/Kconfig | 7 +
drivers/pinctrl/Makefile | 1 +
drivers/pinctrl/pinctrl-ep93xx.c | 1434 ++++++++++++++++++++
drivers/power/reset/Kconfig | 10 +
drivers/power/reset/Makefile | 1 +
drivers/power/reset/ep93xx-restart.c | 84 ++
drivers/pwm/pwm-ep93xx.c | 26 +-
drivers/soc/Kconfig | 1 +
drivers/soc/Makefile | 1 +
drivers/soc/cirrus/Kconfig | 13 +
drivers/soc/cirrus/Makefile | 2 +
drivers/soc/cirrus/soc-ep93xx.c | 240 ++++
drivers/spi/spi-ep93xx.c | 66 +-
drivers/watchdog/ep93xx_wdt.c | 8 +
drivers/watchdog/ts72xx_wdt.c | 8 +
include/dt-bindings/clock/cirrus,ep9301-syscon.h | 46 +
include/linux/platform_data/dma-ep93xx.h | 94 --
include/linux/platform_data/eth-ep93xx.h | 10 -
include/linux/platform_data/keypad-ep93xx.h | 32 -
include/linux/platform_data/spi-ep93xx.h | 15 -
include/linux/soc/cirrus/ep93xx.h | 47 +-
sound/soc/cirrus/Kconfig | 9 -
sound/soc/cirrus/Makefile | 4 -
sound/soc/cirrus/edb93xx.c | 116 --
sound/soc/cirrus/ep93xx-i2s.c | 19 -
sound/soc/cirrus/ep93xx-pcm.c | 19 +-
71 files changed, 5138 insertions(+), 4550 deletions(-)
---
base-commit: d206a76d7d2726f3b096037f2079ce0bd3ba329b
change-id: 20230605-ep93xx-01c76317e2d2
Best regards,
--
Nikita Shubin <nikita.shubin@maquefel.me>
^ permalink raw reply
* [PATCH v8 22/38] dt-bindings: input: Add Cirrus EP93xx keypad
From: Nikita Shubin via B4 Relay @ 2024-02-26 7:30 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alexander Sverdlin
Cc: linux-input, devicetree, linux-kernel, Arnd Bergmann,
Krzysztof Kozlowski
In-Reply-To: <20240226-ep93xx-v8-0-3136dca7238f@maquefel.me>
From: Nikita Shubin <nikita.shubin@maquefel.me>
Add YAML bindings for ep93xx SoC keypad.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
.../bindings/input/cirrus,ep9307-keypad.yaml | 87 ++++++++++++++++++++++
1 file changed, 87 insertions(+)
diff --git a/Documentation/devicetree/bindings/input/cirrus,ep9307-keypad.yaml b/Documentation/devicetree/bindings/input/cirrus,ep9307-keypad.yaml
new file mode 100644
index 000000000000..a0d2460c55ab
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/cirrus,ep9307-keypad.yaml
@@ -0,0 +1,87 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/cirrus,ep9307-keypad.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cirrus ep93xx keypad
+
+maintainers:
+ - Alexander Sverdlin <alexander.sverdlin@gmail.com>
+
+allOf:
+ - $ref: /schemas/input/matrix-keymap.yaml#
+
+description:
+ The KPP is designed to interface with a keypad matrix with 2-point contact
+ or 3-point contact keys. The KPP is designed to simplify the software task
+ of scanning a keypad matrix. The KPP is capable of detecting, debouncing,
+ and decoding one or multiple keys pressed simultaneously on a keypad.
+
+properties:
+ compatible:
+ oneOf:
+ - const: cirrus,ep9307-keypad
+ - items:
+ - enum:
+ - cirrus,ep9312-keypad
+ - cirrus,ep9315-keypad
+ - const: cirrus,ep9307-keypad
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ debounce-delay-ms:
+ description: |
+ Time in microseconds that key must be pressed or
+ released for state change interrupt to trigger.
+
+ cirrus,prescale:
+ description: row/column counter pre-scaler load value
+ $ref: /schemas/types.yaml#/definitions/uint16
+ maximum: 1023
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - linux,keymap
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/input/input.h>
+ #include <dt-bindings/clock/cirrus,ep9301-syscon.h>
+ keypad@800f0000 {
+ compatible = "cirrus,ep9307-keypad";
+ reg = <0x800f0000 0x0c>;
+ interrupt-parent = <&vic0>;
+ interrupts = <29>;
+ clocks = <&eclk EP93XX_CLK_KEYPAD>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&keypad_default_pins>;
+ linux,keymap = <KEY_UP>,
+ <KEY_DOWN>,
+ <KEY_VOLUMEDOWN>,
+ <KEY_HOME>,
+ <KEY_RIGHT>,
+ <KEY_LEFT>,
+ <KEY_ENTER>,
+ <KEY_VOLUMEUP>,
+ <KEY_F6>,
+ <KEY_F8>,
+ <KEY_F9>,
+ <KEY_F10>,
+ <KEY_F1>,
+ <KEY_F2>,
+ <KEY_F3>,
+ <KEY_POWER>;
+ };
--
2.41.0
^ permalink raw reply related
* [PATCH v8 23/38] input: keypad: ep93xx: add DT support for Cirrus EP93xx
From: Nikita Shubin via B4 Relay @ 2024-02-26 7:30 UTC (permalink / raw)
To: Hartley Sweeten, Alexander Sverdlin, Russell King,
Dmitry Torokhov, Uwe Kleine-König, Nikita Shubin,
Linus Walleij, Thierry Reding
Cc: Damien Le Moal, Andy Shevchenko, linux-arm-kernel, linux-kernel,
linux-input, Arnd Bergmann
In-Reply-To: <20240226-ep93xx-v8-0-3136dca7238f@maquefel.me>
From: Nikita Shubin <nikita.shubin@maquefel.me>
- drop flags, they were not used anyway
- add OF ID match table
- process "autorepeat", "debounce-delay-ms", prescale from device tree
- drop platform data usage and it's header
- keymap goes from device tree now on
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
arch/arm/mach-ep93xx/core.c | 46 ---------------------
drivers/input/keyboard/ep93xx_keypad.c | 74 ++++++++++------------------------
include/linux/soc/cirrus/ep93xx.h | 4 --
3 files changed, 22 insertions(+), 102 deletions(-)
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 03bce5e9d1f1..b99c46d22c4d 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -697,52 +697,6 @@ void __init ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data)
platform_device_register(&ep93xx_keypad_device);
}
-int ep93xx_keypad_acquire_gpio(struct platform_device *pdev)
-{
- int err;
- int i;
-
- for (i = 0; i < 8; i++) {
- err = gpio_request(EP93XX_GPIO_LINE_C(i), dev_name(&pdev->dev));
- if (err)
- goto fail_gpio_c;
- err = gpio_request(EP93XX_GPIO_LINE_D(i), dev_name(&pdev->dev));
- if (err)
- goto fail_gpio_d;
- }
-
- /* Enable the keypad controller; GPIO ports C and D used for keypad */
- ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_KEYS |
- EP93XX_SYSCON_DEVCFG_GONK);
-
- return 0;
-
-fail_gpio_d:
- gpio_free(EP93XX_GPIO_LINE_C(i));
-fail_gpio_c:
- for (--i; i >= 0; --i) {
- gpio_free(EP93XX_GPIO_LINE_C(i));
- gpio_free(EP93XX_GPIO_LINE_D(i));
- }
- return err;
-}
-EXPORT_SYMBOL(ep93xx_keypad_acquire_gpio);
-
-void ep93xx_keypad_release_gpio(struct platform_device *pdev)
-{
- int i;
-
- for (i = 0; i < 8; i++) {
- gpio_free(EP93XX_GPIO_LINE_C(i));
- gpio_free(EP93XX_GPIO_LINE_D(i));
- }
-
- /* Disable the keypad controller; GPIO ports C and D used for GPIO */
- ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_KEYS |
- EP93XX_SYSCON_DEVCFG_GONK);
-}
-EXPORT_SYMBOL(ep93xx_keypad_release_gpio);
-
/*************************************************************************
* EP93xx I2S audio peripheral handling
*************************************************************************/
diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
index 6b811d6bf625..8159134946b3 100644
--- a/drivers/input/keyboard/ep93xx_keypad.c
+++ b/drivers/input/keyboard/ep93xx_keypad.c
@@ -6,20 +6,13 @@
*
* Based on the pxa27x matrix keypad controller by Rodolfo Giometti.
*
- * NOTE:
- *
- * The 3-key reset is triggered by pressing the 3 keys in
- * Row 0, Columns 2, 4, and 7 at the same time. This action can
- * be disabled by setting the EP93XX_KEYPAD_DISABLE_3_KEY flag.
- *
- * Normal operation for the matrix does not autorepeat the key press.
- * This action can be enabled by setting the EP93XX_KEYPAD_AUTOREPEAT
- * flag.
*/
#include <linux/bits.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/interrupt.h>
#include <linux/clk.h>
#include <linux/io.h>
@@ -27,7 +20,6 @@
#include <linux/input/matrix_keypad.h>
#include <linux/slab.h>
#include <linux/soc/cirrus/ep93xx.h>
-#include <linux/platform_data/keypad-ep93xx.h>
#include <linux/pm_wakeirq.h>
/*
@@ -61,12 +53,16 @@
#define KEY_REG_KEY1_MASK GENMASK(5, 0)
#define KEY_REG_KEY1_SHIFT 0
+#define EP93XX_MATRIX_ROWS (8)
+#define EP93XX_MATRIX_COLS (8)
+
#define EP93XX_MATRIX_SIZE (EP93XX_MATRIX_ROWS * EP93XX_MATRIX_COLS)
struct ep93xx_keypad {
- struct ep93xx_keypad_platform_data *pdata;
struct input_dev *input_dev;
struct clk *clk;
+ unsigned int debounce;
+ uint16_t prescale;
void __iomem *mmio_base;
@@ -133,23 +129,11 @@ static irqreturn_t ep93xx_keypad_irq_handler(int irq, void *dev_id)
static void ep93xx_keypad_config(struct ep93xx_keypad *keypad)
{
- struct ep93xx_keypad_platform_data *pdata = keypad->pdata;
unsigned int val = 0;
- clk_set_rate(keypad->clk, pdata->clk_rate);
+ val |= (keypad->debounce << KEY_INIT_DBNC_SHIFT) & KEY_INIT_DBNC_MASK;
- if (pdata->flags & EP93XX_KEYPAD_DISABLE_3_KEY)
- val |= KEY_INIT_DIS3KY;
- if (pdata->flags & EP93XX_KEYPAD_DIAG_MODE)
- val |= KEY_INIT_DIAG;
- if (pdata->flags & EP93XX_KEYPAD_BACK_DRIVE)
- val |= KEY_INIT_BACK;
- if (pdata->flags & EP93XX_KEYPAD_TEST_MODE)
- val |= KEY_INIT_T2;
-
- val |= ((pdata->debounce << KEY_INIT_DBNC_SHIFT) & KEY_INIT_DBNC_MASK);
-
- val |= ((pdata->prescale << KEY_INIT_PRSCL_SHIFT) & KEY_INIT_PRSCL_MASK);
+ val |= (keypad->prescale << KEY_INIT_PRSCL_SHIFT) & KEY_INIT_PRSCL_MASK;
__raw_writel(val, keypad->mmio_base + KEY_INIT);
}
@@ -220,17 +204,10 @@ static int ep93xx_keypad_resume(struct device *dev)
static DEFINE_SIMPLE_DEV_PM_OPS(ep93xx_keypad_pm_ops,
ep93xx_keypad_suspend, ep93xx_keypad_resume);
-static void ep93xx_keypad_release_gpio_action(void *_pdev)
-{
- struct platform_device *pdev = _pdev;
-
- ep93xx_keypad_release_gpio(pdev);
-}
-
static int ep93xx_keypad_probe(struct platform_device *pdev)
{
+ struct device *dev = &pdev->dev;
struct ep93xx_keypad *keypad;
- const struct matrix_keymap_data *keymap_data;
struct input_dev *input_dev;
int err;
@@ -238,14 +215,6 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
if (!keypad)
return -ENOMEM;
- keypad->pdata = dev_get_platdata(&pdev->dev);
- if (!keypad->pdata)
- return -EINVAL;
-
- keymap_data = keypad->pdata->keymap_data;
- if (!keymap_data)
- return -EINVAL;
-
keypad->irq = platform_get_irq(pdev, 0);
if (keypad->irq < 0)
return keypad->irq;
@@ -254,19 +223,13 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
if (IS_ERR(keypad->mmio_base))
return PTR_ERR(keypad->mmio_base);
- err = ep93xx_keypad_acquire_gpio(pdev);
- if (err)
- return err;
-
- err = devm_add_action_or_reset(&pdev->dev,
- ep93xx_keypad_release_gpio_action, pdev);
- if (err)
- return err;
-
keypad->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(keypad->clk))
return PTR_ERR(keypad->clk);
+ device_property_read_u32(dev, "debounce-delay-ms", &keypad->debounce);
+ device_property_read_u16(dev, "cirrus,prescale", &keypad->prescale);
+
input_dev = devm_input_allocate_device(&pdev->dev);
if (!input_dev)
return -ENOMEM;
@@ -278,13 +241,13 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
input_dev->open = ep93xx_keypad_open;
input_dev->close = ep93xx_keypad_close;
- err = matrix_keypad_build_keymap(keymap_data, NULL,
+ err = matrix_keypad_build_keymap(NULL, NULL,
EP93XX_MATRIX_ROWS, EP93XX_MATRIX_COLS,
keypad->keycodes, input_dev);
if (err)
return err;
- if (keypad->pdata->flags & EP93XX_KEYPAD_AUTOREPEAT)
+ if (device_property_read_bool(&pdev->dev, "autorepeat"))
__set_bit(EV_REP, input_dev->evbit);
input_set_drvdata(input_dev, keypad);
@@ -313,10 +276,17 @@ static void ep93xx_keypad_remove(struct platform_device *pdev)
dev_pm_clear_wake_irq(&pdev->dev);
}
+static const struct of_device_id ep93xx_keypad_of_ids[] = {
+ { .compatible = "cirrus,ep9307-keypad" },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, ep93xx_keypad_of_ids);
+
static struct platform_driver ep93xx_keypad_driver = {
.driver = {
.name = "ep93xx-keypad",
.pm = pm_sleep_ptr(&ep93xx_keypad_pm_ops),
+ .of_match_table = ep93xx_keypad_of_ids,
},
.probe = ep93xx_keypad_probe,
.remove_new = ep93xx_keypad_remove,
diff --git a/include/linux/soc/cirrus/ep93xx.h b/include/linux/soc/cirrus/ep93xx.h
index a27447971302..8942bfaf1545 100644
--- a/include/linux/soc/cirrus/ep93xx.h
+++ b/include/linux/soc/cirrus/ep93xx.h
@@ -41,8 +41,6 @@ int ep93xx_pwm_acquire_gpio(struct platform_device *pdev);
void ep93xx_pwm_release_gpio(struct platform_device *pdev);
int ep93xx_ide_acquire_gpio(struct platform_device *pdev);
void ep93xx_ide_release_gpio(struct platform_device *pdev);
-int ep93xx_keypad_acquire_gpio(struct platform_device *pdev);
-void ep93xx_keypad_release_gpio(struct platform_device *pdev);
int ep93xx_i2s_acquire(void);
void ep93xx_i2s_release(void);
unsigned int ep93xx_chip_revision(void);
@@ -52,8 +50,6 @@ static inline int ep93xx_pwm_acquire_gpio(struct platform_device *pdev) { return
static inline void ep93xx_pwm_release_gpio(struct platform_device *pdev) {}
static inline int ep93xx_ide_acquire_gpio(struct platform_device *pdev) { return 0; }
static inline void ep93xx_ide_release_gpio(struct platform_device *pdev) {}
-static inline int ep93xx_keypad_acquire_gpio(struct platform_device *pdev) { return 0; }
-static inline void ep93xx_keypad_release_gpio(struct platform_device *pdev) {}
static inline int ep93xx_i2s_acquire(void) { return 0; }
static inline void ep93xx_i2s_release(void) {}
static inline unsigned int ep93xx_chip_revision(void) { return 0; }
--
2.41.0
^ permalink raw reply related
* [PATCH] dt-bindings: input: allwinner,sun4i-a10-lrad: drop redundant type from label
From: Krzysztof Kozlowski @ 2024-02-26 12:29 UTC (permalink / raw)
To: Hans de Goede, Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard, linux-input, devicetree, linux-arm-kernel,
linux-sunxi, linux-kernel
Cc: Krzysztof Kozlowski
dtschema defines label as string, so $ref in other bindings is
redundant.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
.../bindings/input/allwinner,sun4i-a10-lradc-keys.yaml | 1 -
1 file changed, 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml b/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
index 5efceb313879..c384bf0bb25d 100644
--- a/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
+++ b/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
@@ -49,7 +49,6 @@ patternProperties:
$ref: input.yaml#
properties:
label:
- $ref: /schemas/types.yaml#/definitions/string
description: Descriptive name of the key
linux,code: true
--
2.34.1
^ permalink raw reply related
* Re: [PATCH 0/2] map Fn + R key on newer Yogas and Legions
From: Ilpo Järvinen @ 2024-02-26 13:27 UTC (permalink / raw)
To: Ike Panhc, Hans de Goede, Dmitry Torokhov, Philipp Jungkamp,
Gergo Koteles
Cc: platform-driver-x86, linux-kernel, linux-input
In-Reply-To: <cover.1708399689.git.soyer@irl.hu>
On Tue, 20 Feb 2024 04:39:34 +0100, Gergo Koteles wrote:
> This patch series adds a new KEY_FN_R input event code and map the
> Fn + R key to it in the ideapad-laptop driver.
>
> It affects two WMI keycodes and I couldn't try the 0x0a, but I couldn't
> find any indication that the refresh rate toggle should not be Fn + R.
>
> Regards,
> Gergo
>
> [...]
Thank you for your contribution, it has been applied to my local
review-ilpo branch. Note it will show up in the public
platform-drivers-x86/review-ilpo branch only once I've pushed my
local branch there, which might take a while.
The list of commits applied:
[1/2] Input: allocate keycode for Fn + R
commit: 4e45fa464aeef4e803412b5dcce73aad48c94b0e
[2/2] platform/x86: ideapad-laptop: map Fn + R key to KEY_FN_R
commit: cd4525993e49f1449e9380bd28fa1179b05c911d
--
i.
^ permalink raw reply
* Re: [PATCH v8 00/38] ep93xx device tree conversion
From: Mark Brown @ 2024-02-26 13:34 UTC (permalink / raw)
To: nikita.shubin
Cc: Hartley Sweeten, Alexander Sverdlin, Russell King,
Lukasz Majewski, Linus Walleij, Bartosz Golaszewski,
Andy Shevchenko, Michael Turquette, Stephen Boyd,
Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Vinod Koul, Wim Van Sebroeck, Guenter Roeck, Thierry Reding,
Uwe Kleine-König, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Damien Le Moal, Sergey Shtylyov,
Dmitry Torokhov, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
Ralf Baechle, Wu, Aaron, Lee Jones, Olof Johansson, Niklas Cassel,
linux-arm-kernel, linux-kernel, linux-gpio, linux-clk, linux-pm,
devicetree, dmaengine, linux-watchdog, linux-pwm, linux-spi,
netdev, linux-mtd, linux-ide, linux-input, linux-sound,
Arnd Bergmann, Bartosz Golaszewski, Krzysztof Kozlowski,
Andy Shevchenko, Andrew Lunn, Andy Shevchenko
In-Reply-To: <20240226-ep93xx-v8-0-3136dca7238f@maquefel.me>
[-- Attachment #1: Type: text/plain, Size: 202 bytes --]
On Mon, Feb 26, 2024 at 10:29:56AM +0300, Nikita Shubin via B4 Relay wrote:
> The goal is to receive ACKs for all patches in series to merge it via Arnd branch.
What are the actual dependencies here?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [PATCH v8 23/38] input: keypad: ep93xx: add DT support for Cirrus EP93xx
From: Andy Shevchenko @ 2024-02-26 14:42 UTC (permalink / raw)
To: nikita.shubin
Cc: Hartley Sweeten, Alexander Sverdlin, Russell King,
Dmitry Torokhov, Uwe Kleine-König, Linus Walleij,
Thierry Reding, Damien Le Moal, linux-arm-kernel, linux-kernel,
linux-input, Arnd Bergmann
In-Reply-To: <20240226-ep93xx-v8-23-3136dca7238f@maquefel.me>
On Mon, Feb 26, 2024 at 10:30:19AM +0300, Nikita Shubin via B4 Relay wrote:
> From: Nikita Shubin <nikita.shubin@maquefel.me>
>
> - drop flags, they were not used anyway
> - add OF ID match table
> - process "autorepeat", "debounce-delay-ms", prescale from device tree
> - drop platform data usage and it's header
> - keymap goes from device tree now on
...
> struct ep93xx_keypad {
> - struct ep93xx_keypad_platform_data *pdata;
> struct input_dev *input_dev;
> struct clk *clk;
> + unsigned int debounce;
> + uint16_t prescale;
In case you need to send a new version note that the indentation of the fields
is different here. Also uint16_t is not the type we expect to see usually
(does the file use it already?). In kernel we have u16.
> void __iomem *mmio_base;
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH] dt-bindings: input: allwinner,sun4i-a10-lrad: drop redundant type from label
From: Jernej Škrabec @ 2024-02-26 17:31 UTC (permalink / raw)
To: Hans de Goede, Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Chen-Yu Tsai, Samuel Holland, Maxime Ripard,
linux-input, devicetree, linux-arm-kernel, linux-sunxi,
linux-kernel, Krzysztof Kozlowski
Cc: Krzysztof Kozlowski
In-Reply-To: <20240226122934.89257-1-krzysztof.kozlowski@linaro.org>
Dne ponedeljek, 26. februar 2024 ob 13:29:34 CET je Krzysztof Kozlowski napisal(a):
> dtschema defines label as string, so $ref in other bindings is
> redundant.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
I already send PR for 6.9. Do you mind if it waits on next cycle?
Best regards,
Jernej
> ---
> .../bindings/input/allwinner,sun4i-a10-lradc-keys.yaml | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml b/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
> index 5efceb313879..c384bf0bb25d 100644
> --- a/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
> +++ b/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
> @@ -49,7 +49,6 @@ patternProperties:
> $ref: input.yaml#
> properties:
> label:
> - $ref: /schemas/types.yaml#/definitions/string
> description: Descriptive name of the key
>
> linux,code: true
>
^ permalink raw reply
* Re: [PATCH 3/4] Input: leds: Prepare for removal of config option LEDS_AUDIO_TRIGGER
From: Dmitry Torokhov @ 2024-02-26 17:49 UTC (permalink / raw)
To: Heiner Kallweit
Cc: Pavel Machek, Lee Jones, Jaroslav Kysela, Takashi Iwai,
Thomas Bogendoerfer, linux-leds@vger.kernel.org, linux-sound,
open list:HID CORE LAYER, linux-mips
In-Reply-To: <a2544b2b-265d-499b-b235-e4075a9ef398@gmail.com>
On Sat, Feb 24, 2024 at 10:31:17AM +0100, Heiner Kallweit wrote:
> On 24.02.2024 00:23, Dmitry Torokhov wrote:
> > On Tue, Feb 13, 2024 at 08:33:24AM +0100, Heiner Kallweit wrote:
> >> In a follow-up patch handling of the LED audio trigger will be changed,
> >> including removal of config symbol LEDS_AUDIO_TRIGGER. Therefore set
> >> the default trigger unconditionally to "audio-mute". It does no harm
> >> if a default trigger doesn't exist.
> >>
> >> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> >> ---
> >> drivers/input/input-leds.c | 8 +-------
> >> 1 file changed, 1 insertion(+), 7 deletions(-)
> >>
> >> diff --git a/drivers/input/input-leds.c b/drivers/input/input-leds.c
> >> index b16fc8194..176f1da7f 100644
> >> --- a/drivers/input/input-leds.c
> >> +++ b/drivers/input/input-leds.c
> >> @@ -18,12 +18,6 @@
> >> #define VT_TRIGGER(_name) .trigger = NULL
> >> #endif
> >>
> >> -#if IS_ENABLED(CONFIG_LEDS_TRIGGER_AUDIO)
> >
> > Should it be simply changed to CONFIG_SND_CTL_LED?
> >
> This would be another option. What is better IMO is a matter of
> personal taste. Setting the default trigger unconditionally may
> cause a negligible runtime overhead when the LED is instantiated,
> on the other hand it results in less code to be maintained.
> Do you have a preference?
I am less concerned about overhead than setting a non-existent default
trigger if the functionality is disabled. I would prefer having the
#ifdef.
Thanks.
--
Dmitry
^ permalink raw reply
* [PATCH] HID: nintendo: Fix N64 controller being identified as mouse
From: Nuno Pereira @ 2024-02-26 22:39 UTC (permalink / raw)
To: linux-input@vger.kernel.org
Cc: Daniel Ogorchock, Ryan McClelland, benjamin.tissoires@redhat.com,
jikos@kernel.org
This patch is regarding the recent addition of support for the NSO
controllers to hid-nintendo. All controllers are working correctly with the
exception of the N64 controller, which is being identified as a mouse by
udev. This results in the joystick controlling the mouse cursor and the
controller not being detected by games.
The reason for this is because the N64's C buttons have been attributed to
BTN_FORWARD, BTN_BACK, BTN_LEFT, BTN_RIGHT, which are buttons typically
attributed to mice.
This patch changes those buttons to controller buttons, making the
controller be correctly identified as such.
Signed-off-by: Nuno Pereira <nf.pereira@outlook.pt>
---
drivers/hid/hid-nintendo.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index ccc4032fb2b0..4b2c81b49b80 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -481,10 +481,10 @@ static const struct joycon_ctlr_button_mapping n64con_button_mappings[] = {
{ BTN_TR, JC_BTN_R, },
{ BTN_TR2, JC_BTN_LSTICK, }, /* ZR */
{ BTN_START, JC_BTN_PLUS, },
- { BTN_FORWARD, JC_BTN_Y, }, /* C UP */
- { BTN_BACK, JC_BTN_ZR, }, /* C DOWN */
- { BTN_LEFT, JC_BTN_X, }, /* C LEFT */
- { BTN_RIGHT, JC_BTN_MINUS, }, /* C RIGHT */
+ { BTN_SELECT, JC_BTN_Y, }, /* C UP */
+ { BTN_X, JC_BTN_ZR, }, /* C DOWN */
+ { BTN_Y, JC_BTN_X, }, /* C LEFT */
+ { BTN_C, JC_BTN_MINUS, }, /* C RIGHT */
{ BTN_MODE, JC_BTN_HOME, },
{ BTN_Z, JC_BTN_CAP, },
{ /* sentinel */ },
--
2.43.2
^ permalink raw reply related
* Re: [PATCH] dt-bindings: input: allwinner,sun4i-a10-lrad: drop redundant type from label
From: Rob Herring @ 2024-02-27 3:50 UTC (permalink / raw)
To: Jernej Škrabec
Cc: Hans de Goede, Dmitry Torokhov, Krzysztof Kozlowski, Conor Dooley,
Chen-Yu Tsai, Samuel Holland, Maxime Ripard, linux-input,
devicetree, linux-arm-kernel, linux-sunxi, linux-kernel,
Krzysztof Kozlowski
In-Reply-To: <3207352.5fSG56mABF@jernej-laptop>
On Mon, Feb 26, 2024 at 06:31:38PM +0100, Jernej Škrabec wrote:
> Dne ponedeljek, 26. februar 2024 ob 13:29:34 CET je Krzysztof Kozlowski napisal(a):
> > dtschema defines label as string, so $ref in other bindings is
> > redundant.
> >
> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
>
> I already send PR for 6.9. Do you mind if it waits on next cycle?
This should go via input tree, not allwinner.
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply
* Re: [PATCH] dt-bindings: input: allwinner,sun4i-a10-lrad: drop redundant type from label
From: Krzysztof Kozlowski @ 2024-02-27 6:48 UTC (permalink / raw)
To: Jernej Škrabec, Hans de Goede, Dmitry Torokhov, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai, Samuel Holland,
Maxime Ripard, linux-input, devicetree, linux-arm-kernel,
linux-sunxi, linux-kernel
In-Reply-To: <3207352.5fSG56mABF@jernej-laptop>
On 26/02/2024 18:31, Jernej Škrabec wrote:
> Dne ponedeljek, 26. februar 2024 ob 13:29:34 CET je Krzysztof Kozlowski napisal(a):
>> dtschema defines label as string, so $ref in other bindings is
>> redundant.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
>
> I already send PR for 6.9. Do you mind if it waits on next cycle?
Yes.
Best regards,
Krzysztof
^ permalink raw reply
* Re: [PATCH] dt-bindings: input: allwinner,sun4i-a10-lrad: drop redundant type from label
From: Krzysztof Kozlowski @ 2024-02-27 6:49 UTC (permalink / raw)
To: Jernej Škrabec, Hans de Goede, Dmitry Torokhov, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai, Samuel Holland,
Maxime Ripard, linux-input, devicetree, linux-arm-kernel,
linux-sunxi, linux-kernel
In-Reply-To: <907d61f3-4c9e-42b6-b314-927fd77e0b94@linaro.org>
On 27/02/2024 07:48, Krzysztof Kozlowski wrote:
> On 26/02/2024 18:31, Jernej Škrabec wrote:
>> Dne ponedeljek, 26. februar 2024 ob 13:29:34 CET je Krzysztof Kozlowski napisal(a):
>>> dtschema defines label as string, so $ref in other bindings is
>>> redundant.
>>>
>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>
>> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
>>
>> I already send PR for 6.9. Do you mind if it waits on next cycle?
>
> Yes.
Damn English. I don't mind, but as Rob pointed this is patch for input.
Best regards,
Krzysztof
^ permalink raw reply
* Re: [PATCH 0/5] Fixes and updates to amd-sfh
From: Jiri Kosina @ 2024-02-27 14:14 UTC (permalink / raw)
To: Basavaraj Natikar; +Cc: benjamin.tissoires, linux-input, akshata.mukundshetty
In-Reply-To: <20240214144144.682750-1-Basavaraj.Natikar@amd.com>
On Wed, 14 Feb 2024, Basavaraj Natikar wrote:
> This patch series include changes for:
> - Increase sensor command timeout.
> - Update HPD sensor structure elements.
> - Avoid disabling the interrupt.
> - Improve boot time.
> - Extend MP2 register access.
>
> Basavaraj Natikar (5):
> HID: amd_sfh: Increase sensor command timeout
> HID: amd_sfh: Update HPD sensor structure elements
> HID: amd_sfh: Avoid disabling the interrupt
> HID: amd_sfh: Improve boot time when SFH is available
> HID: amd_sfh: Extend MP2 register access to SFH
>
> drivers/hid/amd-sfh-hid/amd_sfh_common.h | 16 +++
> drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 118 ++++++++++++++----
> drivers/hid/amd-sfh-hid/amd_sfh_pcie.h | 6 +-
> drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c | 2 +-
> drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 4 +-
> .../amd-sfh-hid/sfh1_1/amd_sfh_interface.c | 10 +-
> 6 files changed, 124 insertions(+), 32 deletions(-)
Now queued in hid.git#for-6.9/amd-sfh. Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH] HID: input: avoid polling stylus battery on Chromebook Pompom
From: Jiri Kosina @ 2024-02-27 14:18 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Benjamin Tissoires, kenalba, dianders, linux-input, linux-kernel
In-Reply-To: <ZdknA5qa8B-nB6ta@google.com>
On Fri, 23 Feb 2024, Dmitry Torokhov wrote:
> Internal touchscreen on Trogdor Pompom (AKA Dynabook Chromebook C1)
> supports USI stylus. Unfortunately the HID descriptor for the stylus
> interface does not contain "Stylus" physical collection, which makes
> the kernel to try and pull battery information, resulting in errors.
>
> Apply HID_BATTERY_QUIRK_AVOID_QUERY to the device.
Applied, thanks Dmitry.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH RFC bpf-next v3 04/16] bpf/helpers: introduce sleepable bpf_timers
From: Benjamin Tissoires @ 2024-02-27 14:27 UTC (permalink / raw)
To: Eduard Zingerman
Cc: Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Jiri Kosina,
Benjamin Tissoires, Jonathan Corbet, Shuah Khan, bpf,
linux-kernel, linux-input, linux-doc, linux-kselftest
In-Reply-To: <818e43447651af1a659993897c14d05fec5038e4.camel@gmail.com>
On Feb 23 2024, Eduard Zingerman wrote:
> On Wed, 2024-02-21 at 17:25 +0100, Benjamin Tissoires wrote:
>
> [...]
>
> > @@ -1282,7 +1333,7 @@ BPF_CALL_3(bpf_timer_start, struct bpf_timer_kern *, timer, u64, nsecs, u64, fla
> >
> > if (in_nmi())
> > return -EOPNOTSUPP;
> > - if (flags & ~(BPF_F_TIMER_ABS | BPF_F_TIMER_CPU_PIN))
> > + if (flags & ~(BPF_F_TIMER_ABS | BPF_F_TIMER_CPU_PIN | BPF_F_TIMER_SLEEPABLE))
> > return -EINVAL;
> > __bpf_spin_lock_irqsave(&timer->lock);
> > t = timer->timer;
> > @@ -1299,7 +1350,10 @@ BPF_CALL_3(bpf_timer_start, struct bpf_timer_kern *, timer, u64, nsecs, u64, fla
> > if (flags & BPF_F_TIMER_CPU_PIN)
> > mode |= HRTIMER_MODE_PINNED;
> >
> > - hrtimer_start(&t->timer, ns_to_ktime(nsecs), mode);
> > + if (flags & BPF_F_TIMER_SLEEPABLE)
> > + schedule_work(&t->work);
> > + else
> > + hrtimer_start(&t->timer, ns_to_ktime(nsecs), mode);
>
> It looks like nsecs is simply ignored for sleepable timers.
> Should this be hrtimer_start() that waits nsecs and schedules work,
> or schedule_delayed_work()? (but it takes delay in jiffies, which is
> probably too coarse). Sorry if I miss something.
Yeah, I agree it's confusing, but as mentioned by Toke in his reply, we
should return -EINVAL if a timer value is provided (for now).
Alexei mentioned[0] that he didn't want to mix delays in hrtimers with
workqueue as they are non deterministic. So AFAIU, I should add the only
guarantee we can provide: a sleepable context, and proper delays in
sleepable contexts will be added once we have a better workqueue
selection available.
Cheers,
Benjamin
[0] https://lore.kernel.org/bpf/CAO-hwJKz+eRA+BFLANTrEqz2jQAOANTE3c7eqNJ6wDqJR7jMiQ@mail.gmail.com/T/#md15e431cbcddec9fcaddf1c305234523ed26f7ce
^ permalink raw reply
* [syzbot] [usb?] [input?] WARNING in __input_unregister_device
From: syzbot @ 2024-02-27 16:12 UTC (permalink / raw)
To: gregkh, linux-input, linux-kernel, linux-usb, rafael,
syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 9abbc24128bc Merge branch 'for-next/core' into for-kernelci
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
console output: https://syzkaller.appspot.com/x/log.txt?x=1432aac4180000
kernel config: https://syzkaller.appspot.com/x/.config?x=af5c6c699e57bbb3
dashboard link: https://syzkaller.appspot.com/bug?extid=b03b0fc32e288051502d
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=147aa106180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=150f8e22180000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ce13ec3ed5ad/disk-9abbc241.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/256cbd314121/vmlinux-9abbc241.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0af86fb52109/Image-9abbc241.gz.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+b03b0fc32e288051502d@syzkaller.appspotmail.com
microsoft 0003:045E:07DA.0009: input,hidraw0: USB HID v0.00 Device [HID 045e:07da] on usb-dummy_hcd.0-1/input0
usb 1-1: USB disconnect, device number 10
------------[ cut here ]------------
add_uevent_var: buffer size too small
WARNING: CPU: 1 PID: 1394 at lib/kobject_uevent.c:671 add_uevent_var+0x278/0x3c0
Modules linked in:
CPU: 1 PID: 1394 Comm: kworker/1:2 Tainted: G B 6.8.0-rc5-syzkaller-g9abbc24128bc #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Workqueue: usb_hub_wq hub_event
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : add_uevent_var+0x278/0x3c0
lr : add_uevent_var+0x274/0x3c0 lib/kobject_uevent.c:671
sp : ffff800098486c80
x29: ffff800098486da0 x28: 000000000000000c x27: ffff700013090d9c
x26: dfff800000000000 x25: ffff0000c8e02a10 x24: 000000000000000c
x23: 00000000000007f4 x22: 000000000000000c x21: ffff0000c8e02218
x20: ffff0000c8e02a1c x19: ffff0000c8e02000 x18: 1fffe00036804796
x17: 0000000000000000 x16: ffff80008ad5bbdc x15: 0000000000000001
x14: 1fffe00036804802 x13: 0000000000000000 x12: 0000000000000000
x11: 0000000000000002 x10: 0000000000ff0100 x9 : c77e75592b5e9e00
x8 : c77e75592b5e9e00 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff800098486578 x4 : ffff80008ed715e0 x3 : ffff8000805b98b4
x2 : 0000000000000001 x1 : 0000000100000000 x0 : 00000000fffffff4
Call trace:
add_uevent_var+0x278/0x3c0
kobject_uevent_env+0x4f0/0x874 lib/kobject_uevent.c:588
kobject_uevent+0x2c/0x3c lib/kobject_uevent.c:642
device_del+0x6a8/0x87c drivers/base/core.c:3846
__input_unregister_device+0x454/0x5c0 drivers/input/input.c:2232
input_unregister_device+0xb0/0xfc drivers/input/input.c:2440
hidinput_disconnect+0x1fc/0x290 drivers/hid/hid-input.c:2388
hid_disconnect drivers/hid/hid-core.c:2280 [inline]
hid_hw_stop+0x88/0x1cc drivers/hid/hid-core.c:2329
ms_remove+0x28/0x94 drivers/hid/hid-microsoft.c:409
hid_device_remove+0x1c8/0x2fc
device_remove drivers/base/dd.c:567 [inline]
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x3e4/0x6a0 drivers/base/dd.c:1295
device_release_driver+0x28/0x38 drivers/base/dd.c:1318
bus_remove_device+0x314/0x3b4 drivers/base/bus.c:574
device_del+0x480/0x87c drivers/base/core.c:3828
hid_remove_device drivers/hid/hid-core.c:2867 [inline]
hid_destroy_device+0x70/0x114 drivers/hid/hid-core.c:2887
usbhid_disconnect+0xa8/0xf0 drivers/hid/usbhid/hid-core.c:1456
usb_unbind_interface+0x1a4/0x758 drivers/usb/core/driver.c:461
device_remove drivers/base/dd.c:569 [inline]
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x440/0x6a0 drivers/base/dd.c:1295
device_release_driver+0x28/0x38 drivers/base/dd.c:1318
bus_remove_device+0x314/0x3b4 drivers/base/bus.c:574
device_del+0x480/0x87c drivers/base/core.c:3828
usb_disable_device+0x354/0x760 drivers/usb/core/message.c:1416
usb_disconnect+0x290/0x808 drivers/usb/core/hub.c:2267
hub_port_connect drivers/usb/core/hub.c:5323 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5623 [inline]
port_event drivers/usb/core/hub.c:5783 [inline]
hub_event+0x18ec/0x435c drivers/usb/core/hub.c:5865
process_one_work+0x694/0x1204 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x938/0xef4 kernel/workqueue.c:2787
kthread+0x288/0x310 kernel/kthread.c:388
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860
irq event stamp: 71432
hardirqs last enabled at (71431): [<ffff80008ae4d56c>] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline]
hardirqs last enabled at (71431): [<ffff80008ae4d56c>] _raw_spin_unlock_irq+0x30/0x80 kernel/locking/spinlock.c:202
hardirqs last disabled at (71432): [<ffff80008ae372c4>] __schedule+0x2bc/0x24b4 kernel/sched/core.c:6625
softirqs last enabled at (42430): [<ffff80008002189c>] softirq_handle_end kernel/softirq.c:399 [inline]
softirqs last enabled at (42430): [<ffff80008002189c>] __do_softirq+0xac8/0xce4 kernel/softirq.c:582
softirqs last disabled at (42421): [<ffff80008002ab48>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:81
---[ end trace 0000000000000000 ]---
usb 1-1: new high-speed USB device number 11 using dummy_hcd
usb 1-1: Using ep0 maxpacket: 16
usb 1-1: config 0 interface 0 altsetting 0 endpoint 0x81 has an invalid bInterval 0, changing to 7
usb 1-1: config 0 interface 0 altsetting 0 has 1 endpoint descriptor, different from the interface descriptor's value: 9
usb 1-1: New USB device found, idVendor=045e, idProduct=07da, bcdDevice= 0.00
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
usb 1-1: config 0 descriptor??
microsoft 0003:045E:07DA.000A: unknown main item tag 0x0
microsoft 0003:045E:07DA.000A: unknown main item tag 0x0
microsoft 0003:045E:07DA.000A: unknown main item tag 0x0
microsoft 0003:045E:07DA.000A: unknown main item tag 0x0
HID 045e:07da: Invalid code 65791 type 1
input: HID 045e:07da as /devices/platform/dummy_hcd.0/usb1/1-1/1-1:0.0/0003:045E:07DA.000A/input/input11
microsoft 0003:045E:07DA.000A: input,hidraw0: USB HID v0.00 Device [HID 045e:07da] on usb-dummy_hcd.0-1/input0
usb 1-1: USB disconnect, device number 11
------------[ cut here ]------------
add_uevent_var: buffer size too small
WARNING: CPU: 1 PID: 1394 at lib/kobject_uevent.c:671 add_uevent_var+0x278/0x3c0
Modules linked in:
CPU: 1 PID: 1394 Comm: kworker/1:2 Tainted: G B W 6.8.0-rc5-syzkaller-g9abbc24128bc #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Workqueue: usb_hub_wq hub_event
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : add_uevent_var+0x278/0x3c0
lr : add_uevent_var+0x274/0x3c0 lib/kobject_uevent.c:671
sp : ffff800098486c80
x29: ffff800098486da0 x28: 000000000000000c x27: ffff700013090d9c
x26: dfff800000000000 x25: ffff0001ffb5ea10 x24: 000000000000000c
x23: 00000000000007f4 x22: 000000000000000c x21: ffff0001ffb5e218
x20: ffff0001ffb5ea1c x19: ffff0001ffb5e000 x18: 1fffe00036804796
x17: 0000000000000000 x16: ffff80008ad5bbdc x15: 0000000000000001
x14: 1fffe00036804802 x13: 0000000000000000 x12: 0000000000000000
x11: 0000000000000002 x10: 0000000000ff0100 x9 : c77e75592b5e9e00
x8 : c77e75592b5e9e00 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff800098486578 x4 : ffff80008ed715e0 x3 : ffff8000805b98b4
x2 : 0000000000000001 x1 : 0000000100000000 x0 : 00000000fffffff4
Call trace:
add_uevent_var+0x278/0x3c0
kobject_uevent_env+0x4f0/0x874 lib/kobject_uevent.c:588
kobject_uevent+0x2c/0x3c lib/kobject_uevent.c:642
device_del+0x6a8/0x87c drivers/base/core.c:3846
__input_unregister_device+0x454/0x5c0 drivers/input/input.c:2232
input_unregister_device+0xb0/0xfc drivers/input/input.c:2440
hidinput_disconnect+0x1fc/0x290 drivers/hid/hid-input.c:2388
hid_disconnect drivers/hid/hid-core.c:2280 [inline]
hid_hw_stop+0x88/0x1cc drivers/hid/hid-core.c:2329
ms_remove+0x28/0x94 drivers/hid/hid-microsoft.c:409
hid_device_remove+0x1c8/0x2fc
device_remove drivers/base/dd.c:567 [inline]
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x3e4/0x6a0 drivers/base/dd.c:1295
device_release_driver+0x28/0x38 drivers/base/dd.c:1318
bus_remove_device+0x314/0x3b4 drivers/base/bus.c:574
device_del+0x480/0x87c drivers/base/core.c:3828
hid_remove_device drivers/hid/hid-core.c:2867 [inline]
hid_destroy_device+0x70/0x114 drivers/hid/hid-core.c:2887
usbhid_disconnect+0xa8/0xf0 drivers/hid/usbhid/hid-core.c:1456
usb_unbind_interface+0x1a4/0x758 drivers/usb/core/driver.c:461
device_remove drivers/base/dd.c:569 [inline]
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x440/0x6a0 drivers/base/dd.c:1295
device_release_driver+0x28/0x38 drivers/base/dd.c:1318
bus_remove_device+0x314/0x3b4 drivers/base/bus.c:574
device_del+0x480/0x87c drivers/base/core.c:3828
usb_disable_device+0x354/0x760 drivers/usb/core/message.c:1416
usb_disconnect+0x290/0x808 drivers/usb/core/hub.c:2267
hub_port_connect drivers/usb/core/hub.c:5323 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5623 [inline]
port_event drivers/usb/core/hub.c:5783 [inline]
hub_event+0x18ec/0x435c drivers/usb/core/hub.c:5865
process_one_work+0x694/0x1204 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x938/0xef4 kernel/workqueue.c:2787
kthread+0x288/0x310 kernel/kthread.c:388
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860
irq event stamp: 71432
hardirqs last enabled at (71431): [<ffff80008ae4d56c>] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline]
hardirqs last enabled at (71431): [<ffff80008ae4d56c>] _raw_spin_unlock_irq+0x30/0x80 kernel/locking/spinlock.c:202
hardirqs last disabled at (71432): [<ffff80008ae372c4>] __schedule+0x2bc/0x24b4 kernel/sched/core.c:6625
softirqs last enabled at (42430): [<ffff80008002189c>] softirq_handle_end kernel/softirq.c:399 [inline]
softirqs last enabled at (42430): [<ffff80008002189c>] __do_softirq+0xac8/0xce4 kernel/softirq.c:582
softirqs last disabled at (42421): [<ffff80008002ab48>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:81
---[ end trace 0000000000000000 ]---
usb 1-1: new high-speed USB device number 12 using dummy_hcd
usb 1-1: Using ep0 maxpacket: 16
usb 1-1: config 0 interface 0 altsetting 0 endpoint 0x81 has an invalid bInterval 0, changing to 7
usb 1-1: config 0 interface 0 altsetting 0 has 1 endpoint descriptor, different from the interface descriptor's value: 9
usb 1-1: New USB device found, idVendor=045e, idProduct=07da, bcdDevice= 0.00
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
usb 1-1: config 0 descriptor??
microsoft 0003:045E:07DA.000B: unknown main item tag 0x0
microsoft 0003:045E:07DA.000B: unknown main item tag 0x0
microsoft 0003:045E:07DA.000B: unknown main item tag 0x0
microsoft 0003:045E:07DA.000B: unknown main item tag 0x0
HID 045e:07da: Invalid code 65791 type 1
input: HID 045e:07da as /devices/platform/dummy_hcd.0/usb1/1-1/1-1:0.0/0003:045E:07DA.000B/input/input12
microsoft 0003:045E:07DA.000B: input,hidraw0: USB HID v0.00 Device [HID 045e:07da] on usb-dummy_hcd.0-1/input0
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply
* Re: [PATCH RFC bpf-next v3 08/16] bpf/verifier: do_misc_fixups for is_bpf_timer_set_sleepable_cb_kfunc
From: Benjamin Tissoires @ 2024-02-27 16:18 UTC (permalink / raw)
To: Eduard Zingerman
Cc: Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Jiri Kosina,
Benjamin Tissoires, Jonathan Corbet, Shuah Khan, bpf,
linux-kernel, linux-input, linux-doc, linux-kselftest
In-Reply-To: <55177311ccdc24a74811d4a291ee1880044a5227.camel@gmail.com>
On Feb 23 2024, Eduard Zingerman wrote:
> On Wed, 2024-02-21 at 17:25 +0100, Benjamin Tissoires wrote:
> > This is still a WIP, but I think this can be dropped as we never
> > get to this instruction. So what should we do here?
>
> As Alexei replied in a separate sub-thread you probably want this
> for sleepable timers. Here is full source code block:
>
> if (insn->imm == BPF_FUNC_timer_set_callback ||
> is_bpf_timer_set_sleepable_cb_kfunc(insn->imm)) {
> ...
> struct bpf_insn ld_addrs[2] = {
> BPF_LD_IMM64(BPF_REG_3, (long)prog->aux),
> };
>
> insn_buf[0] = ld_addrs[0];
> insn_buf[1] = ld_addrs[1];
> insn_buf[2] = *insn;
> cnt = 3;
>
> new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt);
> ...
> }
>
> Effectively, it sets up third function call parameter (R3)
> for timer_set_callback() to be prog->aux.
> E.g. before bpf_patch_insn_data():
>
> r1 = ... timer ...
> r2 = ... callback address ...
> call timer_set_callback
>
> After bpf_patch_insn_data():
>
> r1 = ... timer ...
> r2 = ... callback address ...
> r3 = prog->aux ll
> call timer_set_callback
>
> This way it won't be necessary to walk stack in search for ctx.aux
> in bpf_timer_set_sleepable_cb().
Hmm, I must still be missing a piece of the puzzle:
if I declare bpf_timer_set_sleepable_cb() to take a third "aux"
argument, given that it is declared as kfunc, I also must declare it in
my bpf program, or I get the following:
# libbpf: extern (func ksym) 'bpf_timer_set_sleepable_cb': func_proto [264] incompatible with vmlinux [18151]
And if I declare it, then I don't know what to pass, given that this is
purely added by the verifier:
43: (85) call bpf_timer_set_sleepable_cb#18152
arg#2 pointer type STRUCT bpf_prog_aux must point to scalar, or struct with scalar
Maybe I should teach the verifier that this kfunc only takes 2
arguments, and the third one is virtual, but that also means that when
the kfunc definitions are to be included in vmlinux.h, they would also
have this special case.
(I just tried with a blank u64 instead of the struct bpf_prog_aux*, but
it crashes with KASAN complaining).
Cheers,
Benjamin
^ permalink raw reply
* Re: [PATCH RFC bpf-next v3 08/16] bpf/verifier: do_misc_fixups for is_bpf_timer_set_sleepable_cb_kfunc
From: Eduard Zingerman @ 2024-02-27 16:36 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Jiri Kosina,
Benjamin Tissoires, Jonathan Corbet, Shuah Khan, bpf,
linux-kernel, linux-input, linux-doc, linux-kselftest
In-Reply-To: <pocfd5n6lxriqg7r6usyhrlprgslclxs44jqoq63lw734fjl2g@5kv4hjaux2fp>
On Tue, 2024-02-27 at 17:18 +0100, Benjamin Tissoires wrote:
[...]
> Hmm, I must still be missing a piece of the puzzle:
> if I declare bpf_timer_set_sleepable_cb() to take a third "aux"
> argument, given that it is declared as kfunc, I also must declare it in
> my bpf program, or I get the following:
>
> # libbpf: extern (func ksym) 'bpf_timer_set_sleepable_cb': func_proto [264] incompatible with vmlinux [18151]
>
> And if I declare it, then I don't know what to pass, given that this is
> purely added by the verifier:
>
> 43: (85) call bpf_timer_set_sleepable_cb#18152
> arg#2 pointer type STRUCT bpf_prog_aux must point to scalar, or struct with scalar
Right, something has to be done about number of arguments and we don't
have a convenient mechanism for this afaik.
The simplest way would be to have two kfuncs:
- one with 2 arguments, used form bpf program;
- another with 3 arguments, used at runtime;
- replace former by latter during rewrite.
> Maybe I should teach the verifier that this kfunc only takes 2
> arguments, and the third one is virtual, but that also means that when
> the kfunc definitions are to be included in vmlinux.h, they would also
> have this special case.
It might be a somewhat generic mechanism, e.g. btf_decl_tag("hidden")
for kfunc parameter.
imho, having two kfuncs is less hacky.
> (I just tried with a blank u64 instead of the struct bpf_prog_aux*, but
> it crashes with KASAN complaining).
For my understanding:
- you added a 3rd param (void *) to kfunc;
- passed it as zero in BPF program;
- applied the above rewrite, so that r3 equals to prog->aux;
- and now KASAN complains, right?
Could you please provide more details on what exactly it complains about?
^ permalink raw reply
* Re: [PATCH v2 0/5] HID: playstation: DS4: LED bugfix, third-party gamepad support
From: Jiri Kosina @ 2024-02-27 16:40 UTC (permalink / raw)
To: Max Staudt
Cc: Roderick Colenbrander, Benjamin Tissoires, linux-input,
linux-kernel
In-Reply-To: <20240207163647.15792-1-max@enpas.org>
On Thu, 8 Feb 2024, Max Staudt wrote:
> Dear hid-playstation maintainers,
>
> Here is v2 of my patch series, with the discussed changes.
>
>
> Differences since v1:
> - Dropped patch for 7545:0104 (SZ-MYPOWER controllers)
> - Dropped patch for DS4 clones without a MAC address on USB
> - Changed hid_err() to hid_warn() where things are no longer fatal
> - Simplified goto as return in minimal report parsing
>
>
> I've included the patch to simplify the PID/VID mapping to controller
> types, since the previous discussion made it sound useful for future
> support of second-party controllers. Please feel free to drop it if you
> don't think it's relevant now.
>
>
> Thanks for your feedback!
>
> Max
>
>
> Patches in this series:
> [PATCH v2 1/5] HID: playstation: DS4: Fix LED blinking
> [PATCH v2 2/5] HID: playstation: DS4: Don't fail on FW/HW version
> [PATCH v2 3/5] HID: playstation: DS4: Don't fail on calibration data
> [PATCH v2 4/5] HID: playstation: DS4: Parse minimal report 0x01
> [PATCH v2 5/5] HID: playstation: Simplify device type ID
Roderick, any word on this series please?
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH RFC bpf-next v3 08/16] bpf/verifier: do_misc_fixups for is_bpf_timer_set_sleepable_cb_kfunc
From: Benjamin Tissoires @ 2024-02-27 16:51 UTC (permalink / raw)
To: Eduard Zingerman
Cc: Benjamin Tissoires, Alexei Starovoitov, Daniel Borkmann,
John Fastabend, Andrii Nakryiko, Martin KaFai Lau, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Jiri Kosina, Jonathan Corbet, Shuah Khan, bpf, linux-kernel,
linux-input, linux-doc, linux-kselftest
In-Reply-To: <9a35a53a1887fb664fd540ec7e272cb3ea63f799.camel@gmail.com>
On Tue, Feb 27, 2024 at 5:36 PM Eduard Zingerman <eddyz87@gmail.com> wrote:
>
> On Tue, 2024-02-27 at 17:18 +0100, Benjamin Tissoires wrote:
> [...]
>
> > Hmm, I must still be missing a piece of the puzzle:
> > if I declare bpf_timer_set_sleepable_cb() to take a third "aux"
> > argument, given that it is declared as kfunc, I also must declare it in
> > my bpf program, or I get the following:
> >
> > # libbpf: extern (func ksym) 'bpf_timer_set_sleepable_cb': func_proto [264] incompatible with vmlinux [18151]
> >
> > And if I declare it, then I don't know what to pass, given that this is
> > purely added by the verifier:
> >
> > 43: (85) call bpf_timer_set_sleepable_cb#18152
> > arg#2 pointer type STRUCT bpf_prog_aux must point to scalar, or struct with scalar
>
> Right, something has to be done about number of arguments and we don't
> have a convenient mechanism for this afaik.
>
> The simplest way would be to have two kfuncs:
> - one with 2 arguments, used form bpf program;
> - another with 3 arguments, used at runtime;
> - replace former by latter during rewrite.
It's hacky but seems interesting enough to be tested :)
>
> > Maybe I should teach the verifier that this kfunc only takes 2
> > arguments, and the third one is virtual, but that also means that when
> > the kfunc definitions are to be included in vmlinux.h, they would also
> > have this special case.
>
> It might be a somewhat generic mechanism, e.g. btf_decl_tag("hidden")
> for kfunc parameter.
We also could use the suffix (like __uninit, __k, etc...), but it
might introduce more headaches than the 2 kfuncs you are proposing.
>
> imho, having two kfuncs is less hacky.
>
> > (I just tried with a blank u64 instead of the struct bpf_prog_aux*, but
> > it crashes with KASAN complaining).
>
> For my understanding:
> - you added a 3rd param (void *) to kfunc;
it was struct bpf_prog_aux *, but yes
> - passed it as zero in BPF program;
> - applied the above rewrite, so that r3 equals to prog->aux;
> - and now KASAN complains, right?
yep, but see below
>
> Could you please provide more details on what exactly it complains about?
>
Well, there is a simple reason: that code is never reached because, in
that function, there is a `if (insn->src_reg ==
BPF_PSEUDO_KFUNC_CALL)` above that unconditionally terminates with a
`continue`. So basically this part of the code is never hit.
I'll include that new third argument and the dual kfunc call in
fixup_kfunc_call() and report if it works from here.
Cheers,
Benjamin
^ permalink raw reply
* [PATCH] platform/x86: touchscreen_dmi: Add an extra entry for a variant of the Chuwi Vi8 tablet
From: Alban Boyé @ 2024-02-27 22:40 UTC (permalink / raw)
To: hdegoede, ilpo.jarvinen, linux-input, platform-driver-x86,
linux-kernel
Cc: Alban Boyé
Signed-off-by: Alban Boyé <alban.boye@protonmail.com>
---
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 975cf24ae359..c6a10ec2c83f 100644
--- a/drivers/platform/x86/touchscreen_dmi.c
+++ b/drivers/platform/x86/touchscreen_dmi.c
@@ -1217,6 +1217,15 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
DMI_MATCH(DMI_BIOS_VERSION, "CHUWI.D86JLBNR"),
},
},
+ {
+ /* Chuwi Vi8 dual-boot (CWI506) */
+ .driver_data = (void *)&chuwi_vi8_data,
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "i86"),
+ DMI_MATCH(DMI_BIOS_VERSION, "CHUWI2.D86JHBNR02"),
+ },
+ },
{
/* Chuwi Vi8 Plus (CWI519) */
.driver_data = (void *)&chuwi_vi8_plus_data,
--
2.43.1
^ permalink raw reply related
* Re: [PATCH RFC bpf-next v3 08/16] bpf/verifier: do_misc_fixups for is_bpf_timer_set_sleepable_cb_kfunc
From: Alexei Starovoitov @ 2024-02-28 1:49 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Eduard Zingerman, Benjamin Tissoires, Alexei Starovoitov,
Daniel Borkmann, John Fastabend, Andrii Nakryiko,
Martin KaFai Lau, Song Liu, Yonghong Song, KP Singh,
Stanislav Fomichev, Hao Luo, Jiri Olsa, Jiri Kosina,
Jonathan Corbet, Shuah Khan, bpf, LKML, open list:HID CORE LAYER,
open list:DOCUMENTATION, open list:KERNEL SELFTEST FRAMEWORK
In-Reply-To: <CAO-hwJ+TGiLrc4De7htvKaSsMfQnZahK-zONAMNgUMYHEQb-7g@mail.gmail.com>
On Tue, Feb 27, 2024 at 8:51 AM Benjamin Tissoires
<benjamin.tissoires@redhat.com> wrote:
>
> On Tue, Feb 27, 2024 at 5:36 PM Eduard Zingerman <eddyz87@gmail.com> wrote:
> >
> > On Tue, 2024-02-27 at 17:18 +0100, Benjamin Tissoires wrote:
> > [...]
> >
> > > Hmm, I must still be missing a piece of the puzzle:
> > > if I declare bpf_timer_set_sleepable_cb() to take a third "aux"
> > > argument, given that it is declared as kfunc, I also must declare it in
> > > my bpf program, or I get the following:
> > >
> > > # libbpf: extern (func ksym) 'bpf_timer_set_sleepable_cb': func_proto [264] incompatible with vmlinux [18151]
> > >
> > > And if I declare it, then I don't know what to pass, given that this is
> > > purely added by the verifier:
> > >
> > > 43: (85) call bpf_timer_set_sleepable_cb#18152
> > > arg#2 pointer type STRUCT bpf_prog_aux must point to scalar, or struct with scalar
> >
> > Right, something has to be done about number of arguments and we don't
> > have a convenient mechanism for this afaik.
> >
> > The simplest way would be to have two kfuncs:
> > - one with 2 arguments, used form bpf program;
> > - another with 3 arguments, used at runtime;
> > - replace former by latter during rewrite.
>
> It's hacky but seems interesting enough to be tested :)
Too hacky imo :)
Let's follow the existing pattern.
See:
__bpf_kfunc void *bpf_obj_new_impl(u64 local_type_id__k, void *meta__ign)
__ign suffix tells the verifier to ignore it.
Then we do:
#define bpf_obj_new(type) \
((type *)bpf_obj_new_impl(bpf_core_type_id_local(type), NULL))
and later the verifier replaces arg2 with the correct pointer.
> We also could use the suffix (like __uninit, __k, etc...), but it
> might introduce more headaches than the 2 kfuncs you are proposing.
Only one kfunc pls. Let's not make it more complex than necessary.
We cannot easily add a suffix to tell libbpf to ignore that arg,
since bpf_core_types_are_compat() compares types and there are
no argument names in the types.
So it will be a significant surgery for libbpf to find the arg name
in vmlinux BTF and strcmp the suffix.
>
> >
> > Could you please provide more details on what exactly it complains about?
> >
>
> Well, there is a simple reason: that code is never reached because, in
> that function, there is a `if (insn->src_reg ==
> BPF_PSEUDO_KFUNC_CALL)` above that unconditionally terminates with a
> `continue`. So basically this part of the code is never hit.
>
> I'll include that new third argument and the dual kfunc call in
> fixup_kfunc_call() and report if it works from here.
Something is wrong. fixup_kfunc_call() can rewrite args with whatever
it wants.
Are you sure you've added bpf_timer_set_sleepable_cb to special_kfunc_list ?
^ permalink raw reply
* [PATCH hid-next] HID: amd_sfh: Fix build error without x86 kconfig
From: Basavaraj Natikar @ 2024-02-28 7:51 UTC (permalink / raw)
To: jikos, benjamin.tissoires, linux-input
Cc: Basavaraj Natikar, Stephen Rothwell
This patch is to fix below build error while using the kconfig without
x86.
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c: In function 'amd_mp2_pci_probe':
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c:413:21: error: 'boot_cpu_data'
undeclared (first use in this function); did you mean 'boot_cpu_hwid'?
413 | if (boot_cpu_data.x86 >= 0x1A)
| ^~~~~~~~~~~~~
| boot_cpu_hwid
Fixes: 6296562f30b1 ("HID: amd_sfh: Extend MP2 register access to SFH")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/all/20240228145648.41c493ec@canb.auug.org.au/
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
---
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
index 9e97c26c4482..c815f2f54321 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -410,8 +410,10 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
privdata->sfh1_1_ops = (const struct amd_sfh1_1_ops *)id->driver_data;
if (privdata->sfh1_1_ops) {
+#ifdef CONFIG_X86
if (boot_cpu_data.x86 >= 0x1A)
privdata->rver = 1;
+#endif
rc = devm_work_autocancel(&pdev->dev, &privdata->work, sfh1_1_init_work);
if (rc)
--
2.25.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox