* [PATCH v3 5/7] iio: adc: exynos: Use input_device_enabled()
From: Andrzej Pietrasiewicz @ 2020-06-05 17:33 UTC (permalink / raw)
To: linux-pm, linux-acpi, linux-kernel, linux-iio, linux-arm-kernel,
linux-samsung-soc, linux-input, linux-tegra, patches,
ibm-acpi-devel, platform-driver-x86
Cc: Rafael J . Wysocki, Len Brown, Jonathan Cameron, Hartmut Knaack,
Lars-Peter Clausen, Peter Meerwald-Stadler, Kukjin Kim,
Krzysztof Kozlowski, Dmitry Torokhov, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
Vladimir Zapolskiy, Sylvain Lemieux, Laxman Dewangan,
Thierry Reding, Jonathan Hunter, Barry
In-Reply-To: <20200605173335.13753-1-andrzej.p@collabora.com>
A new helper is available, so use it. Inspecting 'users' member of
input_dev requires taking device's mutex.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
---
drivers/iio/adc/exynos_adc.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
index 22131a677445..294715bafe25 100644
--- a/drivers/iio/adc/exynos_adc.c
+++ b/drivers/iio/adc/exynos_adc.c
@@ -630,10 +630,13 @@ static irqreturn_t exynos_ts_isr(int irq, void *dev_id)
struct exynos_adc *info = dev_id;
struct iio_dev *dev = dev_get_drvdata(info->dev);
u32 x, y;
- bool pressed;
+ bool pressed, cont;
int ret;
- while (info->input->users) {
+ mutex_lock(&info->input->mutex);
+ cont = input_device_enabled(info->input);
+ mutex_unlock(&info->input->mutex);
+ while (cont) {
ret = exynos_read_s3c64xx_ts(dev, &x, &y);
if (ret == -ETIMEDOUT)
break;
@@ -651,6 +654,10 @@ static irqreturn_t exynos_ts_isr(int irq, void *dev_id)
input_sync(info->input);
usleep_range(1000, 1100);
+
+ mutex_lock(&info->input->mutex);
+ cont = input_device_enabled(info->input);
+ mutex_unlock(&info->input->mutex);
}
writel(0, ADC_V1_CLRINTPNDNUP(info->regs));
--
2.17.1
^ permalink raw reply related
* [PATCH v3 4/7] ACPI: button: Use input_device_enabled() helper
From: Andrzej Pietrasiewicz @ 2020-06-05 17:33 UTC (permalink / raw)
To: linux-pm-u79uwXL29TY76Z2rM5mHXA,
linux-acpi-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
linux-input-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
patches-yzvPICuk2AA4QjBA90+/kJqQE7yCjDx5,
ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
platform-driver-x86-u79uwXL29TY76Z2rM5mHXA
Cc: Rafael J . Wysocki, Len Brown, Jonathan Cameron, Hartmut Knaack,
Lars-Peter Clausen, Peter Meerwald-Stadler, Kukjin Kim,
Krzysztof Kozlowski, Dmitry Torokhov, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
Vladimir Zapolskiy, Sylvain Lemieux, Laxman Dewangan,
Thierry Reding, Jonathan Hunter, Barry
In-Reply-To: <20200605173335.13753-1-andrzej.p-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
A new helper is available, so use it.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
---
drivers/acpi/button.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index ff7ab291f678..4deb2b48d03c 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -411,7 +411,7 @@ static void acpi_button_notify(struct acpi_device *device, u32 event)
input = button->input;
if (button->type == ACPI_BUTTON_TYPE_LID) {
mutex_lock(&button->input->mutex);
- users = button->input->users;
+ users = input_device_enabled(button->input);
mutex_unlock(&button->input->mutex);
if (users)
acpi_lid_update_state(device, true);
@@ -460,7 +460,7 @@ static int acpi_button_resume(struct device *dev)
button->suspended = false;
mutex_lock(&input->mutex);
- if (button->type == ACPI_BUTTON_TYPE_LID && input->users) {
+ if (button->type == ACPI_BUTTON_TYPE_LID && input_device_enabled(input)) {
button->last_state = !!acpi_lid_evaluate_state(device);
button->last_time = ktime_get();
acpi_lid_initialize_state(device);
--
2.17.1
^ permalink raw reply related
* [PATCH v3 3/7] ACPI: button: Access input device's users under appropriate mutex
From: Andrzej Pietrasiewicz @ 2020-06-05 17:33 UTC (permalink / raw)
To: linux-pm, linux-acpi, linux-kernel, linux-iio, linux-arm-kernel,
linux-samsung-soc, linux-input, linux-tegra, patches,
ibm-acpi-devel, platform-driver-x86
Cc: kernel, Nick Dyer, Laxman Dewangan, Peter Meerwald-Stadler,
Peter Hutterer, Fabio Estevam, Lars-Peter Clausen,
Krzysztof Kozlowski, Jonathan Hunter, Kukjin Kim, NXP Linux Team,
Sylvain Lemieux, Len Brown, Michael Hennerich, Sascha Hauer,
Henrique de Moraes Holschuh, Vladimir Zapolskiy, Hans de Goede,
Barry Song, Ferruh Yigit, Dmitry Torokhov, Rafael J . Wysocki,
Andrzej Pietrasiewicz
In-Reply-To: <20200605173335.13753-1-andrzej.p@collabora.com>
Inspecting input device's 'users' member should be done under device's
mutex, so add appropriate invocations.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
---
drivers/acpi/button.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 78cfc70cb320..ff7ab291f678 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -456,13 +456,16 @@ static int acpi_button_resume(struct device *dev)
{
struct acpi_device *device = to_acpi_device(dev);
struct acpi_button *button = acpi_driver_data(device);
+ struct input_dev *input = button->input;
button->suspended = false;
- if (button->type == ACPI_BUTTON_TYPE_LID && button->input->users) {
+ mutex_lock(&input->mutex);
+ if (button->type == ACPI_BUTTON_TYPE_LID && input->users) {
button->last_state = !!acpi_lid_evaluate_state(device);
button->last_time = ktime_get();
acpi_lid_initialize_state(device);
}
+ mutex_unlock(&input->mutex);
return 0;
}
#endif
--
2.17.1
^ permalink raw reply related
* [PATCH v3 2/7] Input: use input_device_enabled()
From: Andrzej Pietrasiewicz @ 2020-06-05 17:33 UTC (permalink / raw)
To: linux-pm-u79uwXL29TY76Z2rM5mHXA,
linux-acpi-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
linux-input-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
patches-yzvPICuk2AA4QjBA90+/kJqQE7yCjDx5,
ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
platform-driver-x86-u79uwXL29TY76Z2rM5mHXA
Cc: Rafael J . Wysocki, Len Brown, Jonathan Cameron, Hartmut Knaack,
Lars-Peter Clausen, Peter Meerwald-Stadler, Kukjin Kim,
Krzysztof Kozlowski, Dmitry Torokhov, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
Vladimir Zapolskiy, Sylvain Lemieux, Laxman Dewangan,
Thierry Reding, Jonathan Hunter, Barry
In-Reply-To: <20200605173335.13753-1-andrzej.p-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
Use the newly added helper in relevant input drivers.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
---
drivers/input/joystick/xpad.c | 4 ++--
drivers/input/keyboard/ep93xx_keypad.c | 2 +-
drivers/input/keyboard/gpio_keys.c | 4 ++--
drivers/input/keyboard/imx_keypad.c | 4 ++--
drivers/input/keyboard/ipaq-micro-keys.c | 2 +-
drivers/input/keyboard/lpc32xx-keys.c | 4 ++--
drivers/input/keyboard/pmic8xxx-keypad.c | 4 ++--
drivers/input/keyboard/pxa27x_keypad.c | 2 +-
drivers/input/keyboard/samsung-keypad.c | 4 ++--
drivers/input/keyboard/spear-keyboard.c | 8 ++++----
drivers/input/keyboard/st-keyscan.c | 4 ++--
drivers/input/keyboard/tegra-kbc.c | 4 ++--
drivers/input/misc/drv260x.c | 4 ++--
drivers/input/misc/drv2665.c | 4 ++--
drivers/input/misc/drv2667.c | 4 ++--
drivers/input/misc/gp2ap002a00f.c | 4 ++--
drivers/input/misc/kxtj9.c | 4 ++--
drivers/input/misc/sirfsoc-onkey.c | 2 +-
drivers/input/mouse/navpoint.c | 4 ++--
drivers/input/touchscreen/ad7879.c | 6 +++---
drivers/input/touchscreen/atmel_mxt_ts.c | 4 ++--
drivers/input/touchscreen/auo-pixcir-ts.c | 8 ++++----
drivers/input/touchscreen/bu21029_ts.c | 4 ++--
drivers/input/touchscreen/chipone_icn8318.c | 4 ++--
drivers/input/touchscreen/cyttsp_core.c | 4 ++--
drivers/input/touchscreen/eeti_ts.c | 4 ++--
drivers/input/touchscreen/ektf2127.c | 4 ++--
drivers/input/touchscreen/imx6ul_tsc.c | 4 ++--
drivers/input/touchscreen/ipaq-micro-ts.c | 2 +-
drivers/input/touchscreen/iqs5xx.c | 4 ++--
drivers/input/touchscreen/lpc32xx_ts.c | 4 ++--
drivers/input/touchscreen/melfas_mip4.c | 4 ++--
drivers/input/touchscreen/mms114.c | 6 +++---
drivers/input/touchscreen/pixcir_i2c_ts.c | 8 ++++----
drivers/input/touchscreen/ucb1400_ts.c | 4 ++--
drivers/input/touchscreen/wm97xx-core.c | 14 +++++++++-----
drivers/input/touchscreen/zforce_ts.c | 8 ++++----
37 files changed, 86 insertions(+), 82 deletions(-)
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index c77cdb3b62b5..d8b6bc2d2171 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -1902,7 +1902,7 @@ static int xpad_suspend(struct usb_interface *intf, pm_message_t message)
xpad360w_poweroff_controller(xpad);
} else {
mutex_lock(&input->mutex);
- if (input->users)
+ if (input_device_enabled(input))
xpad_stop_input(xpad);
mutex_unlock(&input->mutex);
}
@@ -1922,7 +1922,7 @@ static int xpad_resume(struct usb_interface *intf)
retval = xpad360w_start_input(xpad);
} else {
mutex_lock(&input->mutex);
- if (input->users) {
+ if (input_device_enabled(input)) {
retval = xpad_start_input(xpad);
} else if (xpad->xtype == XTYPE_XBOXONE) {
/*
diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
index 7c70492d9d6b..8194e843d047 100644
--- a/drivers/input/keyboard/ep93xx_keypad.c
+++ b/drivers/input/keyboard/ep93xx_keypad.c
@@ -208,7 +208,7 @@ static int ep93xx_keypad_resume(struct device *dev)
mutex_lock(&input_dev->mutex);
- if (input_dev->users) {
+ if (input_device_enabled(input_dev)) {
if (!keypad->enabled) {
ep93xx_keypad_config(keypad);
clk_enable(keypad->clk);
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 53c9ff338dea..03ad27189553 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -966,7 +966,7 @@ static int __maybe_unused gpio_keys_suspend(struct device *dev)
return error;
} else {
mutex_lock(&input->mutex);
- if (input->users)
+ if (input_device_enabled(input))
gpio_keys_close(input);
mutex_unlock(&input->mutex);
}
@@ -984,7 +984,7 @@ static int __maybe_unused gpio_keys_resume(struct device *dev)
gpio_keys_disable_wakeup(ddata);
} else {
mutex_lock(&input->mutex);
- if (input->users)
+ if (input_device_enabled(input))
error = gpio_keys_open(input);
mutex_unlock(&input->mutex);
}
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index 5a46d113e909..1f5c9ea5e9e5 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -532,7 +532,7 @@ static int __maybe_unused imx_kbd_noirq_suspend(struct device *dev)
/* imx kbd can wake up system even clock is disabled */
mutex_lock(&input_dev->mutex);
- if (input_dev->users)
+ if (input_device_enabled(input_dev))
clk_disable_unprepare(kbd->clk);
mutex_unlock(&input_dev->mutex);
@@ -562,7 +562,7 @@ static int __maybe_unused imx_kbd_noirq_resume(struct device *dev)
mutex_lock(&input_dev->mutex);
- if (input_dev->users) {
+ if (input_device_enabled(input_dev)) {
ret = clk_prepare_enable(kbd->clk);
if (ret)
goto err_clk;
diff --git a/drivers/input/keyboard/ipaq-micro-keys.c b/drivers/input/keyboard/ipaq-micro-keys.c
index e3f9e445e880..13a66a8e3411 100644
--- a/drivers/input/keyboard/ipaq-micro-keys.c
+++ b/drivers/input/keyboard/ipaq-micro-keys.c
@@ -140,7 +140,7 @@ static int __maybe_unused micro_key_resume(struct device *dev)
mutex_lock(&input->mutex);
- if (input->users)
+ if (input_device_enabled(input))
micro_key_start(keys);
mutex_unlock(&input->mutex);
diff --git a/drivers/input/keyboard/lpc32xx-keys.c b/drivers/input/keyboard/lpc32xx-keys.c
index 348af2aeb5de..943aeeb0de79 100644
--- a/drivers/input/keyboard/lpc32xx-keys.c
+++ b/drivers/input/keyboard/lpc32xx-keys.c
@@ -273,7 +273,7 @@ static int lpc32xx_kscan_suspend(struct device *dev)
mutex_lock(&input->mutex);
- if (input->users) {
+ if (input_device_enabled(input)) {
/* Clear IRQ and disable clock */
writel(1, LPC32XX_KS_IRQ(kscandat->kscan_base));
clk_disable_unprepare(kscandat->clk);
@@ -292,7 +292,7 @@ static int lpc32xx_kscan_resume(struct device *dev)
mutex_lock(&input->mutex);
- if (input->users) {
+ if (input_device_enabled(input)) {
/* Enable clock and clear IRQ */
retval = clk_prepare_enable(kscandat->clk);
if (retval == 0)
diff --git a/drivers/input/keyboard/pmic8xxx-keypad.c b/drivers/input/keyboard/pmic8xxx-keypad.c
index 91d5811d6f0e..43b4533e7c41 100644
--- a/drivers/input/keyboard/pmic8xxx-keypad.c
+++ b/drivers/input/keyboard/pmic8xxx-keypad.c
@@ -633,7 +633,7 @@ static int pmic8xxx_kp_suspend(struct device *dev)
} else {
mutex_lock(&input_dev->mutex);
- if (input_dev->users)
+ if (input_device_enabled(input_dev))
pmic8xxx_kp_disable(kp);
mutex_unlock(&input_dev->mutex);
@@ -653,7 +653,7 @@ static int pmic8xxx_kp_resume(struct device *dev)
} else {
mutex_lock(&input_dev->mutex);
- if (input_dev->users)
+ if (input_device_enabled(input_dev))
pmic8xxx_kp_enable(kp);
mutex_unlock(&input_dev->mutex);
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index 7e65708b25a4..a7f8257c8a02 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -694,7 +694,7 @@ static int pxa27x_keypad_resume(struct device *dev)
} else {
mutex_lock(&input_dev->mutex);
- if (input_dev->users) {
+ if (input_device_enabled(input_dev)) {
/* Enable unit clock */
ret = clk_prepare_enable(keypad->clk);
if (!ret)
diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c
index 70c1d086bdd2..74ec068fbf2f 100644
--- a/drivers/input/keyboard/samsung-keypad.c
+++ b/drivers/input/keyboard/samsung-keypad.c
@@ -537,7 +537,7 @@ static int samsung_keypad_suspend(struct device *dev)
mutex_lock(&input_dev->mutex);
- if (input_dev->users)
+ if (input_device_enabled(input_dev))
samsung_keypad_stop(keypad);
samsung_keypad_toggle_wakeup(keypad, true);
@@ -557,7 +557,7 @@ static int samsung_keypad_resume(struct device *dev)
samsung_keypad_toggle_wakeup(keypad, false);
- if (input_dev->users)
+ if (input_device_enabled(input_dev))
samsung_keypad_start(keypad);
mutex_unlock(&input_dev->mutex);
diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
index 9b8d78f87253..9838c79cb288 100644
--- a/drivers/input/keyboard/spear-keyboard.c
+++ b/drivers/input/keyboard/spear-keyboard.c
@@ -318,7 +318,7 @@ static int __maybe_unused spear_kbd_suspend(struct device *dev)
writel_relaxed(val, kbd->io_base + MODE_CTL_REG);
} else {
- if (input_dev->users) {
+ if (input_device_enabled(input_dev)) {
writel_relaxed(mode_ctl_reg & ~MODE_CTL_START_SCAN,
kbd->io_base + MODE_CTL_REG);
clk_disable(kbd->clk);
@@ -326,7 +326,7 @@ static int __maybe_unused spear_kbd_suspend(struct device *dev)
}
/* store current configuration */
- if (input_dev->users)
+ if (input_device_enabled(input_dev))
kbd->mode_ctl_reg = mode_ctl_reg;
/* restore previous clk state */
@@ -351,12 +351,12 @@ static int __maybe_unused spear_kbd_resume(struct device *dev)
disable_irq_wake(kbd->irq);
}
} else {
- if (input_dev->users)
+ if (input_device_enabled(input_dev))
clk_enable(kbd->clk);
}
/* restore current configuration */
- if (input_dev->users)
+ if (input_device_enabled(input_dev))
writel_relaxed(kbd->mode_ctl_reg, kbd->io_base + MODE_CTL_REG);
mutex_unlock(&input_dev->mutex);
diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c
index 27562cd67fb6..a045d61165ac 100644
--- a/drivers/input/keyboard/st-keyscan.c
+++ b/drivers/input/keyboard/st-keyscan.c
@@ -221,7 +221,7 @@ static int keyscan_suspend(struct device *dev)
if (device_may_wakeup(dev))
enable_irq_wake(keypad->irq);
- else if (input->users)
+ else if (input_device_enabled(input))
keyscan_stop(keypad);
mutex_unlock(&input->mutex);
@@ -239,7 +239,7 @@ static int keyscan_resume(struct device *dev)
if (device_may_wakeup(dev))
disable_irq_wake(keypad->irq);
- else if (input->users)
+ else if (input_device_enabled(input))
retval = keyscan_start(keypad);
mutex_unlock(&input->mutex);
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index d34d6947960f..9671842a082a 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -756,7 +756,7 @@ static int tegra_kbc_suspend(struct device *dev)
enable_irq(kbc->irq);
enable_irq_wake(kbc->irq);
} else {
- if (kbc->idev->users)
+ if (input_device_enabled(kbc->idev))
tegra_kbc_stop(kbc);
}
mutex_unlock(&kbc->idev->mutex);
@@ -796,7 +796,7 @@ static int tegra_kbc_resume(struct device *dev)
input_sync(kbc->idev);
}
} else {
- if (kbc->idev->users)
+ if (input_device_enabled(kbc->idev))
err = tegra_kbc_start(kbc);
}
mutex_unlock(&kbc->idev->mutex);
diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c
index 79d7fa710a71..11c1983e286a 100644
--- a/drivers/input/misc/drv260x.c
+++ b/drivers/input/misc/drv260x.c
@@ -580,7 +580,7 @@ static int __maybe_unused drv260x_suspend(struct device *dev)
mutex_lock(&haptics->input_dev->mutex);
- if (haptics->input_dev->users) {
+ if (input_device_enabled(haptics->input_dev)) {
ret = regmap_update_bits(haptics->regmap,
DRV260X_MODE,
DRV260X_STANDBY_MASK,
@@ -612,7 +612,7 @@ static int __maybe_unused drv260x_resume(struct device *dev)
mutex_lock(&haptics->input_dev->mutex);
- if (haptics->input_dev->users) {
+ if (input_device_enabled(haptics->input_dev)) {
ret = regulator_enable(haptics->regulator);
if (ret) {
dev_err(dev, "Failed to enable regulator\n");
diff --git a/drivers/input/misc/drv2665.c b/drivers/input/misc/drv2665.c
index 918ad9c3fa81..e4df1a3b8655 100644
--- a/drivers/input/misc/drv2665.c
+++ b/drivers/input/misc/drv2665.c
@@ -230,7 +230,7 @@ static int __maybe_unused drv2665_suspend(struct device *dev)
mutex_lock(&haptics->input_dev->mutex);
- if (haptics->input_dev->users) {
+ if (input_device_enabled(haptics->input_dev)) {
ret = regmap_update_bits(haptics->regmap, DRV2665_CTRL_2,
DRV2665_STANDBY, DRV2665_STANDBY);
if (ret) {
@@ -259,7 +259,7 @@ static int __maybe_unused drv2665_resume(struct device *dev)
mutex_lock(&haptics->input_dev->mutex);
- if (haptics->input_dev->users) {
+ if (input_device_enabled(haptics->input_dev)) {
ret = regulator_enable(haptics->regulator);
if (ret) {
dev_err(dev, "Failed to enable regulator\n");
diff --git a/drivers/input/misc/drv2667.c b/drivers/input/misc/drv2667.c
index bb9d5784df17..be4be2e0fd6f 100644
--- a/drivers/input/misc/drv2667.c
+++ b/drivers/input/misc/drv2667.c
@@ -405,7 +405,7 @@ static int __maybe_unused drv2667_suspend(struct device *dev)
mutex_lock(&haptics->input_dev->mutex);
- if (haptics->input_dev->users) {
+ if (input_device_enabled(haptics->input_dev)) {
ret = regmap_update_bits(haptics->regmap, DRV2667_CTRL_2,
DRV2667_STANDBY, DRV2667_STANDBY);
if (ret) {
@@ -434,7 +434,7 @@ static int __maybe_unused drv2667_resume(struct device *dev)
mutex_lock(&haptics->input_dev->mutex);
- if (haptics->input_dev->users) {
+ if (input_device_enabled(haptics->input_dev)) {
ret = regulator_enable(haptics->regulator);
if (ret) {
dev_err(dev, "Failed to enable regulator\n");
diff --git a/drivers/input/misc/gp2ap002a00f.c b/drivers/input/misc/gp2ap002a00f.c
index 90abda8eea67..5f61ef90b2f2 100644
--- a/drivers/input/misc/gp2ap002a00f.c
+++ b/drivers/input/misc/gp2ap002a00f.c
@@ -230,7 +230,7 @@ static int __maybe_unused gp2a_suspend(struct device *dev)
enable_irq_wake(client->irq);
} else {
mutex_lock(&dt->input->mutex);
- if (dt->input->users)
+ if (input_device_enabled(dt->input))
retval = gp2a_disable(dt);
mutex_unlock(&dt->input->mutex);
}
@@ -248,7 +248,7 @@ static int __maybe_unused gp2a_resume(struct device *dev)
disable_irq_wake(client->irq);
} else {
mutex_lock(&dt->input->mutex);
- if (dt->input->users)
+ if (input_device_enabled(dt->input))
retval = gp2a_enable(dt);
mutex_unlock(&dt->input->mutex);
}
diff --git a/drivers/input/misc/kxtj9.c b/drivers/input/misc/kxtj9.c
index 52313c6e3fb3..bbb81617c2b2 100644
--- a/drivers/input/misc/kxtj9.c
+++ b/drivers/input/misc/kxtj9.c
@@ -503,7 +503,7 @@ static int __maybe_unused kxtj9_suspend(struct device *dev)
mutex_lock(&input_dev->mutex);
- if (input_dev->users)
+ if (input_device_enabled(input_dev))
kxtj9_disable(tj9);
mutex_unlock(&input_dev->mutex);
@@ -518,7 +518,7 @@ static int __maybe_unused kxtj9_resume(struct device *dev)
mutex_lock(&input_dev->mutex);
- if (input_dev->users)
+ if (input_device_enabled(input_dev))
kxtj9_enable(tj9);
mutex_unlock(&input_dev->mutex);
diff --git a/drivers/input/misc/sirfsoc-onkey.c b/drivers/input/misc/sirfsoc-onkey.c
index 60e1f31ee60a..7982bf8fb839 100644
--- a/drivers/input/misc/sirfsoc-onkey.c
+++ b/drivers/input/misc/sirfsoc-onkey.c
@@ -181,7 +181,7 @@ static int __maybe_unused sirfsoc_pwrc_resume(struct device *dev)
* if users touch X_ONKEY_B, see arch/arm/mach-prima2/pm.c
*/
mutex_lock(&input->mutex);
- if (input->users)
+ if (input_device_enabled(input))
sirfsoc_pwrc_toggle_interrupts(pwrcdrv, true);
mutex_unlock(&input->mutex);
diff --git a/drivers/input/mouse/navpoint.c b/drivers/input/mouse/navpoint.c
index 0b75248c8380..643d4b805b64 100644
--- a/drivers/input/mouse/navpoint.c
+++ b/drivers/input/mouse/navpoint.c
@@ -322,7 +322,7 @@ static int __maybe_unused navpoint_suspend(struct device *dev)
struct input_dev *input = navpoint->input;
mutex_lock(&input->mutex);
- if (input->users)
+ if (input_device_enabled(input))
navpoint_down(navpoint);
mutex_unlock(&input->mutex);
@@ -336,7 +336,7 @@ static int __maybe_unused navpoint_resume(struct device *dev)
struct input_dev *input = navpoint->input;
mutex_lock(&input->mutex);
- if (input->users)
+ if (input_device_enabled(input))
navpoint_up(navpoint);
mutex_unlock(&input->mutex);
diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c
index 556a2af46e18..e850853328f1 100644
--- a/drivers/input/touchscreen/ad7879.c
+++ b/drivers/input/touchscreen/ad7879.c
@@ -306,7 +306,7 @@ static int __maybe_unused ad7879_suspend(struct device *dev)
mutex_lock(&ts->input->mutex);
- if (!ts->suspended && !ts->disabled && ts->input->users)
+ if (!ts->suspended && !ts->disabled && input_device_enabled(ts->input))
__ad7879_disable(ts);
ts->suspended = true;
@@ -322,7 +322,7 @@ static int __maybe_unused ad7879_resume(struct device *dev)
mutex_lock(&ts->input->mutex);
- if (ts->suspended && !ts->disabled && ts->input->users)
+ if (ts->suspended && !ts->disabled && input_device_enabled(ts->input))
__ad7879_enable(ts);
ts->suspended = false;
@@ -339,7 +339,7 @@ static void ad7879_toggle(struct ad7879 *ts, bool disable)
{
mutex_lock(&ts->input->mutex);
- if (!ts->suspended && ts->input->users != 0) {
+ if (!ts->suspended && input_device_enabled(ts->input)) {
if (disable) {
if (ts->disabled)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index ae60442efda0..47b7936bc3e3 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -3151,7 +3151,7 @@ static int __maybe_unused mxt_suspend(struct device *dev)
mutex_lock(&input_dev->mutex);
- if (input_dev->users)
+ if (input_device_enabled(input_dev))
mxt_stop(data);
mutex_unlock(&input_dev->mutex);
@@ -3174,7 +3174,7 @@ static int __maybe_unused mxt_resume(struct device *dev)
mutex_lock(&input_dev->mutex);
- if (input_dev->users)
+ if (input_device_enabled(input_dev))
mxt_start(data);
mutex_unlock(&input_dev->mutex);
diff --git a/drivers/input/touchscreen/auo-pixcir-ts.c b/drivers/input/touchscreen/auo-pixcir-ts.c
index 8e9f3b7b8180..c33e63ca6142 100644
--- a/drivers/input/touchscreen/auo-pixcir-ts.c
+++ b/drivers/input/touchscreen/auo-pixcir-ts.c
@@ -414,7 +414,7 @@ static int __maybe_unused auo_pixcir_suspend(struct device *dev)
*/
if (device_may_wakeup(&client->dev)) {
/* need to start device if not open, to be wakeup source */
- if (!input->users) {
+ if (!input_device_enabled(input)) {
ret = auo_pixcir_start(ts);
if (ret)
goto unlock;
@@ -422,7 +422,7 @@ static int __maybe_unused auo_pixcir_suspend(struct device *dev)
enable_irq_wake(client->irq);
ret = auo_pixcir_power_mode(ts, AUO_PIXCIR_POWER_SLEEP);
- } else if (input->users) {
+ } else if (input_device_enabled(input)) {
ret = auo_pixcir_stop(ts);
}
@@ -445,14 +445,14 @@ static int __maybe_unused auo_pixcir_resume(struct device *dev)
disable_irq_wake(client->irq);
/* need to stop device if it was not open on suspend */
- if (!input->users) {
+ if (!input_device_enabled(input)) {
ret = auo_pixcir_stop(ts);
if (ret)
goto unlock;
}
/* device wakes automatically from SLEEP */
- } else if (input->users) {
+ } else if (input_device_enabled(input)) {
ret = auo_pixcir_start(ts);
}
diff --git a/drivers/input/touchscreen/bu21029_ts.c b/drivers/input/touchscreen/bu21029_ts.c
index 49a8d4bbca3a..341925edb8e6 100644
--- a/drivers/input/touchscreen/bu21029_ts.c
+++ b/drivers/input/touchscreen/bu21029_ts.c
@@ -430,7 +430,7 @@ static int __maybe_unused bu21029_suspend(struct device *dev)
if (!device_may_wakeup(dev)) {
mutex_lock(&bu21029->in_dev->mutex);
- if (bu21029->in_dev->users)
+ if (input_device_enabled(bu21029->in_dev))
bu21029_stop_chip(bu21029->in_dev);
mutex_unlock(&bu21029->in_dev->mutex);
}
@@ -445,7 +445,7 @@ static int __maybe_unused bu21029_resume(struct device *dev)
if (!device_may_wakeup(dev)) {
mutex_lock(&bu21029->in_dev->mutex);
- if (bu21029->in_dev->users)
+ if (input_device_enabled(bu21029->in_dev))
bu21029_start_chip(bu21029->in_dev);
mutex_unlock(&bu21029->in_dev->mutex);
}
diff --git a/drivers/input/touchscreen/chipone_icn8318.c b/drivers/input/touchscreen/chipone_icn8318.c
index d91d2fd78649..f2fb41fb031e 100644
--- a/drivers/input/touchscreen/chipone_icn8318.c
+++ b/drivers/input/touchscreen/chipone_icn8318.c
@@ -154,7 +154,7 @@ static int icn8318_suspend(struct device *dev)
struct icn8318_data *data = i2c_get_clientdata(to_i2c_client(dev));
mutex_lock(&data->input->mutex);
- if (data->input->users)
+ if (input_device_enabled(data->input))
icn8318_stop(data->input);
mutex_unlock(&data->input->mutex);
@@ -166,7 +166,7 @@ static int icn8318_resume(struct device *dev)
struct icn8318_data *data = i2c_get_clientdata(to_i2c_client(dev));
mutex_lock(&data->input->mutex);
- if (data->input->users)
+ if (input_device_enabled(data->input))
icn8318_start(data->input);
mutex_unlock(&data->input->mutex);
diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c
index 3f5d463dbeed..6e49cb80ec6d 100644
--- a/drivers/input/touchscreen/cyttsp_core.c
+++ b/drivers/input/touchscreen/cyttsp_core.c
@@ -479,7 +479,7 @@ static int __maybe_unused cyttsp_suspend(struct device *dev)
mutex_lock(&ts->input->mutex);
- if (ts->input->users) {
+ if (input_device_enabled(ts->input)) {
retval = cyttsp_disable(ts);
if (retval == 0)
ts->suspended = true;
@@ -496,7 +496,7 @@ static int __maybe_unused cyttsp_resume(struct device *dev)
mutex_lock(&ts->input->mutex);
- if (ts->input->users)
+ if (input_device_enabled(ts->input))
cyttsp_enable(ts);
ts->suspended = false;
diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
index 2e1404cd09ec..a639ba7e56ea 100644
--- a/drivers/input/touchscreen/eeti_ts.c
+++ b/drivers/input/touchscreen/eeti_ts.c
@@ -241,7 +241,7 @@ static int __maybe_unused eeti_ts_suspend(struct device *dev)
mutex_lock(&input_dev->mutex);
- if (input_dev->users)
+ if (input_device_enabled(input_dev))
eeti_ts_stop(eeti);
mutex_unlock(&input_dev->mutex);
@@ -263,7 +263,7 @@ static int __maybe_unused eeti_ts_resume(struct device *dev)
mutex_lock(&input_dev->mutex);
- if (input_dev->users)
+ if (input_device_enabled(input_dev))
eeti_ts_start(eeti);
mutex_unlock(&input_dev->mutex);
diff --git a/drivers/input/touchscreen/ektf2127.c b/drivers/input/touchscreen/ektf2127.c
index eadd389cf81f..263bbeb6cee9 100644
--- a/drivers/input/touchscreen/ektf2127.c
+++ b/drivers/input/touchscreen/ektf2127.c
@@ -154,7 +154,7 @@ static int __maybe_unused ektf2127_suspend(struct device *dev)
struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev));
mutex_lock(&ts->input->mutex);
- if (ts->input->users)
+ if (input_device_enabled(ts->input))
ektf2127_stop(ts->input);
mutex_unlock(&ts->input->mutex);
@@ -166,7 +166,7 @@ static int __maybe_unused ektf2127_resume(struct device *dev)
struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev));
mutex_lock(&ts->input->mutex);
- if (ts->input->users)
+ if (input_device_enabled(ts->input))
ektf2127_start(ts->input);
mutex_unlock(&ts->input->mutex);
diff --git a/drivers/input/touchscreen/imx6ul_tsc.c b/drivers/input/touchscreen/imx6ul_tsc.c
index 9ed258854349..59d4a4e9ecc2 100644
--- a/drivers/input/touchscreen/imx6ul_tsc.c
+++ b/drivers/input/touchscreen/imx6ul_tsc.c
@@ -509,7 +509,7 @@ static int __maybe_unused imx6ul_tsc_suspend(struct device *dev)
mutex_lock(&input_dev->mutex);
- if (input_dev->users) {
+ if (input_device_enabled(input_dev)) {
imx6ul_tsc_disable(tsc);
clk_disable_unprepare(tsc->tsc_clk);
@@ -530,7 +530,7 @@ static int __maybe_unused imx6ul_tsc_resume(struct device *dev)
mutex_lock(&input_dev->mutex);
- if (input_dev->users) {
+ if (input_device_enabled(input_dev)) {
retval = clk_prepare_enable(tsc->adc_clk);
if (retval)
goto out;
diff --git a/drivers/input/touchscreen/ipaq-micro-ts.c b/drivers/input/touchscreen/ipaq-micro-ts.c
index 5c3977e1af6f..0eb5689fe65f 100644
--- a/drivers/input/touchscreen/ipaq-micro-ts.c
+++ b/drivers/input/touchscreen/ipaq-micro-ts.c
@@ -135,7 +135,7 @@ static int __maybe_unused micro_ts_resume(struct device *dev)
mutex_lock(&input->mutex);
- if (input->users)
+ if (input_device_enabled(input))
micro_ts_toggle_receive(ts, true);
mutex_unlock(&input->mutex);
diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c
index 5875bb1099a8..8b7b94ef7f39 100644
--- a/drivers/input/touchscreen/iqs5xx.c
+++ b/drivers/input/touchscreen/iqs5xx.c
@@ -1017,7 +1017,7 @@ static int __maybe_unused iqs5xx_suspend(struct device *dev)
mutex_lock(&input->mutex);
- if (input->users)
+ if (input_device_enabled(input))
error = iqs5xx_set_state(iqs5xx->client, IQS5XX_SUSPEND);
mutex_unlock(&input->mutex);
@@ -1036,7 +1036,7 @@ static int __maybe_unused iqs5xx_resume(struct device *dev)
mutex_lock(&input->mutex);
- if (input->users)
+ if (input_device_enabled(input))
error = iqs5xx_set_state(iqs5xx->client, IQS5XX_RESUME);
mutex_unlock(&input->mutex);
diff --git a/drivers/input/touchscreen/lpc32xx_ts.c b/drivers/input/touchscreen/lpc32xx_ts.c
index b2cd9472e2d1..b51450b3d943 100644
--- a/drivers/input/touchscreen/lpc32xx_ts.c
+++ b/drivers/input/touchscreen/lpc32xx_ts.c
@@ -334,7 +334,7 @@ static int lpc32xx_ts_suspend(struct device *dev)
*/
mutex_lock(&input->mutex);
- if (input->users) {
+ if (input_device_enabled(input)) {
if (device_may_wakeup(dev))
enable_irq_wake(tsc->irq);
else
@@ -353,7 +353,7 @@ static int lpc32xx_ts_resume(struct device *dev)
mutex_lock(&input->mutex);
- if (input->users) {
+ if (input_device_enabled(input)) {
if (device_may_wakeup(dev))
disable_irq_wake(tsc->irq);
else
diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c
index 247c3aaba2d8..d33586919f58 100644
--- a/drivers/input/touchscreen/melfas_mip4.c
+++ b/drivers/input/touchscreen/melfas_mip4.c
@@ -1539,7 +1539,7 @@ static int __maybe_unused mip4_suspend(struct device *dev)
if (device_may_wakeup(dev))
ts->wake_irq_enabled = enable_irq_wake(client->irq) == 0;
- else if (input->users)
+ else if (input_device_enabled(input))
mip4_disable(ts);
mutex_unlock(&input->mutex);
@@ -1557,7 +1557,7 @@ static int __maybe_unused mip4_resume(struct device *dev)
if (ts->wake_irq_enabled)
disable_irq_wake(client->irq);
- else if (input->users)
+ else if (input_device_enabled(input))
mip4_enable(ts);
mutex_unlock(&input->mutex);
diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c
index 2ef1adaed9af..a87caa51204e 100644
--- a/drivers/input/touchscreen/mms114.c
+++ b/drivers/input/touchscreen/mms114.c
@@ -198,7 +198,7 @@ static irqreturn_t mms114_interrupt(int irq, void *dev_id)
int error;
mutex_lock(&input_dev->mutex);
- if (!input_dev->users) {
+ if (!input_device_enabled(input_dev)) {
mutex_unlock(&input_dev->mutex);
goto out;
}
@@ -554,7 +554,7 @@ static int __maybe_unused mms114_suspend(struct device *dev)
input_sync(input_dev);
mutex_lock(&input_dev->mutex);
- if (input_dev->users)
+ if (input_device_enabled(input_dev))
mms114_stop(data);
mutex_unlock(&input_dev->mutex);
@@ -569,7 +569,7 @@ static int __maybe_unused mms114_resume(struct device *dev)
int error;
mutex_lock(&input_dev->mutex);
- if (input_dev->users) {
+ if (input_device_enabled(input_dev)) {
error = mms114_start(data);
if (error < 0) {
mutex_unlock(&input_dev->mutex);
diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
index 9aa098577350..dc148b4bed74 100644
--- a/drivers/input/touchscreen/pixcir_i2c_ts.c
+++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
@@ -415,14 +415,14 @@ static int __maybe_unused pixcir_i2c_ts_suspend(struct device *dev)
mutex_lock(&input->mutex);
if (device_may_wakeup(&client->dev)) {
- if (!input->users) {
+ if (!input_device_enabled(input)) {
ret = pixcir_start(ts);
if (ret) {
dev_err(dev, "Failed to start\n");
goto unlock;
}
}
- } else if (input->users) {
+ } else if (input_device_enabled(input)) {
ret = pixcir_stop(ts);
}
@@ -442,14 +442,14 @@ static int __maybe_unused pixcir_i2c_ts_resume(struct device *dev)
mutex_lock(&input->mutex);
if (device_may_wakeup(&client->dev)) {
- if (!input->users) {
+ if (!input_device_enabled(input)) {
ret = pixcir_stop(ts);
if (ret) {
dev_err(dev, "Failed to stop\n");
goto unlock;
}
}
- } else if (input->users) {
+ } else if (input_device_enabled(input)) {
ret = pixcir_start(ts);
}
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c
index 807d39e18091..e3f2c940ef3d 100644
--- a/drivers/input/touchscreen/ucb1400_ts.c
+++ b/drivers/input/touchscreen/ucb1400_ts.c
@@ -410,7 +410,7 @@ static int __maybe_unused ucb1400_ts_suspend(struct device *dev)
mutex_lock(&idev->mutex);
- if (idev->users)
+ if (input_device_enabled(idev))
ucb1400_ts_stop(ucb);
mutex_unlock(&idev->mutex);
@@ -424,7 +424,7 @@ static int __maybe_unused ucb1400_ts_resume(struct device *dev)
mutex_lock(&idev->mutex);
- if (idev->users)
+ if (input_device_enabled(idev))
ucb1400_ts_start(ucb);
mutex_unlock(&idev->mutex);
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index 0a174bd82915..2c2f1b6c5eff 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -806,23 +806,25 @@ static int __maybe_unused wm97xx_suspend(struct device *dev)
else
suspend_mode = 0;
- if (wm->input_dev->users)
+ mutex_lock(&wm->input_dev->mutex);
+ if (input_device_enabled(wm->input_dev))
cancel_delayed_work_sync(&wm->ts_reader);
/* Power down the digitiser (bypassing the cache for resume) */
reg = wm97xx_reg_read(wm, AC97_WM97XX_DIGITISER2);
reg &= ~WM97XX_PRP_DET_DIG;
- if (wm->input_dev->users)
+ if (input_device_enabled(wm->input_dev))
reg |= suspend_mode;
wm->ac97->bus->ops->write(wm->ac97, AC97_WM97XX_DIGITISER2, reg);
/* WM9713 has an additional power bit - turn it off if there
* are no users or if suspend mode is zero. */
if (wm->id == WM9713_ID2 &&
- (!wm->input_dev->users || !suspend_mode)) {
+ (!input_device_enabled(wm->input_dev) || !suspend_mode)) {
reg = wm97xx_reg_read(wm, AC97_EXTENDED_MID) | 0x8000;
wm97xx_reg_write(wm, AC97_EXTENDED_MID, reg);
}
+ mutex_unlock(&wm->input_dev->mutex);
return 0;
}
@@ -831,11 +833,12 @@ static int __maybe_unused wm97xx_resume(struct device *dev)
{
struct wm97xx *wm = dev_get_drvdata(dev);
+ mutex_lock(&wm->input_dev->mutex);
/* restore digitiser and gpios */
if (wm->id == WM9713_ID2) {
wm97xx_reg_write(wm, AC97_WM9713_DIG1, wm->dig[0]);
wm97xx_reg_write(wm, 0x5a, wm->misc);
- if (wm->input_dev->users) {
+ if (input_device_enabled(wm->input_dev)) {
u16 reg;
reg = wm97xx_reg_read(wm, AC97_EXTENDED_MID) & 0x7fff;
wm97xx_reg_write(wm, AC97_EXTENDED_MID, reg);
@@ -852,11 +855,12 @@ static int __maybe_unused wm97xx_resume(struct device *dev)
wm97xx_reg_write(wm, AC97_GPIO_STATUS, wm->gpio[4]);
wm97xx_reg_write(wm, AC97_MISC_AFE, wm->gpio[5]);
- if (wm->input_dev->users && !wm->pen_irq) {
+ if (input_device_enabled(wm->input_dev) && !wm->pen_irq) {
wm->ts_reader_interval = wm->ts_reader_min_interval;
queue_delayed_work(wm->ts_workq, &wm->ts_reader,
wm->ts_reader_interval);
}
+ mutex_unlock(&wm->input_dev->mutex);
return 0;
}
diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
index 5230519b0f74..495629628af6 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -626,14 +626,14 @@ static int __maybe_unused zforce_suspend(struct device *dev)
dev_dbg(&client->dev, "suspend while being a wakeup source\n");
/* Need to start device, if not open, to be a wakeup source. */
- if (!input->users) {
+ if (!input_device_enabled(input)) {
ret = zforce_start(ts);
if (ret)
goto unlock;
}
enable_irq_wake(client->irq);
- } else if (input->users) {
+ } else if (input_device_enabled(input)) {
dev_dbg(&client->dev,
"suspend without being a wakeup source\n");
@@ -670,12 +670,12 @@ static int __maybe_unused zforce_resume(struct device *dev)
disable_irq_wake(client->irq);
/* need to stop device if it was not open on suspend */
- if (!input->users) {
+ if (!input_device_enabled(input)) {
ret = zforce_stop(ts);
if (ret)
goto unlock;
}
- } else if (input->users) {
+ } else if (input_device_enabled(input)) {
dev_dbg(&client->dev, "resume without being a wakeup source\n");
enable_irq(client->irq);
--
2.17.1
^ permalink raw reply related
* [PATCH v3 1/7] Input: add input_device_enabled()
From: Andrzej Pietrasiewicz @ 2020-06-05 17:33 UTC (permalink / raw)
To: linux-pm-u79uwXL29TY76Z2rM5mHXA,
linux-acpi-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
linux-input-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
patches-yzvPICuk2AA4QjBA90+/kJqQE7yCjDx5,
ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
platform-driver-x86-u79uwXL29TY76Z2rM5mHXA
Cc: Rafael J . Wysocki, Len Brown, Jonathan Cameron, Hartmut Knaack,
Lars-Peter Clausen, Peter Meerwald-Stadler, Kukjin Kim,
Krzysztof Kozlowski, Dmitry Torokhov, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
Vladimir Zapolskiy, Sylvain Lemieux, Laxman Dewangan,
Thierry Reding, Jonathan Hunter, Barry
In-Reply-To: <20200605173335.13753-1-andrzej.p-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
A helper function for drivers to decide if the device is used or not.
A lockdep check is introduced as inspecting ->users should be done under
input device's mutex.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
---
drivers/input/input.c | 8 ++++++++
include/linux/input.h | 2 ++
2 files changed, 10 insertions(+)
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 3cfd2c18eebd..41377bfa142d 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -2127,6 +2127,14 @@ void input_enable_softrepeat(struct input_dev *dev, int delay, int period)
}
EXPORT_SYMBOL(input_enable_softrepeat);
+bool input_device_enabled(struct input_dev *dev)
+{
+ lockdep_assert_held(&dev->mutex);
+
+ return dev->users > 0;
+}
+EXPORT_SYMBOL_GPL(input_device_enabled);
+
/**
* input_register_device - register device with input core
* @dev: device to be registered
diff --git a/include/linux/input.h b/include/linux/input.h
index 56f2fd32e609..eda4587dba67 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -502,6 +502,8 @@ bool input_match_device_id(const struct input_dev *dev,
void input_enable_softrepeat(struct input_dev *dev, int delay, int period);
+bool input_device_enabled(struct input_dev *dev);
+
extern struct class input_class;
/**
--
2.17.1
^ permalink raw reply related
* [PATCH v3 0/7] Support inhibiting input devices
From: Andrzej Pietrasiewicz @ 2020-06-05 17:33 UTC (permalink / raw)
To: linux-pm, linux-acpi, linux-kernel, linux-iio, linux-arm-kernel,
linux-samsung-soc, linux-input, linux-tegra, patches,
ibm-acpi-devel, platform-driver-x86
Cc: Rafael J . Wysocki, Len Brown, Jonathan Cameron, Hartmut Knaack,
Lars-Peter Clausen, Peter Meerwald-Stadler, Kukjin Kim,
Krzysztof Kozlowski, Dmitry Torokhov, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
Vladimir Zapolskiy, Sylvain Lemieux, Laxman Dewangan,
Thierry Reding, Jonathan Hunter, Barry
In-Reply-To: <20200604072853.GP89269@dtor-ws>
Userspace might want to implement a policy to temporarily disregard input
from certain devices.
An example use case is a convertible laptop, whose keyboard can be folded
under the screen to create tablet-like experience. The user then must hold
the laptop in such a way that it is difficult to avoid pressing the keyboard
keys. It is therefore desirable to temporarily disregard input from the
keyboard, until it is folded back. This obviously is a policy which should
be kept out of the kernel, but the kernel must provide suitable means to
implement such a policy.
Due to interactions with suspend/resume, a helper has been added for drivers
to decide if the device is being used or not (PATCH 1/7) and it has been
applied to relevant drivers (PATCH 2,4,5,6/7).
PATCH 7/7 adds support for inhibiting input devices.
This work is inspired by:
https://chromium.googlesource.com/chromiumos/third_party/kernel/+/45c2d7bb398f74adfae0017e20b224152fde3822
and
https://chromium.googlesource.com/chromiumos/third_party/kernel/+/4ce0e8a3697edb8fd071110b3af65014512061c7
In this respin the elan_i2c patch is dropped and converting it will be
addressed later.
v2..v3:
- ignored autorepeat events in input_get_disposition() if a key is not
pressed (Hans)
- dropped inhibit()/uninhibit() driver callbacks (Hans)
- split ACPI button patch into taking the lock and using the helper (Rafael)
- dropped the elan_i2c conversion
- fixed typos in exynos adc
v1..v2:
- added input_device_enabled() helper and used it in drivers (Dmitry)
- the fact of open() and close() being called in inhibit/uninhibit paths has
been emphasized in the commit message of PATCH 6/7 (Dmitry)
Andrzej Pietrasiewicz (6):
Input: add input_device_enabled()
Input: use input_device_enabled()
ACPI: button: Access input device's users under appropriate mutex
ACPI: button: Use input_device_enabled() helper
iio: adc: exynos: Use input_device_enabled()
platform/x86: thinkpad_acpi: Use input_device_enabled()
Patrik Fimml (1):
Input: Add "inhibited" property
drivers/acpi/button.c | 7 +-
drivers/iio/adc/exynos_adc.c | 11 +-
drivers/input/input.c | 121 +++++++++++++++++++-
drivers/input/joystick/xpad.c | 4 +-
drivers/input/keyboard/ep93xx_keypad.c | 2 +-
drivers/input/keyboard/gpio_keys.c | 4 +-
drivers/input/keyboard/imx_keypad.c | 4 +-
drivers/input/keyboard/ipaq-micro-keys.c | 2 +-
drivers/input/keyboard/lpc32xx-keys.c | 4 +-
drivers/input/keyboard/pmic8xxx-keypad.c | 4 +-
drivers/input/keyboard/pxa27x_keypad.c | 2 +-
drivers/input/keyboard/samsung-keypad.c | 4 +-
drivers/input/keyboard/spear-keyboard.c | 8 +-
drivers/input/keyboard/st-keyscan.c | 4 +-
drivers/input/keyboard/tegra-kbc.c | 4 +-
drivers/input/misc/drv260x.c | 4 +-
drivers/input/misc/drv2665.c | 4 +-
drivers/input/misc/drv2667.c | 4 +-
drivers/input/misc/gp2ap002a00f.c | 4 +-
drivers/input/misc/kxtj9.c | 4 +-
drivers/input/misc/sirfsoc-onkey.c | 2 +-
drivers/input/mouse/navpoint.c | 4 +-
drivers/input/touchscreen/ad7879.c | 6 +-
drivers/input/touchscreen/atmel_mxt_ts.c | 4 +-
drivers/input/touchscreen/auo-pixcir-ts.c | 8 +-
drivers/input/touchscreen/bu21029_ts.c | 4 +-
drivers/input/touchscreen/chipone_icn8318.c | 4 +-
drivers/input/touchscreen/cyttsp_core.c | 4 +-
drivers/input/touchscreen/eeti_ts.c | 4 +-
drivers/input/touchscreen/ektf2127.c | 4 +-
drivers/input/touchscreen/imx6ul_tsc.c | 4 +-
drivers/input/touchscreen/ipaq-micro-ts.c | 2 +-
drivers/input/touchscreen/iqs5xx.c | 4 +-
drivers/input/touchscreen/lpc32xx_ts.c | 4 +-
drivers/input/touchscreen/melfas_mip4.c | 4 +-
drivers/input/touchscreen/mms114.c | 6 +-
drivers/input/touchscreen/pixcir_i2c_ts.c | 8 +-
drivers/input/touchscreen/ucb1400_ts.c | 4 +-
drivers/input/touchscreen/wm97xx-core.c | 14 ++-
drivers/input/touchscreen/zforce_ts.c | 8 +-
drivers/platform/x86/thinkpad_acpi.c | 4 +-
include/linux/input.h | 14 ++-
42 files changed, 230 insertions(+), 95 deletions(-)
base-commit: 3d77e6a8804abcc0504c904bd6e5cdf3a5cf8162
--
2.17.1
^ permalink raw reply
* [PATCH] serial: serial-tegra: reduce irq-latency after rx errors
From: Randolph Maaßen @ 2020-06-05 14:57 UTC (permalink / raw)
To: Laxman Dewangan
Cc: Greg Kroah-Hartman, Jiri Slaby, Thierry Reding, Jonathan Hunter,
linux-serial-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Randolph Maaßen
Since dev_err() calls can lead to synchronous writes to another serial
console these calls can provide significant latency during irq-handling
in tegra_uart_isr(). With this latency another interrupt is likely to
apper during handling of the first interrupt, which might lock up the
kernel completely.
These errors are reported to the error counters so converting the
dev_err() to dev_dbg() is appropriate.
Signed-off-by: Randolph Maaßen <gaireg-a1pNmjaJ30GzQB+pC5nmwQ@public.gmane.org>
---
drivers/tty/serial/serial-tegra.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
index 8de8bac9c6c7..d3fef5ab289a 100644
--- a/drivers/tty/serial/serial-tegra.c
+++ b/drivers/tty/serial/serial-tegra.c
@@ -439,16 +439,16 @@ static char tegra_uart_decode_rx_error(struct tegra_uart_port *tup,
/* Overrrun error */
flag = TTY_OVERRUN;
tup->uport.icount.overrun++;
- dev_err(tup->uport.dev, "Got overrun errors\n");
+ dev_dbg(tup->uport.dev, "Got overrun errors\n");
} else if (lsr & UART_LSR_PE) {
/* Parity error */
flag = TTY_PARITY;
tup->uport.icount.parity++;
- dev_err(tup->uport.dev, "Got Parity errors\n");
+ dev_dbg(tup->uport.dev, "Got Parity errors\n");
} else if (lsr & UART_LSR_FE) {
flag = TTY_FRAME;
tup->uport.icount.frame++;
- dev_err(tup->uport.dev, "Got frame errors\n");
+ dev_dbg(tup->uport.dev, "Got frame errors\n");
} else if (lsr & UART_LSR_BI) {
/*
* Break error
--
2.11.0
^ permalink raw reply related
* Re: [PATCH] media: staging: tegra-vde: add missing pm_runtime_put_autosuspend
From: Dmitry Osipenko @ 2020-06-05 14:05 UTC (permalink / raw)
To: Jon Hunter, Navid Emamdoost, Mauro Carvalho Chehab,
Greg Kroah-Hartman, Thierry Reding,
linux-media-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: emamd001-OJFnDUYgAso, wu000273-OJFnDUYgAso, kjlu-OJFnDUYgAso,
smccaman-OJFnDUYgAso
In-Reply-To: <7061eb81-c00c-9978-5e4b-f9896c0ffd5e-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
05.06.2020 09:00, Jon Hunter пишет:
>
> On 02/06/2020 06:48, Navid Emamdoost wrote:
>> Call to pm_runtime_get_sync increments counter even in case of
>> failure leading to incorrect ref count.
>> Call pm_runtime_put_autosuspend if pm_runtime_get_sync fails.
>>
>> Signed-off-by: Navid Emamdoost <navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>> drivers/staging/media/tegra-vde/vde.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/media/tegra-vde/vde.c b/drivers/staging/media/tegra-vde/vde.c
>> index d3e63512a765..52cdd4a91e93 100644
>> --- a/drivers/staging/media/tegra-vde/vde.c
>> +++ b/drivers/staging/media/tegra-vde/vde.c
>> @@ -776,8 +776,10 @@ static int tegra_vde_ioctl_decode_h264(struct tegra_vde *vde,
>> goto release_dpb_frames;
>>
>> ret = pm_runtime_get_sync(dev);
>> - if (ret < 0)
>> + if (ret < 0) {
>> + pm_runtime_put_autosuspend(dev);
>> goto unlock;
>> + }
>>
>> /*
>> * We rely on the VDE registers reset value, otherwise VDE
>
> Please use the put in the error path.
This is a third version of the patch [1][2].
[1]
https://patchwork.ozlabs.org/project/linux-tegra/patch/20200514210847.9269-2-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org/
[2]
https://patchwork.ozlabs.org/project/linux-tegra/patch/20200520095148.10995-1-dinghao.liu-Y5EWUtBUdg4nDS1+zs4M5A@public.gmane.org/
I'd prefer to stick with my variant of the patch [1] because in my
opinion it's most straightforward variant and I actually tested that it
works properly.
Navid, anyways thank you for the patch. Next time please check if
somebody else already sent similar patches before you.
^ permalink raw reply
* Re: [PATCH] spi: tegra114: missing put on pm_runtime_get_sync failure
From: Navid Emamdoost @ 2020-06-05 6:13 UTC (permalink / raw)
To: Jon Hunter
Cc: Laxman Dewangan, Mark Brown, Thierry Reding,
linux-spi-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, LKML, Navid Emamdoost,
Qiushi Wu, Kangjie Lu, mccamant-k0Ej6N9cQa43uPMLIKxrzw
In-Reply-To: <f928fb02-47d7-b6f9-6198-bd549d6ac6b5-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
On Fri, Jun 5, 2020 at 1:09 AM Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
>
>
> On 02/06/2020 05:55, Navid Emamdoost wrote:
> > the call to pm_runtime_get_sync increments the counter even
> > in case of failure leading to incorrect ref count.
> > Call pm_runtime_put if pm_runtime_get_sync fails.
> >
> > Signed-off-by: Navid Emamdoost <navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > ---
> > drivers/spi/spi-tegra114.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
> > index 83edabdb41ad..dccd2ac1a975 100644
> > --- a/drivers/spi/spi-tegra114.c
> > +++ b/drivers/spi/spi-tegra114.c
> > @@ -974,6 +974,7 @@ static int tegra_spi_setup(struct spi_device *spi)
> > dev_err(tspi->dev, "pm runtime failed, e = %d\n", ret);
> > if (cdata)
> > tegra_spi_cleanup(spi);
> > + pm_runtime_put(tspi->dev);
> > return ret;
> > }
> >
> > @@ -1398,6 +1399,7 @@ static int tegra_spi_probe(struct platform_device *pdev)
> > ret = pm_runtime_get_sync(&pdev->dev);
> > if (ret < 0) {
> > dev_err(&pdev->dev, "pm runtime get failed, e = %d\n", ret);
> > + pm_runtime_put(&pdev->dev);
> > goto exit_pm_disable;
> > }
>
> I am wondering if it is better we use put_sync() here to ensure that
> this happens before we exit the probe.
To be honest I am not sure when to use different flavors of
pm_runtime_put (like pm_runtime_put_noidle,
pm_runtime_put_autosuspend, pm_runtime_put_sync, pm_runtime_put,
pm_runtime_put_sync_suspend). I'd appreciate it if you could give me a
pointer on how to decide on this.
>
> Jon
>
> --
> nvpublic
--
Navid.
^ permalink raw reply
* Re: [PATCH] spi: tegra20-sflash: call pm_runtime_put in case of pm_runtime_get failure
From: Jon Hunter @ 2020-06-05 6:10 UTC (permalink / raw)
To: Navid Emamdoost, Laxman Dewangan, Mark Brown, Thierry Reding,
linux-spi-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: emamd001-OJFnDUYgAso, wu000273-OJFnDUYgAso, kjlu-OJFnDUYgAso,
smccaman-OJFnDUYgAso
In-Reply-To: <20200602044049.17378-1-navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 02/06/2020 05:40, Navid Emamdoost wrote:
> The counter is incremented via pm_runtime_get even in failure case.
> To correct the counter call pm_runtime_put in case of failure, too.
>
> Signed-off-by: Navid Emamdoost <navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> drivers/spi/spi-tegra20-sflash.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c
> index 514429379206..33c34f9c2021 100644
> --- a/drivers/spi/spi-tegra20-sflash.c
> +++ b/drivers/spi/spi-tegra20-sflash.c
> @@ -552,6 +552,7 @@ static int tegra_sflash_resume(struct device *dev)
>
> ret = pm_runtime_get_sync(dev);
> if (ret < 0) {
> + pm_runtime_put(dev);
> dev_err(dev, "pm runtime failed, e = %d\n", ret);
> return ret;
> }
There is another instance of this in this driver that needs fixing.
Jon
--
nvpublic
^ permalink raw reply
* Re: [PATCH] spi: tegra114: missing put on pm_runtime_get_sync failure
From: Jon Hunter @ 2020-06-05 6:09 UTC (permalink / raw)
To: Navid Emamdoost, Laxman Dewangan, Mark Brown, Thierry Reding,
linux-spi-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: emamd001-OJFnDUYgAso, wu000273-OJFnDUYgAso, kjlu-OJFnDUYgAso,
mccamant-k0Ej6N9cQa43uPMLIKxrzw
In-Reply-To: <20200602045506.40574-1-navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 02/06/2020 05:55, Navid Emamdoost wrote:
> the call to pm_runtime_get_sync increments the counter even
> in case of failure leading to incorrect ref count.
> Call pm_runtime_put if pm_runtime_get_sync fails.
>
> Signed-off-by: Navid Emamdoost <navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> drivers/spi/spi-tegra114.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
> index 83edabdb41ad..dccd2ac1a975 100644
> --- a/drivers/spi/spi-tegra114.c
> +++ b/drivers/spi/spi-tegra114.c
> @@ -974,6 +974,7 @@ static int tegra_spi_setup(struct spi_device *spi)
> dev_err(tspi->dev, "pm runtime failed, e = %d\n", ret);
> if (cdata)
> tegra_spi_cleanup(spi);
> + pm_runtime_put(tspi->dev);
> return ret;
> }
>
> @@ -1398,6 +1399,7 @@ static int tegra_spi_probe(struct platform_device *pdev)
> ret = pm_runtime_get_sync(&pdev->dev);
> if (ret < 0) {
> dev_err(&pdev->dev, "pm runtime get failed, e = %d\n", ret);
> + pm_runtime_put(&pdev->dev);
> goto exit_pm_disable;
> }
I am wondering if it is better we use put_sync() here to ensure that
this happens before we exit the probe.
Jon
--
nvpublic
^ permalink raw reply
* Re: [PATCH] spi: tegra20-slink: add missing pm_runtime_put
From: Jon Hunter @ 2020-06-05 6:02 UTC (permalink / raw)
To: Navid Emamdoost, Laxman Dewangan, Mark Brown, Thierry Reding,
linux-spi-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: emamd001-OJFnDUYgAso, wu000273-OJFnDUYgAso, kjlu-OJFnDUYgAso,
smccaman-OJFnDUYgAso
In-Reply-To: <20200602052602.91374-1-navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 02/06/2020 06:26, Navid Emamdoost wrote:
> Call to pm_runtime_get_sync increments counter even in case of
> failure leading to incorrect ref count.
> Call pm_runtime_put if pm_runtime_get_sync fails.
>
> Signed-off-by: Navid Emamdoost <navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> drivers/spi/spi-tegra20-slink.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
> index 7f4d932dade7..0675b36d647b 100644
> --- a/drivers/spi/spi-tegra20-slink.c
> +++ b/drivers/spi/spi-tegra20-slink.c
> @@ -1192,6 +1192,7 @@ static int tegra_slink_resume(struct device *dev)
> ret = pm_runtime_get_sync(dev);
> if (ret < 0) {
> dev_err(dev, "pm runtime failed, e = %d\n", ret);
> + pm_runtime_put(dev);
> return ret;
> }
> tegra_slink_writel(tspi, tspi->command_reg, SLINK_COMMAND);
Please squash this patch with the other 2 that are fixing the same
issues in the same driver.
Jon
--
nvpublic
^ permalink raw reply
* Re: [PATCH] media: staging: tegra-vde: add missing pm_runtime_put_autosuspend
From: Jon Hunter @ 2020-06-05 6:00 UTC (permalink / raw)
To: Navid Emamdoost, Dmitry Osipenko, Mauro Carvalho Chehab,
Greg Kroah-Hartman, Thierry Reding,
linux-media-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: emamd001-OJFnDUYgAso, wu000273-OJFnDUYgAso, kjlu-OJFnDUYgAso,
smccaman-OJFnDUYgAso
In-Reply-To: <20200602054841.15746-1-navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 02/06/2020 06:48, Navid Emamdoost wrote:
> Call to pm_runtime_get_sync increments counter even in case of
> failure leading to incorrect ref count.
> Call pm_runtime_put_autosuspend if pm_runtime_get_sync fails.
>
> Signed-off-by: Navid Emamdoost <navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> drivers/staging/media/tegra-vde/vde.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/tegra-vde/vde.c b/drivers/staging/media/tegra-vde/vde.c
> index d3e63512a765..52cdd4a91e93 100644
> --- a/drivers/staging/media/tegra-vde/vde.c
> +++ b/drivers/staging/media/tegra-vde/vde.c
> @@ -776,8 +776,10 @@ static int tegra_vde_ioctl_decode_h264(struct tegra_vde *vde,
> goto release_dpb_frames;
>
> ret = pm_runtime_get_sync(dev);
> - if (ret < 0)
> + if (ret < 0) {
> + pm_runtime_put_autosuspend(dev);
> goto unlock;
> + }
>
> /*
> * We rely on the VDE registers reset value, otherwise VDE
Please use the put in the error path.
Jon
--
nvpublic
^ permalink raw reply
* Re: [PATCH] PCI: tegra: handle failure case of pm_runtime_get_sync
From: Jon Hunter @ 2020-06-05 5:58 UTC (permalink / raw)
To: Navid Emamdoost, Thierry Reding, Lorenzo Pieralisi, Rob Herring,
Bjorn Helgaas, linux-tegra, linux-pci, linux-kernel
Cc: emamd001, wu000273, kjlu, smccaman
In-Reply-To: <20200605031239.6638-1-navid.emamdoost@gmail.com>
On 05/06/2020 04:12, Navid Emamdoost wrote:
> Calling pm_runtime_get_sync increments the counter even in case of
> failure, causing incorrect ref count. Call pm_runtime_put if
> pm_runtime_get_sync fails.
>
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> ---
> drivers/pci/controller/pci-tegra.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c
> index 3e64ba6a36a8..3d4b448fd8df 100644
> --- a/drivers/pci/controller/pci-tegra.c
> +++ b/drivers/pci/controller/pci-tegra.c
> @@ -2712,6 +2712,7 @@ static int tegra_pcie_probe(struct platform_device *pdev)
> err = pm_runtime_get_sync(pcie->dev);
> if (err < 0) {
> dev_err(dev, "fail to enable pcie controller: %d\n", err);
> + pm_runtime_put_sync(pcie->dev);
> goto teardown_msi;
> }
Same thing for this patch, there is already a put in the error path and
so it is not necessary to add the put call here. Just update the goto
label.
Jon
--
nvpublic
^ permalink raw reply
* Re: [PATCH] dmaengine: tegra210-adma: handle pm_runtime_get_sync failure cases
From: Jon Hunter @ 2020-06-05 5:56 UTC (permalink / raw)
To: Navid Emamdoost, Laxman Dewangan, Dan Williams, Vinod Koul,
Thierry Reding, dmaengine-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: emamd001-OJFnDUYgAso, wu000273-OJFnDUYgAso, kjlu-OJFnDUYgAso,
mccamant-k0Ej6N9cQa43uPMLIKxrzw
In-Reply-To: <20200604201058.86457-1-navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 04/06/2020 21:10, Navid Emamdoost wrote:
> Calling pm_runtime_get_sync increments the counter even in case of
> failure, causing incorrect ref count. Call pm_runtime_put if
> pm_runtime_get_sync fails.
>
> Signed-off-by: Navid Emamdoost <navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> drivers/dma/tegra210-adma.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
> index c4ce5dfb149b..899eaaf9fc48 100644
> --- a/drivers/dma/tegra210-adma.c
> +++ b/drivers/dma/tegra210-adma.c
> @@ -659,6 +659,7 @@ static int tegra_adma_alloc_chan_resources(struct dma_chan *dc)
> ret = pm_runtime_get_sync(tdc2dev(tdc));
> if (ret < 0) {
> free_irq(tdc->irq, tdc);
> + pm_runtime_put(tdc2dev(tdc));
> return ret;
> }
>
> @@ -870,7 +871,7 @@ static int tegra_adma_probe(struct platform_device *pdev)
>
> ret = pm_runtime_get_sync(&pdev->dev);
> if (ret < 0)
> - goto rpm_disable;
> + goto rpm_put;
>
> ret = tegra_adma_init(tdma);
> if (ret)
>
The label rpm_disable should now be removed. You should also update the
subject-prefix to be [PATCH V2] to make it clear that this is the
updated patch.
Jon
--
nvpublic
^ permalink raw reply
* [PATCH] PCI: tegra: handle failure case of pm_runtime_get_sync
From: Navid Emamdoost @ 2020-06-05 3:12 UTC (permalink / raw)
To: Thierry Reding, Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas,
Jonathan Hunter, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-pci-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: emamd001-OJFnDUYgAso, wu000273-OJFnDUYgAso, kjlu-OJFnDUYgAso,
smccaman-OJFnDUYgAso, Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of
failure, causing incorrect ref count. Call pm_runtime_put if
pm_runtime_get_sync fails.
Signed-off-by: Navid Emamdoost <navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/pci/controller/pci-tegra.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c
index 3e64ba6a36a8..3d4b448fd8df 100644
--- a/drivers/pci/controller/pci-tegra.c
+++ b/drivers/pci/controller/pci-tegra.c
@@ -2712,6 +2712,7 @@ static int tegra_pcie_probe(struct platform_device *pdev)
err = pm_runtime_get_sync(pcie->dev);
if (err < 0) {
dev_err(dev, "fail to enable pcie controller: %d\n", err);
+ pm_runtime_put_sync(pcie->dev);
goto teardown_msi;
}
--
2.17.1
^ permalink raw reply related
* [PATCH] sdhci: tegra: Add comment for PADCALIB and PAD_CONTROL NVQUIRKS
From: Sowjanya Komatineni @ 2020-06-05 3:04 UTC (permalink / raw)
To: adrian.hunter, ulf.hansson, thierry.reding, jonathanh
Cc: skomatineni, linux-tegra, linux-kernel, linux-mmc
This patch adds comments about NVQUIRKS HAS_PADCALIB and NEEDS_PAD_CONTROL.
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
---
drivers/mmc/host/sdhci-tegra.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 3a372ab..0a3f9d0 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -96,7 +96,16 @@
#define NVQUIRK_ENABLE_SDR50 BIT(3)
#define NVQUIRK_ENABLE_SDR104 BIT(4)
#define NVQUIRK_ENABLE_DDR50 BIT(5)
+/*
+ * HAS_PADCALIB NVQUIRK is for SoC's supporting auto calibration of pads
+ * drive strength.
+ */
#define NVQUIRK_HAS_PADCALIB BIT(6)
+/*
+ * NEEDS_PAD_CONTROL NVQUIRK is for SoC's having separate 3V3 and 1V8 pads.
+ * 3V3/1V8 pad selection happens through pinctrl state selection depending
+ * on the signaling mode.
+ */
#define NVQUIRK_NEEDS_PAD_CONTROL BIT(7)
#define NVQUIRK_DIS_CARD_CLK_CONFIG_TAP BIT(8)
#define NVQUIRK_CQHCI_DCMD_R1B_CMD_TIMING BIT(9)
--
2.7.4
^ permalink raw reply related
* [PATCH v6 4/4] iommu/arm-smmu-nvidia: fix the warning reported by kbuild test robot
From: Krishna Reddy @ 2020-06-04 23:44 UTC (permalink / raw)
Cc: joro-zLv9SwRftAIdnm+yROfE0A, will-DgEjT+Ai2ygdnm+yROfE0A,
robin.murphy-5wv7dgnIgG8,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
treding-DDmLM1+adcrQT0dZR+AlfA, yhsu-DDmLM1+adcrQT0dZR+AlfA,
snikam-DDmLM1+adcrQT0dZR+AlfA, praithatha-DDmLM1+adcrQT0dZR+AlfA,
talho-DDmLM1+adcrQT0dZR+AlfA, bbiswas-DDmLM1+adcrQT0dZR+AlfA,
mperttunen-DDmLM1+adcrQT0dZR+AlfA,
nicolinc-DDmLM1+adcrQT0dZR+AlfA, bhuntsman-DDmLM1+adcrQT0dZR+AlfA,
Krishna Reddy, kbuild test robot
In-Reply-To: <20200604234414.21912-1-vdumpa-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>> drivers/iommu/arm-smmu-nvidia.c:151:33: sparse: sparse: cast removes
>> address space '<asn:2>' of expression
Reported-by: kbuild test robot <lkp-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Krishna Reddy <vdumpa-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
drivers/iommu/arm-smmu-nvidia.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/arm-smmu-nvidia.c b/drivers/iommu/arm-smmu-nvidia.c
index 5999b6a770992..6348d8dc17fc2 100644
--- a/drivers/iommu/arm-smmu-nvidia.c
+++ b/drivers/iommu/arm-smmu-nvidia.c
@@ -248,7 +248,7 @@ struct arm_smmu_device *nvidia_smmu_impl_init(struct arm_smmu_device *smmu)
break;
nsmmu->bases[i] = devm_ioremap_resource(dev, res);
if (IS_ERR(nsmmu->bases[i]))
- return (struct arm_smmu_device *)nsmmu->bases[i];
+ return ERR_CAST(nsmmu->bases[i]);
nsmmu->num_inst++;
}
--
2.26.2
^ permalink raw reply related
* [PATCH v6 3/4] iommu/arm-smmu: Add global/context fault implementation hooks
From: Krishna Reddy @ 2020-06-04 23:44 UTC (permalink / raw)
Cc: snikam-DDmLM1+adcrQT0dZR+AlfA, mperttunen-DDmLM1+adcrQT0dZR+AlfA,
bhuntsman-DDmLM1+adcrQT0dZR+AlfA, will-DgEjT+Ai2ygdnm+yROfE0A,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
praithatha-DDmLM1+adcrQT0dZR+AlfA, talho-DDmLM1+adcrQT0dZR+AlfA,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
nicolinc-DDmLM1+adcrQT0dZR+AlfA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, yhsu-DDmLM1+adcrQT0dZR+AlfA,
treding-DDmLM1+adcrQT0dZR+AlfA, robin.murphy-5wv7dgnIgG8,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
bbiswas-DDmLM1+adcrQT0dZR+AlfA
In-Reply-To: <20200604234414.21912-1-vdumpa-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Add global/context fault hooks to allow NVIDIA SMMU implementation
handle faults across multiple SMMUs.
Signed-off-by: Krishna Reddy <vdumpa-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
drivers/iommu/arm-smmu-nvidia.c | 100 ++++++++++++++++++++++++++++++++
drivers/iommu/arm-smmu.c | 11 +++-
drivers/iommu/arm-smmu.h | 3 +
3 files changed, 112 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/arm-smmu-nvidia.c b/drivers/iommu/arm-smmu-nvidia.c
index dafc293a45217..5999b6a770992 100644
--- a/drivers/iommu/arm-smmu-nvidia.c
+++ b/drivers/iommu/arm-smmu-nvidia.c
@@ -117,6 +117,104 @@ static int nsmmu_reset(struct arm_smmu_device *smmu)
return 0;
}
+static struct arm_smmu_domain *to_smmu_domain(struct iommu_domain *dom)
+{
+ return container_of(dom, struct arm_smmu_domain, domain);
+}
+
+static irqreturn_t nsmmu_global_fault_inst(int irq,
+ struct arm_smmu_device *smmu,
+ int inst)
+{
+ u32 gfsr, gfsynr0, gfsynr1, gfsynr2;
+
+ gfsr = readl_relaxed(nsmmu_page(smmu, inst, 0) + ARM_SMMU_GR0_sGFSR);
+ gfsynr0 = readl_relaxed(nsmmu_page(smmu, inst, 0) +
+ ARM_SMMU_GR0_sGFSYNR0);
+ gfsynr1 = readl_relaxed(nsmmu_page(smmu, inst, 0) +
+ ARM_SMMU_GR0_sGFSYNR1);
+ gfsynr2 = readl_relaxed(nsmmu_page(smmu, inst, 0) +
+ ARM_SMMU_GR0_sGFSYNR2);
+
+ if (!gfsr)
+ return IRQ_NONE;
+
+ dev_err_ratelimited(smmu->dev,
+ "Unexpected global fault, this could be serious\n");
+ dev_err_ratelimited(smmu->dev,
+ "\tGFSR 0x%08x, GFSYNR0 0x%08x, GFSYNR1 0x%08x, GFSYNR2 0x%08x\n",
+ gfsr, gfsynr0, gfsynr1, gfsynr2);
+
+ writel_relaxed(gfsr, nsmmu_page(smmu, inst, 0) + ARM_SMMU_GR0_sGFSR);
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t nsmmu_global_fault(int irq, void *dev)
+{
+ int inst;
+ irqreturn_t irq_ret = IRQ_NONE;
+ struct arm_smmu_device *smmu = dev;
+
+ for (inst = 0; inst < to_nvidia_smmu(smmu)->num_inst; inst++) {
+ irq_ret = nsmmu_global_fault_inst(irq, smmu, inst);
+ if (irq_ret == IRQ_HANDLED)
+ return irq_ret;
+ }
+
+ return irq_ret;
+}
+
+static irqreturn_t nsmmu_context_fault_bank(int irq,
+ struct arm_smmu_device *smmu,
+ int idx, int inst)
+{
+ u32 fsr, fsynr, cbfrsynra;
+ unsigned long iova;
+
+ fsr = arm_smmu_cb_read(smmu, idx, ARM_SMMU_CB_FSR);
+ if (!(fsr & ARM_SMMU_FSR_FAULT))
+ return IRQ_NONE;
+
+ fsynr = readl_relaxed(nsmmu_page(smmu, inst, smmu->numpage + idx) +
+ ARM_SMMU_CB_FSYNR0);
+ iova = readq_relaxed(nsmmu_page(smmu, inst, smmu->numpage + idx) +
+ ARM_SMMU_CB_FAR);
+ cbfrsynra = readl_relaxed(nsmmu_page(smmu, inst, 1) +
+ ARM_SMMU_GR1_CBFRSYNRA(idx));
+
+ dev_err_ratelimited(smmu->dev,
+ "Unhandled context fault: fsr=0x%x, iova=0x%08lx, fsynr=0x%x, cbfrsynra=0x%x, cb=%d\n",
+ fsr, iova, fsynr, cbfrsynra, idx);
+
+ writel_relaxed(fsr, nsmmu_page(smmu, inst, smmu->numpage + idx) +
+ ARM_SMMU_CB_FSR);
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t nsmmu_context_fault(int irq, void *dev)
+{
+ int inst, idx;
+ irqreturn_t irq_ret = IRQ_NONE;
+ struct iommu_domain *domain = dev;
+ struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
+ struct arm_smmu_device *smmu = smmu_domain->smmu;
+
+ for (inst = 0; inst < to_nvidia_smmu(smmu)->num_inst; inst++) {
+ /* Interrupt line shared between all context faults.
+ * Check for faults across all contexts.
+ */
+ for (idx = 0; idx < smmu->num_context_banks; idx++) {
+ irq_ret = nsmmu_context_fault_bank(irq, smmu,
+ idx, inst);
+
+ if (irq_ret == IRQ_HANDLED)
+ return irq_ret;
+ }
+ }
+
+ return irq_ret;
+}
+
static const struct arm_smmu_impl nvidia_smmu_impl = {
.read_reg = nsmmu_read_reg,
.write_reg = nsmmu_write_reg,
@@ -124,6 +222,8 @@ static const struct arm_smmu_impl nvidia_smmu_impl = {
.write_reg64 = nsmmu_write_reg64,
.reset = nsmmu_reset,
.tlb_sync = nsmmu_tlb_sync,
+ .global_fault = nsmmu_global_fault,
+ .context_fault = nsmmu_context_fault,
};
struct arm_smmu_device *nvidia_smmu_impl_init(struct arm_smmu_device *smmu)
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 243bc4cb2705b..d720e1e191176 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -673,6 +673,7 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
enum io_pgtable_fmt fmt;
struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
struct arm_smmu_cfg *cfg = &smmu_domain->cfg;
+ irqreturn_t (*context_fault)(int irq, void *dev);
mutex_lock(&smmu_domain->init_mutex);
if (smmu_domain->smmu)
@@ -835,7 +836,9 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
* handler seeing a half-initialised domain state.
*/
irq = smmu->irqs[smmu->num_global_irqs + cfg->irptndx];
- ret = devm_request_irq(smmu->dev, irq, arm_smmu_context_fault,
+ context_fault = (smmu->impl && smmu->impl->context_fault) ?
+ smmu->impl->context_fault : arm_smmu_context_fault;
+ ret = devm_request_irq(smmu->dev, irq, context_fault,
IRQF_SHARED, "arm-smmu-context-fault", domain);
if (ret < 0) {
dev_err(smmu->dev, "failed to request context IRQ %d (%u)\n",
@@ -2107,6 +2110,7 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
struct arm_smmu_device *smmu;
struct device *dev = &pdev->dev;
int num_irqs, i, err;
+ irqreturn_t (*global_fault)(int irq, void *dev);
smmu = devm_kzalloc(dev, sizeof(*smmu), GFP_KERNEL);
if (!smmu) {
@@ -2193,9 +2197,12 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
smmu->num_context_irqs = smmu->num_context_banks;
}
+ global_fault = (smmu->impl && smmu->impl->global_fault) ?
+ smmu->impl->global_fault : arm_smmu_global_fault;
+
for (i = 0; i < smmu->num_global_irqs; ++i) {
err = devm_request_irq(smmu->dev, smmu->irqs[i],
- arm_smmu_global_fault,
+ global_fault,
IRQF_SHARED,
"arm-smmu global fault",
smmu);
diff --git a/drivers/iommu/arm-smmu.h b/drivers/iommu/arm-smmu.h
index d88374b68da31..f8ce34c07d961 100644
--- a/drivers/iommu/arm-smmu.h
+++ b/drivers/iommu/arm-smmu.h
@@ -18,6 +18,7 @@
#include <linux/io-64-nonatomic-hi-lo.h>
#include <linux/io-pgtable.h>
#include <linux/iommu.h>
+#include <linux/irqreturn.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include <linux/types.h>
@@ -387,6 +388,8 @@ struct arm_smmu_impl {
void (*tlb_sync)(struct arm_smmu_device *smmu, int page, int sync,
int status);
int (*def_domain_type)(struct device *dev);
+ irqreturn_t (*global_fault)(int irq, void *dev);
+ irqreturn_t (*context_fault)(int irq, void *dev);
};
static inline void __iomem *arm_smmu_page(struct arm_smmu_device *smmu, int n)
--
2.26.2
^ permalink raw reply related
* [PATCH v6 2/4] dt-bindings: arm-smmu: Add binding for Tegra194 SMMU
From: Krishna Reddy @ 2020-06-04 23:44 UTC (permalink / raw)
Cc: snikam-DDmLM1+adcrQT0dZR+AlfA, mperttunen-DDmLM1+adcrQT0dZR+AlfA,
bhuntsman-DDmLM1+adcrQT0dZR+AlfA, will-DgEjT+Ai2ygdnm+yROfE0A,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
praithatha-DDmLM1+adcrQT0dZR+AlfA, talho-DDmLM1+adcrQT0dZR+AlfA,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
nicolinc-DDmLM1+adcrQT0dZR+AlfA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, yhsu-DDmLM1+adcrQT0dZR+AlfA,
treding-DDmLM1+adcrQT0dZR+AlfA, robin.murphy-5wv7dgnIgG8,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
bbiswas-DDmLM1+adcrQT0dZR+AlfA
In-Reply-To: <20200604234414.21912-1-vdumpa-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Add binding for NVIDIA's Tegra194 Soc SMMU that is based
on ARM MMU-500.
Signed-off-by: Krishna Reddy <vdumpa-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
index e3ef1c69d1326..8f7ffd248f303 100644
--- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
+++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
@@ -37,6 +37,11 @@ properties:
- qcom,sc7180-smmu-500
- qcom,sdm845-smmu-500
- const: arm,mmu-500
+ - description: NVIDIA SoCs that use more than one "arm,mmu-500"
+ items:
+ - enum:
+ - nvdia,tegra194-smmu-500
+ - const: arm,mmu-500
- items:
- const: arm,mmu-500
- const: arm,smmu-v2
--
2.26.2
^ permalink raw reply related
* [PATCH v6 1/4] iommu/arm-smmu: add NVIDIA implementation for dual ARM MMU-500 usage
From: Krishna Reddy @ 2020-06-04 23:44 UTC (permalink / raw)
Cc: joro-zLv9SwRftAIdnm+yROfE0A, will-DgEjT+Ai2ygdnm+yROfE0A,
robin.murphy-5wv7dgnIgG8,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
treding-DDmLM1+adcrQT0dZR+AlfA, yhsu-DDmLM1+adcrQT0dZR+AlfA,
snikam-DDmLM1+adcrQT0dZR+AlfA, praithatha-DDmLM1+adcrQT0dZR+AlfA,
talho-DDmLM1+adcrQT0dZR+AlfA, bbiswas-DDmLM1+adcrQT0dZR+AlfA,
mperttunen-DDmLM1+adcrQT0dZR+AlfA,
nicolinc-DDmLM1+adcrQT0dZR+AlfA, bhuntsman-DDmLM1+adcrQT0dZR+AlfA,
Krishna Reddy
In-Reply-To: <20200604234414.21912-1-vdumpa-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
NVIDIA's Tegra194 soc uses two ARM MMU-500s together to interleave
IOVA accesses across them.
Add NVIDIA implementation for dual ARM MMU-500s and add new compatible
string for Tegra194 soc.
Signed-off-by: Krishna Reddy <vdumpa-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
MAINTAINERS | 2 +
drivers/iommu/Makefile | 2 +-
drivers/iommu/arm-smmu-impl.c | 3 +
drivers/iommu/arm-smmu-nvidia.c | 161 ++++++++++++++++++++++++++++++++
drivers/iommu/arm-smmu.h | 1 +
5 files changed, 168 insertions(+), 1 deletion(-)
create mode 100644 drivers/iommu/arm-smmu-nvidia.c
diff --git a/MAINTAINERS b/MAINTAINERS
index 50659d76976b7..118da0893c964 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -16572,9 +16572,11 @@ F: drivers/i2c/busses/i2c-tegra.c
TEGRA IOMMU DRIVERS
M: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
+R: Krishna Reddy <vdumpa-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
L: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
S: Supported
F: drivers/iommu/tegra*
+F: drivers/iommu/arm-smmu-nvidia.c
TEGRA KBC DRIVER
M: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile
index 57cf4ba5e27cb..35542df00da72 100644
--- a/drivers/iommu/Makefile
+++ b/drivers/iommu/Makefile
@@ -15,7 +15,7 @@ obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o amd_iommu_init.o amd_iommu_quirks.o
obj-$(CONFIG_AMD_IOMMU_DEBUGFS) += amd_iommu_debugfs.o
obj-$(CONFIG_AMD_IOMMU_V2) += amd_iommu_v2.o
obj-$(CONFIG_ARM_SMMU) += arm_smmu.o
-arm_smmu-objs += arm-smmu.o arm-smmu-impl.o arm-smmu-qcom.o
+arm_smmu-objs += arm-smmu.o arm-smmu-impl.o arm-smmu-qcom.o arm-smmu-nvidia.o
obj-$(CONFIG_ARM_SMMU_V3) += arm-smmu-v3.o
obj-$(CONFIG_DMAR_TABLE) += dmar.o
obj-$(CONFIG_INTEL_IOMMU) += intel-iommu.o intel-pasid.o
diff --git a/drivers/iommu/arm-smmu-impl.c b/drivers/iommu/arm-smmu-impl.c
index c75b9d957b702..52c84c30f83e4 100644
--- a/drivers/iommu/arm-smmu-impl.c
+++ b/drivers/iommu/arm-smmu-impl.c
@@ -160,6 +160,9 @@ struct arm_smmu_device *arm_smmu_impl_init(struct arm_smmu_device *smmu)
*/
switch (smmu->model) {
case ARM_MMU500:
+ if (of_device_is_compatible(smmu->dev->of_node,
+ "nvidia,tegra194-smmu-500"))
+ return nvidia_smmu_impl_init(smmu);
smmu->impl = &arm_mmu500_impl;
break;
case CAVIUM_SMMUV2:
diff --git a/drivers/iommu/arm-smmu-nvidia.c b/drivers/iommu/arm-smmu-nvidia.c
new file mode 100644
index 0000000000000..dafc293a45217
--- /dev/null
+++ b/drivers/iommu/arm-smmu-nvidia.c
@@ -0,0 +1,161 @@
+// SPDX-License-Identifier: GPL-2.0-only
+// Nvidia ARM SMMU v2 implementation quirks
+// Copyright (C) 2019 NVIDIA CORPORATION. All rights reserved.
+
+#define pr_fmt(fmt) "nvidia-smmu: " fmt
+
+#include <linux/bitfield.h>
+#include <linux/delay.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+
+#include "arm-smmu.h"
+
+/* Tegra194 has three ARM MMU-500 Instances.
+ * Two of them are used together for Interleaved IOVA accesses and
+ * used by Non-Isochronous Hw devices for SMMU translations.
+ * Third one is used for SMMU translations from Isochronous HW devices.
+ * It is possible to use this Implementation to program either
+ * all three or two of the instances identically as desired through
+ * DT node.
+ *
+ * Programming all the three instances identically comes with redundant tlb
+ * invalidations as all three never need to be tlb invalidated for a HW device.
+ *
+ * When Linux Kernel supports multiple SMMU devices, The SMMU device used for
+ * Isochornous HW devices should be added as a separate ARM MMU-500 device
+ * in DT and be programmed independently for efficient tlb invalidates.
+ *
+ */
+#define MAX_SMMU_INSTANCES 3
+
+#define TLB_LOOP_TIMEOUT 1000000 /* 1s! */
+#define TLB_SPIN_COUNT 10
+
+struct nvidia_smmu {
+ struct arm_smmu_device smmu;
+ unsigned int num_inst;
+ void __iomem *bases[MAX_SMMU_INSTANCES];
+};
+
+#define to_nvidia_smmu(s) container_of(s, struct nvidia_smmu, smmu)
+
+#define nsmmu_page(smmu, inst, page) \
+ (((inst) ? to_nvidia_smmu(smmu)->bases[(inst)] : smmu->base) + \
+ ((page) << smmu->pgshift))
+
+static u32 nsmmu_read_reg(struct arm_smmu_device *smmu,
+ int page, int offset)
+{
+ return readl_relaxed(nsmmu_page(smmu, 0, page) + offset);
+}
+
+static void nsmmu_write_reg(struct arm_smmu_device *smmu,
+ int page, int offset, u32 val)
+{
+ unsigned int i;
+
+ for (i = 0; i < to_nvidia_smmu(smmu)->num_inst; i++)
+ writel_relaxed(val, nsmmu_page(smmu, i, page) + offset);
+}
+
+static u64 nsmmu_read_reg64(struct arm_smmu_device *smmu,
+ int page, int offset)
+{
+ return readq_relaxed(nsmmu_page(smmu, 0, page) + offset);
+}
+
+static void nsmmu_write_reg64(struct arm_smmu_device *smmu,
+ int page, int offset, u64 val)
+{
+ unsigned int i;
+
+ for (i = 0; i < to_nvidia_smmu(smmu)->num_inst; i++)
+ writeq_relaxed(val, nsmmu_page(smmu, i, page) + offset);
+}
+
+static void nsmmu_tlb_sync(struct arm_smmu_device *smmu, int page,
+ int sync, int status)
+{
+ u32 reg;
+ unsigned int i;
+ unsigned int spin_cnt, delay;
+
+ arm_smmu_writel(smmu, page, sync, 0);
+
+ for (delay = 1; delay < TLB_LOOP_TIMEOUT; delay *= 2) {
+ for (spin_cnt = TLB_SPIN_COUNT; spin_cnt > 0; spin_cnt--) {
+ reg = 0;
+ for (i = 0; i < to_nvidia_smmu(smmu)->num_inst; i++) {
+ reg |= readl_relaxed(
+ nsmmu_page(smmu, i, page) + status);
+ }
+ if (!(reg & ARM_SMMU_sTLBGSTATUS_GSACTIVE))
+ return;
+ cpu_relax();
+ }
+ udelay(delay);
+ }
+ dev_err_ratelimited(smmu->dev,
+ "TLB sync timed out -- SMMU may be deadlocked\n");
+}
+
+static int nsmmu_reset(struct arm_smmu_device *smmu)
+{
+ u32 reg;
+ unsigned int i;
+
+ for (i = 0; i < to_nvidia_smmu(smmu)->num_inst; i++) {
+ /* clear global FSR */
+ reg = readl_relaxed(nsmmu_page(smmu, i, ARM_SMMU_GR0) +
+ ARM_SMMU_GR0_sGFSR);
+ writel_relaxed(reg, nsmmu_page(smmu, i, ARM_SMMU_GR0) +
+ ARM_SMMU_GR0_sGFSR);
+ }
+
+ return 0;
+}
+
+static const struct arm_smmu_impl nvidia_smmu_impl = {
+ .read_reg = nsmmu_read_reg,
+ .write_reg = nsmmu_write_reg,
+ .read_reg64 = nsmmu_read_reg64,
+ .write_reg64 = nsmmu_write_reg64,
+ .reset = nsmmu_reset,
+ .tlb_sync = nsmmu_tlb_sync,
+};
+
+struct arm_smmu_device *nvidia_smmu_impl_init(struct arm_smmu_device *smmu)
+{
+ unsigned int i;
+ struct nvidia_smmu *nsmmu;
+ struct resource *res;
+ struct device *dev = smmu->dev;
+ struct platform_device *pdev = to_platform_device(smmu->dev);
+
+ nsmmu = devm_kzalloc(smmu->dev, sizeof(*nsmmu), GFP_KERNEL);
+ if (!nsmmu)
+ return ERR_PTR(-ENOMEM);
+
+ nsmmu->smmu = *smmu;
+ /* Instance 0 is ioremapped by arm-smmu.c */
+ nsmmu->num_inst = 1;
+
+ for (i = 1; i < MAX_SMMU_INSTANCES; i++) {
+ res = platform_get_resource(pdev, IORESOURCE_MEM, i);
+ if (!res)
+ break;
+ nsmmu->bases[i] = devm_ioremap_resource(dev, res);
+ if (IS_ERR(nsmmu->bases[i]))
+ return (struct arm_smmu_device *)nsmmu->bases[i];
+ nsmmu->num_inst++;
+ }
+
+ nsmmu->smmu.impl = &nvidia_smmu_impl;
+ devm_kfree(smmu->dev, smmu);
+ pr_info("NVIDIA ARM SMMU Implementation, Instances=%d\n",
+ nsmmu->num_inst);
+
+ return &nsmmu->smmu;
+}
diff --git a/drivers/iommu/arm-smmu.h b/drivers/iommu/arm-smmu.h
index d172c024be618..d88374b68da31 100644
--- a/drivers/iommu/arm-smmu.h
+++ b/drivers/iommu/arm-smmu.h
@@ -451,6 +451,7 @@ static inline void arm_smmu_writeq(struct arm_smmu_device *smmu, int page,
struct arm_smmu_device *arm_smmu_impl_init(struct arm_smmu_device *smmu);
struct arm_smmu_device *qcom_smmu_impl_init(struct arm_smmu_device *smmu);
+struct arm_smmu_device *nvidia_smmu_impl_init(struct arm_smmu_device *smmu);
int arm_mmu500_reset(struct arm_smmu_device *smmu);
--
2.26.2
^ permalink raw reply related
* [PATCH v6 0/4] Nvidia Arm SMMUv2 Implementation
From: Krishna Reddy @ 2020-06-04 23:44 UTC (permalink / raw)
Cc: snikam-DDmLM1+adcrQT0dZR+AlfA, mperttunen-DDmLM1+adcrQT0dZR+AlfA,
bhuntsman-DDmLM1+adcrQT0dZR+AlfA, will-DgEjT+Ai2ygdnm+yROfE0A,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
praithatha-DDmLM1+adcrQT0dZR+AlfA, talho-DDmLM1+adcrQT0dZR+AlfA,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
nicolinc-DDmLM1+adcrQT0dZR+AlfA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, yhsu-DDmLM1+adcrQT0dZR+AlfA,
treding-DDmLM1+adcrQT0dZR+AlfA, robin.murphy-5wv7dgnIgG8,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
bbiswas-DDmLM1+adcrQT0dZR+AlfA
Changes in v6:
Restricted the patch set to driver specific patches.
Fixed the cast warning reported by kbuild test robot.
Rebased on git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
v5 - https://lkml.org/lkml/2020/5/21/1114
v4 - https://lkml.org/lkml/2019/10/30/1054
v3 - https://lkml.org/lkml/2019/10/18/1601
v2 - https://lkml.org/lkml/2019/9/2/980
v1 - https://lkml.org/lkml/2019/8/29/1588
Krishna Reddy (4):
iommu/arm-smmu: add NVIDIA implementation for dual ARM MMU-500 usage
dt-bindings: arm-smmu: Add binding for Tegra194 SMMU
iommu/arm-smmu: Add global/context fault implementation hooks
iommu/arm-smmu-nvidia: fix the warning reported by kbuild test robot
.../devicetree/bindings/iommu/arm,smmu.yaml | 5 +
MAINTAINERS | 2 +
drivers/iommu/Makefile | 2 +-
drivers/iommu/arm-smmu-impl.c | 3 +
drivers/iommu/arm-smmu-nvidia.c | 261 ++++++++++++++++++
drivers/iommu/arm-smmu.c | 11 +-
drivers/iommu/arm-smmu.h | 4 +
7 files changed, 285 insertions(+), 3 deletions(-)
create mode 100644 drivers/iommu/arm-smmu-nvidia.c
base-commit: 431275afdc7155415254aef4bd3816a1b8a2ead0
--
2.26.2
^ permalink raw reply
* Re: [PATCH v8 2/6] ARM: tegra: Add device-tree for ASUS Google Nexus 7
From: Dmitry Osipenko @ 2020-06-04 20:11 UTC (permalink / raw)
To: Michał Mirosław
Cc: Rob Herring, Thierry Reding, Jonathan Hunter, David Heidelberg,
Peter Geis, Stephen Warren, Nicolas Chauvet, Pedro Ângelo,
Matt Merhar, Zack Pearsall, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <cf73df1a-92ed-f509-74e8-1c847945fb14-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
16.05.2020 15:01, Dmitry Osipenko пишет:
> 15.05.2020 21:18, Michał Mirosław пишет:
>> On Fri, May 15, 2020 at 12:36:50AM +0300, Dmitry Osipenko wrote:
>>> There are few hardware variants of NVIDIA Tegra30-based Nexus 7 device:
>>>
>>> 1. WiFi-only (named Grouper)
>>> 2. GSM (named Tilapia)
>>> 3. Using Maxim PMIC (E1565 board ID)
>>> 4. Using Ti PMIC (PM269 board ID)
>>
>> Hi,
>>
>> I've briefly looked at the PM269 devicetree (PMIC part) and it looks very
>> similar, if not the same, to what I deduced from the TF300T kernel.
>
> Hello Michał,
>
> Definitely there are board parts that are reused by different devices.
> This is not surprising since most of the boards are designed by the same
> company.
>
>> Those devices don't look to differ much from original Cardhu tablet
>> devkit, so maybe the trees can base off of that?
>
> I don't think it's really possible in a case of Nexus 7 because in
> overall the used hardware components differ a bit too much. It shouldn't
> worth the effort, IMO.
>
>> I would also guess that because of this 'ram-code', memory timings would
>> be duplicated between devices. I can see small differences between
>> ram-code=1 timings of Grouper and TF300T, though they look like arbiter
>> tuning differences. I'll have to test if my TF300T works with Grouper's
>> settings. In case they work, could you split the memory timings to another
>> dtsi file?
>
> Yes, perhaps this could be done. The memory timings on Grouper and
> Tilapia are pretty much the same as well. As you noticed, there are some
> tuning differences of TF300T in comparison to the Nexus 7, the same
> applies to the Grouper and Tilapia variants.
>
>> BTW, shouldn't EMC timing set match MC? I see more frequencies listed in
>> MC than EMC nodes.
>
> The MC timings are exactly the same on Grouper and Tilapia, but EMC
> timings have a very minor differences, and thus, the common.dtsi misses
> these differentiating EMC timings, they are defined in grouper.dtsi and
> tilapia.dts.
>
> I guess we indeed could try to select the lowest common denominator
> timing and re-use it. I'll consider this change for v9, thank you very
> much for the suggestion.
Hello Michał,
I tried to investigate whether we could unify the memory timings and
it's hard to tell. The values are mostly off by one in most cases for
one or two registers, in others cases a memory-chip feature is enabled
or disabled for the same memory module. It certainly feels like we could
safely ignore all those minor differences, but I don't have enough
expertise in order to decide firmly. In my opinion it should be better
to leave the memory timings as-is for the starter, we could always get
back to the unification later on.
^ permalink raw reply
* [PATCH] dmaengine: tegra210-adma: handle pm_runtime_get_sync failure cases
From: Navid Emamdoost @ 2020-06-04 20:10 UTC (permalink / raw)
To: Laxman Dewangan, Jon Hunter, Dan Williams, Vinod Koul,
Thierry Reding, dmaengine-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: emamd001-OJFnDUYgAso, wu000273-OJFnDUYgAso, kjlu-OJFnDUYgAso,
mccamant-k0Ej6N9cQa43uPMLIKxrzw, Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of
failure, causing incorrect ref count. Call pm_runtime_put if
pm_runtime_get_sync fails.
Signed-off-by: Navid Emamdoost <navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/dma/tegra210-adma.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
index c4ce5dfb149b..899eaaf9fc48 100644
--- a/drivers/dma/tegra210-adma.c
+++ b/drivers/dma/tegra210-adma.c
@@ -659,6 +659,7 @@ static int tegra_adma_alloc_chan_resources(struct dma_chan *dc)
ret = pm_runtime_get_sync(tdc2dev(tdc));
if (ret < 0) {
free_irq(tdc->irq, tdc);
+ pm_runtime_put(tdc2dev(tdc));
return ret;
}
@@ -870,7 +871,7 @@ static int tegra_adma_probe(struct platform_device *pdev)
ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0)
- goto rpm_disable;
+ goto rpm_put;
ret = tegra_adma_init(tdma);
if (ret)
--
2.17.1
^ permalink raw reply related
* Re: [PATCH] pinctrl: tegra: Use noirq suspend/resume callbacks
From: Dmitry Osipenko @ 2020-06-04 18:00 UTC (permalink / raw)
To: Vidya Sagar, linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
treding-DDmLM1+adcrQT0dZR+AlfA, jonathanh-DDmLM1+adcrQT0dZR+AlfA,
skomatineni-DDmLM1+adcrQT0dZR+AlfA
Cc: linux-gpio-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
kthota-DDmLM1+adcrQT0dZR+AlfA, mmaddireddy-DDmLM1+adcrQT0dZR+AlfA,
sagar.tv-Re5JQEeQqe8AvxtiuMwx3w
In-Reply-To: <20200604174935.26560-1-vidyas-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
04.06.2020 20:49, Vidya Sagar пишет:
> Use noirq suspend/resume callbacks as other drivers which implement
> noirq suspend/resume callbacks (Ex:- PCIe) depend on pinctrl driver to
> configure the signals used by their respective devices in the noirq phase.
>
> Signed-off-by: Vidya Sagar <vidyas-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
> drivers/pinctrl/tegra/pinctrl-tegra.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c b/drivers/pinctrl/tegra/pinctrl-tegra.c
> index 21661f6490d6..195cfe557511 100644
> --- a/drivers/pinctrl/tegra/pinctrl-tegra.c
> +++ b/drivers/pinctrl/tegra/pinctrl-tegra.c
> @@ -731,8 +731,8 @@ static int tegra_pinctrl_resume(struct device *dev)
> }
>
> const struct dev_pm_ops tegra_pinctrl_pm = {
> - .suspend = &tegra_pinctrl_suspend,
> - .resume = &tegra_pinctrl_resume
> + .suspend_noirq = &tegra_pinctrl_suspend,
> + .resume_noirq = &tegra_pinctrl_resume
> };
>
> static bool tegra_pinctrl_gpio_node_has_range(struct tegra_pmx *pmx)
>
That's a good catch! Perhaps I2C on later Tegra SoCs also should suffer
similarly to the PCIe.
Reviewed-by: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
^ permalink raw reply
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