summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* i2c: xlp9xx: Use dev_err_probe in probe functionLiao Chang2023-08-101-4/+2
| | | | | | | | | | | Use the dev_err_probe function instead of dev_err in the probe function so that the printed message includes the return value and also handles -EPROBE_DEFER nicely. Signed-off-by: Liao Chang <liaochang1@huawei.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230808012954.1643834-4-liaochang1@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: mlxbf: Use dev_err_probe in probe functionLiao Chang2023-08-101-33/+17
| | | | | | | | | | | Use the dev_err_probe function instead of dev_err in the probe function so that the printed message includes the return value and also handles -EPROBE_DEFER nicely. Signed-off-by: Liao Chang <liaochang1@huawei.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230808012954.1643834-3-liaochang1@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: bcm2835: Use dev_err_probe in probe functionLiao Chang2023-08-101-8/+6
| | | | | | | | | | | Use the dev_err_probe function instead of dev_err in the probe function so that the printed message includes the return value and also handles -EPROBE_DEFER nicely. Signed-off-by: Liao Chang <liaochang1@huawei.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20230808012954.1643834-2-liaochang1@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: mux: ltc4306: Remove an unnecessary ternary operatorRuan Jinjie2023-08-081-1/+1
| | | | | | | | | | The true or false judgement of the ternary operator is unnecessary in C language semantics. So remove it to clean Code. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Acked-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230801025328.3380963-1-ruanjinjie@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: stm32: Do not check for 0 return after calling platform_get_irq()Ruan Jinjie2023-08-081-4/+4
| | | | | | | | | | | It is not possible for platform_get_irq() to return 0. Use the return value from platform_get_irq(). Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Acked-by: Alain Volmat <alain.volmat@foss.st.com> Link: https://lore.kernel.org/r/20230731112755.1943630-1-ruanjinjie@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* dt-bindings: i2c: cadence: Describe power-domains propertyMichal Simek2023-08-081-0/+3
| | | | | | | | | | ZynqMP Cadence I2c IP core has own power domain that's why describe it as optional property. Signed-off-by: Michal Simek <michal.simek@amd.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/8774dba53cae5508f9f7aa173fbaf814d97898b1.1691047405.git.michal.simek@amd.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* dt-bindings: i2c: arb-gpio-challange: convert to DT schemaKrzysztof Kozlowski2023-08-083-117/+135
| | | | | | | | | | Convert the bindings for GPIO-based I2C Arbitration Using a Challenge & Response Mechanism to DT schema. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Acked-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/20230731163833.319258-2-krzysztof.kozlowski@linaro.org Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* dt-bindings: i2c: nxp,pca9541: convert to DT schemaKrzysztof Kozlowski2023-08-082-29/+56
| | | | | | | | | | | | Convert the bindings for NXP PCA9541 I2C bus master selector to DT schema. Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Acked-by: Peter Rosin <peda@axentia.se> Acked-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230731163833.319258-1-krzysztof.kozlowski@linaro.org Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: remove redundant dev_err_probe()Zhu Wang2023-08-082-4/+3
| | | | | | | | | | | | | When platform_get_irq() is called, the error message has been printed, so it need not to call dev_err_probe() to print error. As the comment of platform_get_irq() says, it returned non-zero value when it succeeded, and it returned negative value when it failed. Signed-off-by: Zhu Wang <wangzhu9@huawei.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20230801134814.247782-1-wangzhu9@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: imx: Clean up a call to request_irq()Dan Carpenter2023-08-081-2/+1
| | | | | | | | | | | This is passing a NULL thread to request_threaded_irq(). So it's not really a threaded IRQ at all. It's more readable to call request_irq() instead. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/fa375cc0-893a-4e64-8bf6-cc37f9ebecf5@moroto.mountain Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* virtio: Remove PM #ifdef guards to fix i2c driverArnd Bergmann2023-08-081-2/+0
| | | | | | | | | | | | | | | | | A cleanup in the virtio i2c caused a build failure: drivers/i2c/busses/i2c-virtio.c:270:10: error: 'struct virtio_driver' has no member named 'freeze' drivers/i2c/busses/i2c-virtio.c:271:10: error: 'struct virtio_driver' has no member named 'restore' Change the structure definition to allow this cleanup to be applied everywhere. Fixes: 73d546c76235b ("i2c: virtio: Remove #ifdef guards for PM related functions") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230801105846.3708252-1-arnd@kernel.org Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: mux: pca954x: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-4/+2
| | | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-by: Peter Rosin <peda@axentia.se> Link: https://lore.kernel.org/r/20230722115310.27681-6-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: virtio: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-6/+2
| | | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Link: https://lore.kernel.org/r/20230722115310.27681-5-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: sh-mobile: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-9/+3
| | | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230722115310.27681-4-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: s3c2410: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-11/+3
| | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115310.27681-3-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: rcar: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-8/+2
| | | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230722115310.27681-2-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: qup: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-12/+4
| | | | | | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Note that the driver should probably use the DEFINE_RUNTIME_DEV_PM_OPS() macro, as the system suspend/resume callbacks seem to not do anything more than triggering the runtime-PM states. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115310.27681-1-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: pxa: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-7/+1
| | | | | | | | | | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Note that the behaviour is slightly different than before; the original code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which resulted in these functions being compiled in but never used when CONFIG_PM_SLEEP was disabled. Now, those functions are only compiled in when CONFIG_PM_SLEEP is enabled. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115046.27323-17-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: pnx: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-8/+4
| | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115046.27323-16-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: ocores: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-7/+3
| | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115046.27323-15-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: nomadik: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-9/+3
| | | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230722115046.27323-14-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: mt65xx: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-5/+3
| | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115046.27323-13-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: lpc2k: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-7/+1
| | | | | | | | | | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Note that the behaviour is slightly different than before; the original code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which resulted in these functions being compiled in but never used when CONFIG_PM_SLEEP was disabled. Now, those functions are only compiled in when CONFIG_PM_SLEEP is enabled. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115046.27323-12-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: kempld: Convert to use regular device PMPaul Cercueil2023-08-081-11/+8
| | | | | | | | | | | | | | | | | | Provide PM callbacks through platform_driver.driver.pm instead of platform_driver.{suspend,resume} as any good-behaved driver should do. Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Acked-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230722115046.27323-11-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: img-scb: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-7/+3
| | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Acked-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230722115046.27323-10-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: i801: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-4/+2
| | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115046.27323-9-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: hix5hd2: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-6/+4
| | | | | | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Note that this driver should probably use the DEFINE_RUNTIME_DEV_PM_OPS() macro, which would allow the devices to be runtime-suspended on system suspend. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115046.27323-8-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: exynos5: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-5/+3
| | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115046.27323-7-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: designware: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-16/+6
| | | | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Link: https://lore.kernel.org/r/20230722115046.27323-6-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: davinci: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Note that the behaviour is slightly different than before; the original code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which resulted in these functions being compiled in but never used when CONFIG_PM_SLEEP was disabled. Now, those functions are only compiled in when CONFIG_PM_SLEEP is enabled. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://lore.kernel.org/r/20230722115046.27323-5-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: brcmstb: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-5/+3
| | | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20230722115046.27323-4-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: iproc: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-9/+1
| | | | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Acked-by: Ray Jui <ray.jui@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20230722115046.27323-3-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: au1550: Remove #ifdef guards for PM related functionsPaul Cercueil2023-08-081-12/+3
| | | | | | | | | | | | | | | | | | | | | | | Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Note that the behaviour is slightly different than before; the original code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which resulted in these functions being compiled in but never used when CONFIG_PM_SLEEP was disabled. Now, those functions are only compiled in when CONFIG_PM_SLEEP is enabled. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115046.27323-2-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: s3c2410: Remove redundant dev_err()Ruan Jinjie2023-08-081-1/+0
| | | | | | | | | | | There is no need to call the dev_err() function directly to print a custom message when handling an error from platform_get_irq() function as it is going to display an appropriate error message in case of a failure. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230726174226.2480552-1-ruanjinjie@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* i2c: imx-lpi2c: directly return ISR when detect a NACKCarlos Song2023-08-081-6/+4
| | | | | | | | | | | | | | | A NACK flag in ISR means i2c bus error. In such condition, there is no need to do read/write operation. In this patch, i2c will check MSR_NDF, MSR_RDF and MSR_TDF flag in turn, it's making mutually exclusive NACK/read/write. So when a NACK is received(MSR_NDF), i2c will return ISR directly and then stop i2c transfer. Signed-off-by: Carlos Song <carlos.song@nxp.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230727030347.3552992-1-carlos.song@nxp.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
* Linux 6.5-rc5v6.5-rc5Linus Torvalds2023-08-061-1/+1
|
* Merge tag 'v6.5-rc5.vfs.fixes' of ↵Linus Torvalds2023-08-0616-61/+98
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull vfs fixes from Christian Brauner: - Fix a wrong check for O_TMPFILE during RESOLVE_CACHED lookup - Clean up directory iterators and clarify file_needs_f_pos_lock() * tag 'v6.5-rc5.vfs.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: fs: rely on ->iterate_shared to determine f_pos locking vfs: get rid of old '->iterate' directory operation proc: fix missing conversion to 'iterate_shared' open: make RESOLVE_CACHED correctly test for O_TMPFILE
| * fs: rely on ->iterate_shared to determine f_pos lockingChristian Brauner2023-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | Now that we removed ->iterate we don't need to check for either ->iterate or ->iterate_shared in file_needs_f_pos_lock(). Simply check for ->iterate_shared instead. This will tell us whether we need to unconditionally take the lock. Not just does it allow us to avoid checking f_inode's mode it also actually clearly shows that we're locking because of readdir. Signed-off-by: Christian Brauner <brauner@kernel.org>
| * vfs: get rid of old '->iterate' directory operationLinus Torvalds2023-08-0613-58/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All users now just use '->iterate_shared()', which only takes the directory inode lock for reading. Filesystems that never got convered to shared mode now instead use a wrapper that drops the lock, re-takes it in write mode, calls the old function, and then downgrades the lock back to read mode. This way the VFS layer and other callers no longer need to care about filesystems that never got converted to the modern era. The filesystems that use the new wrapper are ceph, coda, exfat, jfs, ntfs, ocfs2, overlayfs, and vboxsf. Honestly, several of them look like they really could just iterate their directories in shared mode and skip the wrapper entirely, but the point of this change is to not change semantics or fix filesystems that haven't been fixed in the last 7+ years, but to finally get rid of the dual iterators. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
| * proc: fix missing conversion to 'iterate_shared'Linus Torvalds2023-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm looking at the directory handling due to the discussion about f_pos locking (see commit 797964253d35: "file: reinstate f_pos locking optimization for regular files"), and wanting to clean that up. And one source of ugliness is how we were supposed to move filesystems over to the '->iterate_shared()' function that only takes the inode lock for reading many many years ago, but several filesystems still use the bad old '->iterate()' that takes the inode lock for exclusive access. See commit 6192269444eb ("introduce a parallel variant of ->iterate()") that also added some documentation stating Old method is only used if the new one is absent; eventually it will be removed. Switch while you still can; the old one won't stay. and that was back in April 2016. Here we are, many years later, and the old version is still clearly sadly alive and well. Now, some of those old style iterators are probably just because the filesystem may end up having per-inode mutable data that it uses for iterating a directory, but at least one case is just a mistake. Al switched over most filesystems to use '->iterate_shared()' back when it was introduced. In particular, the /proc filesystem was converted as one of the first ones in commit f50752eaa0b0 ("switch all procfs directories ->iterate_shared()"). But then later one new user of '->iterate()' was then re-introduced by commit 6d9c939dbe4d ("procfs: add smack subdir to attrs"). And that's clearly not what we wanted, since that new case just uses the same 'proc_pident_readdir()' and 'proc_pident_lookup()' helper functions that other /proc pident directories use, and they are most definitely safe to use with the inode lock held shared. So just fix it. This still leaves a fair number of oddball filesystems using the old-style directory iterator (ceph, coda, exfat, jfs, ntfs, ocfs2, overlayfs, and vboxsf), but at least we don't have any remaining in the core filesystems. I'm going to add a wrapper function that just drops the read-lock and takes it as a write lock, so that we can clean up the core vfs layer and make all the ugly 'this filesystem needs exclusive inode locking' be just filesystem-internal warts. I just didn't want to make that conversion when we still had a core user left. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
| * open: make RESOLVE_CACHED correctly test for O_TMPFILEAleksa Sarai2023-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | O_TMPFILE is actually __O_TMPFILE|O_DIRECTORY. This means that the old fast-path check for RESOLVE_CACHED would reject all users passing O_DIRECTORY with -EAGAIN, when in fact the intended test was to check for __O_TMPFILE. Cc: stable@vger.kernel.org # v5.12+ Fixes: 99668f618062 ("fs: expose LOOKUP_CACHED through openat2() RESOLVE_CACHED") Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Message-Id: <20230806-resolve_cached-o_tmpfile-v1-1-7ba16308465e@cyphar.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
* | Merge tag 'rust-fixes-6.5-rc5' of https://github.com/Rust-for-Linux/linuxLinus Torvalds2023-08-055-38/+64
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull rust fixes from Miguel Ojeda: - Allocator: prevent mis-aligned allocation - Types: delete 'ForeignOwnable::borrow_mut'. A sound replacement is planned for the merge window - Build: fix bindgen error with UBSAN_BOUNDS_STRICT * tag 'rust-fixes-6.5-rc5' of https://github.com/Rust-for-Linux/linux: rust: fix bindgen build error with UBSAN_BOUNDS_STRICT rust: delete `ForeignOwnable::borrow_mut` rust: allocator: Prevent mis-aligned allocation
| * | rust: fix bindgen build error with UBSAN_BOUNDS_STRICTAndrea Righi2023-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With commit 2d47c6956ab3 ("ubsan: Tighten UBSAN_BOUNDS on GCC") if CONFIG_UBSAN is enabled and gcc supports -fsanitize=bounds-strict, we can trigger the following build error due to bindgen lacking support for this additional build option: BINDGEN rust/bindings/bindings_generated.rs error: unsupported argument 'bounds-strict' to option '-fsanitize=' Fix by adding -fsanitize=bounds-strict to the list of skipped gcc flags for bindgen. Fixes: 2d47c6956ab3 ("ubsan: Tighten UBSAN_BOUNDS on GCC") Signed-off-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Kees Cook <keescook@chromium.org> Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Link: https://lore.kernel.org/r/20230711071914.133946-1-andrea.righi@canonical.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
| * | rust: delete `ForeignOwnable::borrow_mut`Alice Ryhl2023-08-042-22/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We discovered that the current design of `borrow_mut` is problematic. This patch removes it until a better solution can be found. Specifically, the current design gives you access to a `&mut T`, which lets you change where the `ForeignOwnable` points (e.g., with `core::mem::swap`). No upcoming user of this API intended to make that possible, making all of them unsound. Signed-off-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Gary Guo <gary@garyguo.net> Reviewed-by: Benno Lossin <benno.lossin@proton.me> Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Fixes: 0fc4424d24a2 ("rust: types: introduce `ForeignOwnable`") Link: https://lore.kernel.org/r/20230706094615.3080784-1-aliceryhl@google.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
| * | rust: allocator: Prevent mis-aligned allocationBoqun Feng2023-08-042-15/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the rust allocator simply passes the size of the type Layout to krealloc(), and in theory the alignment requirement from the type Layout may be larger than the guarantee provided by SLAB, which means the allocated object is mis-aligned. Fix this by adjusting the allocation size to the nearest power of two, which SLAB always guarantees a size-aligned allocation. And because Rust guarantees that the original size must be a multiple of alignment and the alignment must be a power of two, then the alignment requirement is satisfied. Suggested-by: Vlastimil Babka <vbabka@suse.cz> Co-developed-by: "Andreas Hindborg (Samsung)" <nmi@metaspace.dk> Signed-off-by: "Andreas Hindborg (Samsung)" <nmi@metaspace.dk> Signed-off-by: Boqun Feng <boqun.feng@gmail.com> Cc: stable@vger.kernel.org # v6.1+ Acked-by: Vlastimil Babka <vbabka@suse.cz> Fixes: 247b365dc8dc ("rust: add `kernel` crate") Link: https://github.com/Rust-for-Linux/linux/issues/974 Link: https://lore.kernel.org/r/20230730012905.643822-2-boqun.feng@gmail.com [ Applied rewording of comment as discussed in the mailing list. ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* | | Merge tag 'ata-6.5-rc5' of ↵Linus Torvalds2023-08-053-3/+14
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata fix from Damien Le Moal: - Prevent the scsi disk driver from issuing a START STOP UNIT command for ATA devices during system resume as this causes various issues reported by multiple users. * tag 'ata-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata,scsi: do not issue START STOP UNIT on resume
| * | | ata,scsi: do not issue START STOP UNIT on resumeDamien Le Moal2023-08-023-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During system resume, ata_port_pm_resume() triggers ata EH to 1) Resume the controller 2) Reset and rescan the ports 3) Revalidate devices This EH execution is started asynchronously from ata_port_pm_resume(), which means that when sd_resume() is executed, none or only part of the above processing may have been executed. However, sd_resume() issues a START STOP UNIT to wake up the drive from sleep mode. This command is translated to ATA with ata_scsi_start_stop_xlat() and issued to the device. However, depending on the state of execution of the EH process and revalidation triggerred by ata_port_pm_resume(), two things may happen: 1) The START STOP UNIT fails if it is received before the controller has been reenabled at the beginning of the EH execution. This is visible with error messages like: ata10.00: device reported invalid CHS sector 0 sd 9:0:0:0: [sdc] Start/Stop Unit failed: Result: hostbyte=DID_OK driverbyte=DRIVER_OK sd 9:0:0:0: [sdc] Sense Key : Illegal Request [current] sd 9:0:0:0: [sdc] Add. Sense: Unaligned write command sd 9:0:0:0: PM: dpm_run_callback(): scsi_bus_resume+0x0/0x90 returns -5 sd 9:0:0:0: PM: failed to resume async: error -5 2) The START STOP UNIT command is received while the EH process is on-going, which mean that it is stopped and must wait for its completion, at which point the command is rather useless as the drive is already fully spun up already. This case results also in a significant delay in sd_resume() which is observable by users as the entire system resume completion is delayed. Given that ATA devices will be woken up by libata activity on resume, sd_resume() has no need to issue a START STOP UNIT command, which solves the above mentioned problems. Do not issue this command by introducing the new scsi_device flag no_start_on_resume and setting this flag to 1 in ata_scsi_dev_config(). sd_resume() is modified to issue a START STOP UNIT command only if this flag is not set. Reported-by: Paul Ausbeck <paula@soe.ucsc.edu> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=215880 Fixes: a19a93e4c6a9 ("scsi: core: pm: Rely on the device driver core for async power management") Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Tested-by: Tanner Watkins <dalzot@gmail.com> Tested-by: Paul Ausbeck <paula@soe.ucsc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
* | | | Merge tag '6.5-rc4-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6Linus Torvalds2023-08-051-1/+5
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull smb client fix from Steve French: - Fix DFS interlink problem (different namespace) * tag '6.5-rc4-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6: smb: client: fix dfs link mount against w2k8
| * | | | smb: client: fix dfs link mount against w2k8Paulo Alcantara2023-08-021-1/+5
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Customer reported that they couldn't mount their DFS link that was seen by the client as a DFS interlink -- special form of DFS link where its single target may point to a different DFS namespace -- and it turned out that it was just a regular DFS link where its referral header flags missed the StorageServers bit thus making the client think it couldn't tree connect to target directly without requiring further referrals. When the DFS link referral header flags misses the StoraServers bit and its target doesn't respond to any referrals, then tree connect to it. Fixes: a1c0d00572fc ("cifs: share dfs connections and supers") Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com> Signed-off-by: Steve French <stfrench@microsoft.com>
* | | | Merge tag 'powerpc-6.5-5' of ↵Linus Torvalds2023-08-055-10/+13
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix vmemmap altmap boundary check which could cause memory hotunplug failure - Create a dummy stackframe to fix ftrace stack unwind - Fix secondary thread bringup for Book3E ELFv2 kernels - Use early_ioremap/unmap() in via_calibrate_decr() Thanks to Aneesh Kumar K.V, Benjamin Gray, Christophe Leroy, David Hildenbrand, and Naveen N Rao. * tag 'powerpc-6.5-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/powermac: Use early_* IO variants in via_calibrate_decr() powerpc/64e: Fix secondary thread bringup for ELFv2 kernels powerpc/ftrace: Create a dummy stackframe to fix stack unwind powerpc/mm/altmap: Fix altmap boundary check