- 24 2月, 2022 1 次提交
-
-
由 Shreeya Patel 提交于
We are racing the registering of .to_irq when probing the i2c driver. This results in random failure of touchscreen devices. Following explains the race condition better. [gpio driver] gpio driver registers gpio chip [gpio consumer] gpio is acquired [gpio consumer] gpiod_to_irq() fails with -ENXIO [gpio driver] gpio driver registers irqchip gpiod_to_irq works at this point, but -ENXIO is fatal We could see the following errors in dmesg logs when gc->to_irq is NULL [2.101857] i2c_hid i2c-FTS3528:00: HID over i2c has not been provided an Int IRQ [2.101953] i2c_hid: probe of i2c-FTS3528:00 failed with error -22 To avoid this situation, defer probing until to_irq is registered. Returning -EPROBE_DEFER would be the first step towards avoiding the failure of devices due to the race in registration of .to_irq. Final solution to this issue would be to avoid using gc irq members until they are fully initialized. This issue has been reported many times in past and people have been using workarounds like changing the pinctrl_amd to built-in instead of loading it as a module or by adding a softdep for pinctrl_amd into the config file. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=209413Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Reported-by: Nkernel test robot <lkp@intel.com> Signed-off-by: NShreeya Patel <shreeya.patel@collabora.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 16 2月, 2022 1 次提交
-
-
由 Samuel Holland 提交于
With v2 hardware, an IRQ can be configured to trigger on both edges via a bit in the int_bothedge register. Currently, the driver sets this bit when changing the trigger type to IRQ_TYPE_EDGE_BOTH, but fails to reset this bit if the trigger type is later changed to something else. This causes spurious IRQs, and when using gpio-keys with wakeup-event-action set to EV_ACT_(DE)ASSERTED, those IRQs translate into spurious wakeups. Fixes: 3bcbd1a8 ("gpio/rockchip: support next version gpio controller") Reported-by: NGuillaume Savaton <guillaume@baierouge.fr> Tested-by: NGuillaume Savaton <guillaume@baierouge.fr> Signed-off-by: NSamuel Holland <samuel@sholland.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 09 2月, 2022 1 次提交
-
-
由 Bartosz Golaszewski 提交于
We always assign the default device name as the chip_label in hog structures which makes it impossible to assign hogs to chips. Let's first check if a custom label was set and then copy it instead of the default device name. Fixes: cb8c474e ("gpio: sim: new testing module") Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
-
- 08 2月, 2022 2 次提交
-
-
由 Niklas Cassel 提交于
Setting the output of a GPIO to 1 using gpiod_set_value(), followed by reading the same GPIO using gpiod_get_value(), will currently yield an incorrect result. This is because the SiFive GPIO device stores the output values in reg_set, not reg_dat. Supply the flag BGPIOF_READ_OUTPUT_REG_SET to bgpio_init() so that the generic driver reads the correct register. Fixes: 96868dce ("gpio/sifive: Add GPIO driver for SiFive SoCs") Signed-off-by: NNiklas Cassel <niklas.cassel@wdc.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> [Bartosz: added the Fixes tag] Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Andy Shevchenko 提交于
Currently it's possible that character device interface may return the error codes which are not supposed to be seen by user space. In this case it's EPROBE_DEFER. Wrap it to return -ENODEV instead as sysfs does. Fixes: d7c51b47 ("gpio: userspace ABI for reading/writing GPIO lines") Fixes: 61f922db ("gpio: userspace ABI for reading GPIO line events") Fixes: 3c0d9c63 ("gpiolib: cdev: support GPIO_V2_GET_LINE_IOCTL and GPIO_V2_LINE_GET_VALUES_IOCTL") Reported-by: NSuresh Balakrishnan <suresh.balakrishnan@intel.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 02 2月, 2022 1 次提交
-
-
由 Geert Uytterhoeven 提交于
If the parent GPIO controller is a sleeping controller (e.g. a GPIO controller connected to I2C), getting or setting a GPIO triggers a might_sleep() warning. This happens because the GPIO Aggregator takes the can_sleep flag into account only for its internal locking, not for calling into the parent GPIO controller. Fix this by using the gpiod_[gs]et*_cansleep() APIs when calling into a sleeping GPIO controller. Reported-by: NMikko Salomäki <ms@datarespons.se> Fixes: 828546e2 ("gpio: Add GPIO Aggregator") Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 24 1月, 2022 1 次提交
-
-
由 Bartosz Golaszewski 提交于
If the user-space sets the chip label to an empty string - we should check the length and not override the default name or else line hogs will not be properly attached. Fixes: cb8c474e ("gpio: sim: new testing module") Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 20 1月, 2022 2 次提交
-
-
由 Yang Li 提交于
The return from the call to platform_get_irq() is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'irqn', so making 'irqn' an int. Eliminate the following coccicheck warning: ./drivers/gpio/gpio-mpc8xxx.c:391:5-21: WARNING: Unsigned expression compared with zero: mpc8xxx_gc -> irqn < 0 Reported-by: NAbaci Robot <abaci@linux.alibaba.com> Fixes: 0b39536c ("gpio: mpc8xxx: Fix IRQ check in mpc8xxx_probe") Signed-off-by: NYang Li <yang.lee@linux.alibaba.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Yang Li 提交于
The return from the call to platform_get_irq() is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'parent_irq', so making 'parent_irq' an int. Eliminate the following coccicheck warning: ./drivers/gpio/gpio-idt3243x.c:167:6-16: WARNING: Unsigned expression compared with zero: parent_irq < 0 Reported-by: NAbaci Robot <abaci@linux.alibaba.com> Fixes: 30fee1d7 ("gpio: idt3243x: Fix IRQ check in idt_gpio_probe") Signed-off-by: NYang Li <yang.lee@linux.alibaba.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 17 1月, 2022 2 次提交
-
-
由 Miaoqian Lin 提交于
platform_get_irq() returns negative error number instead 0 on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: 4195926a ("gpio: Add support for IDT 79RC3243x GPIO controller") Signed-off-by: NMiaoqian Lin <linmq006@gmail.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Miaoqian Lin 提交于
platform_get_irq() returns negative error number instead 0 on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: 76c47d14 ("gpio: mpc8xxx: Add ACPI support") Signed-off-by: NMiaoqian Lin <linmq006@gmail.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 15 1月, 2022 1 次提交
-
-
由 Michael S. Tsirkin 提交于
This will enable cleanups down the road. The idea is to disable cbs, then add "flush_queued_cbs" callback as a parameter, this way drivers can flush any work queued after callbacks have been disabled. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Link: https://lore.kernel.org/r/20211013105226.20225-1-mst@redhat.comSigned-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
- 05 1月, 2022 3 次提交
-
-
由 Lad Prabhakar 提交于
The driver overrides the error code returned by devm_request_irq() to -ENOENT. Switch to propagating the error code upstream. Suggested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: NSergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Lad Prabhakar 提交于
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: NLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Lad Prabhakar 提交于
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: NLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 03 1月, 2022 4 次提交
-
-
由 Andy Shevchenko 提交于
GPIO library now accepts fwnode as a firmware node, so switch the driver to use it and hence rectify the ACPI case which uses software nodes. Note, in this case it's rather logical fix that doesn't affect functionality, thus no backporting required. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NSerge Semin <fancer.lancer@gmail.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Andy Shevchenko 提交于
If the driver sets the fwnode in struct gpio_chip, let it take precedence over the parent's fwnode. This is a follow up to the commit 9126a738edc1 ("gpiolib: of: make fwnode take precedence in struct gpio_chip"). Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Steven Lee 提交于
Each aspeed sgpio bank has 64 gpio pins(32 input pins and 32 output pins). The hwirq base for each sgpio bank should be multiples of 64 rather than multiples of 32. Signed-off-by: NSteven Lee <steven_lee@aspeedtech.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Christophe JAILLET 提交于
kfree() and bitmap_free() are the same. But using the later is more consistent when freeing memory allocated with bitmap_alloc(). Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 24 12月, 2021 3 次提交
-
-
由 Andy Shevchenko 提交于
GPIO library now accepts fwnode as a firmware node, so switch the driver to use it. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NMichael Walle <michael@walle.cc> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Akhil R 提交于
Extend the existing Tegra186 GPIO controller driver with support for the GPIO controller found on Tegra241 (Grace). While the programming model remains the same, the number of pins has slightly changed. Signed-off-by: NAkhil R <akhilrajeev@nvidia.com> Signed-off-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Andy Shevchenko 提交于
We already have a local variable that contains a copy of OF node pointer. Use it instead of dereferencing it again from struct device. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 22 12月, 2021 1 次提交
-
-
由 Andy Shevchenko 提交于
After the commit 448cf905 ("gpio: Get rid of duplicate of_node assignment in the drivers") the OF node local pointers become unused. Remove them for good and make compiler happy about. Fixes: 448cf905 ("gpio: Get rid of duplicate of_node assignment in the drivers") Reported-by: NStephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> [Bart: removed unrelated change in gpio-brcmstb] Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 21 12月, 2021 2 次提交
-
-
由 Vincent Whitchurch 提交于
The driver imposes an arbitrary one second timeout on virtio requests, but the specification doesn't prevent the virtio device from taking longer to process requests, so remove this timeout to support all systems and device implementations. Fixes: 3a29355a ("gpio: Add virtio-gpio driver") Signed-off-by: NVincent Whitchurch <vincent.whitchurch@axis.com> Acked-by: NMichael S. Tsirkin <mst@redhat.com> Acked-by: NViresh Kumar <viresh.kumar@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Yang Yingliang 提交于
Calling fwnode_handle_put() when break out of device_for_each_child_node(), or the device node reference will be leakd. Fixes: 83960fcf4818 ("gpio: sim: new testing module") Reported-by: NHulk Robot <hulkci@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 20 12月, 2021 2 次提交
-
-
由 Daniel Palmer 提交于
This adds GPIO support for the SSD201 and SSD202D chips. Signed-off-by: NDaniel Palmer <daniel@0x0f.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Daniel Palmer 提交于
- Remove the unneeded assignment of ret before returning it. - Remove an unneeded blank line Signed-off-by: NDaniel Palmer <daniel@0x0f.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 19 12月, 2021 2 次提交
-
-
由 Noralf Trønnes 提交于
When replugging the device the following message shows up: gpio gpiochip2: (dln2): detected irqchip that is shared with multiple gpiochips: please fix the driver. This also has the effect that interrupts won't work. The same problem would also show up if multiple devices where plugged in. Fix this by allocating the irq_chip data structure per instance like other drivers do. I don't know when this problem appeared, but it is present in 5.10. Cc: <stable@vger.kernel.org> # 5.10+ Cc: Daniel Baluta <daniel.baluta@gmail.com> Signed-off-by: NNoralf Trønnes <noralf@tronnes.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Tom Rix 提交于
Building with clang returns this error: gpio-sim.c:889:7: error: variable 'ret' is uninitialized when used here ret should be the status of the call to gpio_sim_make_bank_swnode stored in bank->swnode. Fixes: 83960fcf4818 ("gpio: sim: new testing module") Signed-off-by: NTom Rix <trix@redhat.com> Reviewed-by: NNathan Chancellor <nathan@kernel.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 18 12月, 2021 3 次提交
-
-
由 Andy Shevchenko 提交于
When creating MFD platform devices the firmware node is left unset. This, in particular, prevents GPIO library to use it for different purposes. Propagate firmware node from the parent device and let GPIO library do the right thing. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Andy Shevchenko 提交于
Some of the drivers do not set parent device. This may lead to obstacles during debugging or understanding the device relations from the Linux point of view. Assign parent device for GPIO chips created by these drivers. While at it, let GPIO library to assign of_node from the parent device. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Andy Shevchenko 提交于
GPIO library does copy the of_node from the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove these assignment all at once. For the details one may look into the of_gpio_dev_init() implementation. While at it, remove duplicate parent device assignment where it is the case. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-By: NMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 17 12月, 2021 8 次提交
-
-
由 Peter Rosin 提交于
Some GPIO providers set names for GPIO lines that match the names of the pins on the SoC, or variations on that theme. These names are generic more often that not, such as pioC12 in the at91 case. These generic names block the possibility to set more useful GPIO line names with device properties (i.e. gpio-line-names). Allow overriding a generic name given by the GPIO driver if there is a name given to the GPIO line using device properties, but leave the generic name alone if no better name is available. However, there is a risk. If user space is depending on the above mentioned fixed GPIO names, AND there are device properties that previously did not reach the surface, the name change might cause regressions. But hopefully this stays below the radar... Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Tested-by: NAlexander Dahl <ada@thorsis.com> Signed-off-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Hsu Yuchang 提交于
Add an ACPI HID(AMDIF031) and pin number in the pt_gpio_acpi_match. Signed-off-by: NYuchang Hsu <Richard_Hsu@asmedia.com.tw> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Prathamesh Shete 提交于
Extend the existing Tegra186 GPIO controller driver with support for the GPIO controller found on Tegra234. While the programming model remains the same, the number of pins has slightly changed. Signed-off-by: NPrathamesh Shete <pshete@nvidia.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Jason Wang 提交于
The double `all' in the comment in line 327 is repeated. Remove one of them from the comment. Signed-off-by: NJason Wang <wangborong@cdjrlc.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Bartosz Golaszewski 提交于
Implement a new, modern GPIO testing module controlled by configfs attributes instead of module parameters. The goal of this driver is to provide a replacement for gpio-mockup that will be easily extensible with new features and doesn't require reloading the module to change the setup. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Acked-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Bartosz Golaszewski 提交于
If the driver sets the fwnode in struct gpio_chip, let it take precedence over the of_node. This only affects OF-based systems, ACPI needs to be converted separately. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Bartosz Golaszewski 提交于
Software nodes allow us to represent hierarchies for device components that don't have their struct device representation yet - for instance: banks of GPIOs under a common GPIO expander. The core gpiolib core however doesn't offer any way of passing this information from the drivers. This extends struct gpio_chip with a pointer to fwnode that can be set by the driver and used to pass device properties for child nodes. This is similar to how we handle device-tree sub-nodes with CONFIG_OF_GPIO enabled. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Bartosz Golaszewski 提交于
Currently all users of gpiod_add_hogs() call it only once at system init so there never was any need for a mechanism allowing to remove them. Now the upcoming gpio-sim will need to tear down chips with hogged lines so provide a function that allows to remove hogs. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org>
-