Skip to content

Commit e5c8fc5

Browse files
committed
Merge tag 'pinctrl-v6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij: - Fix a double-free in the pinctrl_enable() errorpath - Fix a refcount leak in pinctrl_dt_to_map() - Fix selecting the GPIO pin control state and the UART3 pin config group in the Intel Baytrail driver - Fix readback of schmitt trigger status in the Mediatek Paris driver, along with some semantic pin config issues in this driver - Fix a pin suffix typo in the Meson A1 driver - Fix an erroneous register offset in he Aspeed G6 driver - Fix an inconsistent lock state and the interrupt type on resume in the Renesas RZG2L driver - Fix some minor confusion in the Renesas DT bindings * tag 'pinctrl-v6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: renesas: rzg2l: Configure the interrupt type on resume pinctrl: devicetree: fix refcount leak in pinctrl_dt_to_map() pinctrl: baytrail: Add pinconf group for uart3 pinctrl: baytrail: Fix selecting gpio pinctrl state pinctrl: mediatek: paris: Rework support for PIN_CONFIG_{INPUT,OUTPUT}_ENABLE pinctrl: mediatek: paris: Fix PIN_CONFIG_INPUT_SCHMITT_ENABLE readback pinctrl: core: delete incorrect free in pinctrl_enable() pinctrl/meson: fix typo in PDM's pin name pinctrl: pinctrl-aspeed-g6: Fix register offset for pinconf of GPIOR-T pinctrl: renesas: rzg2l: Execute atomically the interrupt configuration dt-bindings: pinctrl: renesas,rzg2l-pinctrl: Allow 'input' and 'output-enable' properties
2 parents 98369dc + ac816e9 commit e5c8fc5

File tree

9 files changed

+100
-96
lines changed

9 files changed

+100
-96
lines changed

Documentation/devicetree/bindings/pinctrl/renesas,rzg2l-pinctrl.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ additionalProperties:
120120
slew-rate: true
121121
gpio-hog: true
122122
gpios: true
123+
input: true
123124
input-enable: true
125+
output-enable: true
124126
output-high: true
125127
output-low: true
126128
line-name: true

drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#define SCU614 0x614 /* Disable GPIO Internal Pull-Down #1 */
4444
#define SCU618 0x618 /* Disable GPIO Internal Pull-Down #2 */
4545
#define SCU61C 0x61c /* Disable GPIO Internal Pull-Down #3 */
46-
#define SCU620 0x620 /* Disable GPIO Internal Pull-Down #4 */
46+
#define SCU630 0x630 /* Disable GPIO Internal Pull-Down #4 */
4747
#define SCU634 0x634 /* Disable GPIO Internal Pull-Down #5 */
4848
#define SCU638 0x638 /* Disable GPIO Internal Pull-Down #6 */
4949
#define SCU690 0x690 /* Multi-function Pin Control #24 */
@@ -2495,38 +2495,38 @@ static struct aspeed_pin_config aspeed_g6_configs[] = {
24952495
ASPEED_PULL_DOWN_PINCONF(D14, SCU61C, 0),
24962496

24972497
/* GPIOS7 */
2498-
ASPEED_PULL_DOWN_PINCONF(T24, SCU620, 23),
2498+
ASPEED_PULL_DOWN_PINCONF(T24, SCU630, 23),
24992499
/* GPIOS6 */
2500-
ASPEED_PULL_DOWN_PINCONF(P23, SCU620, 22),
2500+
ASPEED_PULL_DOWN_PINCONF(P23, SCU630, 22),
25012501
/* GPIOS5 */
2502-
ASPEED_PULL_DOWN_PINCONF(P24, SCU620, 21),
2502+
ASPEED_PULL_DOWN_PINCONF(P24, SCU630, 21),
25032503
/* GPIOS4 */
2504-
ASPEED_PULL_DOWN_PINCONF(R26, SCU620, 20),
2504+
ASPEED_PULL_DOWN_PINCONF(R26, SCU630, 20),
25052505
/* GPIOS3*/
2506-
ASPEED_PULL_DOWN_PINCONF(R24, SCU620, 19),
2506+
ASPEED_PULL_DOWN_PINCONF(R24, SCU630, 19),
25072507
/* GPIOS2 */
2508-
ASPEED_PULL_DOWN_PINCONF(T26, SCU620, 18),
2508+
ASPEED_PULL_DOWN_PINCONF(T26, SCU630, 18),
25092509
/* GPIOS1 */
2510-
ASPEED_PULL_DOWN_PINCONF(T25, SCU620, 17),
2510+
ASPEED_PULL_DOWN_PINCONF(T25, SCU630, 17),
25112511
/* GPIOS0 */
2512-
ASPEED_PULL_DOWN_PINCONF(R23, SCU620, 16),
2512+
ASPEED_PULL_DOWN_PINCONF(R23, SCU630, 16),
25132513

25142514
/* GPIOR7 */
2515-
ASPEED_PULL_DOWN_PINCONF(U26, SCU620, 15),
2515+
ASPEED_PULL_DOWN_PINCONF(U26, SCU630, 15),
25162516
/* GPIOR6 */
2517-
ASPEED_PULL_DOWN_PINCONF(W26, SCU620, 14),
2517+
ASPEED_PULL_DOWN_PINCONF(W26, SCU630, 14),
25182518
/* GPIOR5 */
2519-
ASPEED_PULL_DOWN_PINCONF(T23, SCU620, 13),
2519+
ASPEED_PULL_DOWN_PINCONF(T23, SCU630, 13),
25202520
/* GPIOR4 */
2521-
ASPEED_PULL_DOWN_PINCONF(U25, SCU620, 12),
2521+
ASPEED_PULL_DOWN_PINCONF(U25, SCU630, 12),
25222522
/* GPIOR3*/
2523-
ASPEED_PULL_DOWN_PINCONF(V26, SCU620, 11),
2523+
ASPEED_PULL_DOWN_PINCONF(V26, SCU630, 11),
25242524
/* GPIOR2 */
2525-
ASPEED_PULL_DOWN_PINCONF(V24, SCU620, 10),
2525+
ASPEED_PULL_DOWN_PINCONF(V24, SCU630, 10),
25262526
/* GPIOR1 */
2527-
ASPEED_PULL_DOWN_PINCONF(U24, SCU620, 9),
2527+
ASPEED_PULL_DOWN_PINCONF(U24, SCU630, 9),
25282528
/* GPIOR0 */
2529-
ASPEED_PULL_DOWN_PINCONF(V25, SCU620, 8),
2529+
ASPEED_PULL_DOWN_PINCONF(V25, SCU630, 8),
25302530

25312531
/* GPIOX7 */
25322532
ASPEED_PULL_DOWN_PINCONF(AB10, SCU634, 31),

drivers/pinctrl/core.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,13 +2124,7 @@ int pinctrl_enable(struct pinctrl_dev *pctldev)
21242124

21252125
error = pinctrl_claim_hogs(pctldev);
21262126
if (error) {
2127-
dev_err(pctldev->dev, "could not claim hogs: %i\n",
2128-
error);
2129-
pinctrl_free_pindescs(pctldev, pctldev->desc->pins,
2130-
pctldev->desc->npins);
2131-
mutex_destroy(&pctldev->mutex);
2132-
kfree(pctldev);
2133-
2127+
dev_err(pctldev->dev, "could not claim hogs: %i\n", error);
21342128
return error;
21352129
}
21362130

drivers/pinctrl/devicetree.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,16 @@ int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev)
220220
for (state = 0; ; state++) {
221221
/* Retrieve the pinctrl-* property */
222222
propname = kasprintf(GFP_KERNEL, "pinctrl-%d", state);
223-
if (!propname)
224-
return -ENOMEM;
223+
if (!propname) {
224+
ret = -ENOMEM;
225+
goto err;
226+
}
225227
prop = of_find_property(np, propname, &size);
226228
kfree(propname);
227229
if (!prop) {
228230
if (state == 0) {
229-
of_node_put(np);
230-
return -ENODEV;
231+
ret = -ENODEV;
232+
goto err;
231233
}
232234
break;
233235
}

drivers/pinctrl/intel/pinctrl-baytrail.c

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ static const unsigned int byt_score_pins_map[BYT_NGPIO_SCORE] = {
231231
/* SCORE groups */
232232
static const unsigned int byt_score_uart1_pins[] = { 70, 71, 72, 73 };
233233
static const unsigned int byt_score_uart2_pins[] = { 74, 75, 76, 77 };
234+
static const unsigned int byt_score_uart3_pins[] = { 57, 61 };
234235

235236
static const unsigned int byt_score_pwm0_pins[] = { 94 };
236237
static const unsigned int byt_score_pwm1_pins[] = { 95 };
@@ -278,37 +279,38 @@ static const unsigned int byt_score_plt_clk5_pins[] = { 101 };
278279
static const unsigned int byt_score_smbus_pins[] = { 51, 52, 53 };
279280

280281
static const struct intel_pingroup byt_score_groups[] = {
281-
PIN_GROUP("uart1_grp", byt_score_uart1_pins, 1),
282-
PIN_GROUP("uart2_grp", byt_score_uart2_pins, 1),
283-
PIN_GROUP("pwm0_grp", byt_score_pwm0_pins, 1),
284-
PIN_GROUP("pwm1_grp", byt_score_pwm1_pins, 1),
285-
PIN_GROUP("ssp2_grp", byt_score_ssp2_pins, 1),
286-
PIN_GROUP("sio_spi_grp", byt_score_sio_spi_pins, 1),
287-
PIN_GROUP("i2c5_grp", byt_score_i2c5_pins, 1),
288-
PIN_GROUP("i2c6_grp", byt_score_i2c6_pins, 1),
289-
PIN_GROUP("i2c4_grp", byt_score_i2c4_pins, 1),
290-
PIN_GROUP("i2c3_grp", byt_score_i2c3_pins, 1),
291-
PIN_GROUP("i2c2_grp", byt_score_i2c2_pins, 1),
292-
PIN_GROUP("i2c1_grp", byt_score_i2c1_pins, 1),
293-
PIN_GROUP("i2c0_grp", byt_score_i2c0_pins, 1),
294-
PIN_GROUP("ssp0_grp", byt_score_ssp0_pins, 1),
295-
PIN_GROUP("ssp1_grp", byt_score_ssp1_pins, 1),
296-
PIN_GROUP("sdcard_grp", byt_score_sdcard_pins, byt_score_sdcard_mux_values),
297-
PIN_GROUP("sdio_grp", byt_score_sdio_pins, 1),
298-
PIN_GROUP("emmc_grp", byt_score_emmc_pins, 1),
299-
PIN_GROUP("lpc_grp", byt_score_ilb_lpc_pins, 1),
300-
PIN_GROUP("sata_grp", byt_score_sata_pins, 1),
301-
PIN_GROUP("plt_clk0_grp", byt_score_plt_clk0_pins, 1),
302-
PIN_GROUP("plt_clk1_grp", byt_score_plt_clk1_pins, 1),
303-
PIN_GROUP("plt_clk2_grp", byt_score_plt_clk2_pins, 1),
304-
PIN_GROUP("plt_clk3_grp", byt_score_plt_clk3_pins, 1),
305-
PIN_GROUP("plt_clk4_grp", byt_score_plt_clk4_pins, 1),
306-
PIN_GROUP("plt_clk5_grp", byt_score_plt_clk5_pins, 1),
307-
PIN_GROUP("smbus_grp", byt_score_smbus_pins, 1),
282+
PIN_GROUP_GPIO("uart1_grp", byt_score_uart1_pins, 1),
283+
PIN_GROUP_GPIO("uart2_grp", byt_score_uart2_pins, 1),
284+
PIN_GROUP_GPIO("uart3_grp", byt_score_uart3_pins, 1),
285+
PIN_GROUP_GPIO("pwm0_grp", byt_score_pwm0_pins, 1),
286+
PIN_GROUP_GPIO("pwm1_grp", byt_score_pwm1_pins, 1),
287+
PIN_GROUP_GPIO("ssp2_grp", byt_score_ssp2_pins, 1),
288+
PIN_GROUP_GPIO("sio_spi_grp", byt_score_sio_spi_pins, 1),
289+
PIN_GROUP_GPIO("i2c5_grp", byt_score_i2c5_pins, 1),
290+
PIN_GROUP_GPIO("i2c6_grp", byt_score_i2c6_pins, 1),
291+
PIN_GROUP_GPIO("i2c4_grp", byt_score_i2c4_pins, 1),
292+
PIN_GROUP_GPIO("i2c3_grp", byt_score_i2c3_pins, 1),
293+
PIN_GROUP_GPIO("i2c2_grp", byt_score_i2c2_pins, 1),
294+
PIN_GROUP_GPIO("i2c1_grp", byt_score_i2c1_pins, 1),
295+
PIN_GROUP_GPIO("i2c0_grp", byt_score_i2c0_pins, 1),
296+
PIN_GROUP_GPIO("ssp0_grp", byt_score_ssp0_pins, 1),
297+
PIN_GROUP_GPIO("ssp1_grp", byt_score_ssp1_pins, 1),
298+
PIN_GROUP_GPIO("sdcard_grp", byt_score_sdcard_pins, byt_score_sdcard_mux_values),
299+
PIN_GROUP_GPIO("sdio_grp", byt_score_sdio_pins, 1),
300+
PIN_GROUP_GPIO("emmc_grp", byt_score_emmc_pins, 1),
301+
PIN_GROUP_GPIO("lpc_grp", byt_score_ilb_lpc_pins, 1),
302+
PIN_GROUP_GPIO("sata_grp", byt_score_sata_pins, 1),
303+
PIN_GROUP_GPIO("plt_clk0_grp", byt_score_plt_clk0_pins, 1),
304+
PIN_GROUP_GPIO("plt_clk1_grp", byt_score_plt_clk1_pins, 1),
305+
PIN_GROUP_GPIO("plt_clk2_grp", byt_score_plt_clk2_pins, 1),
306+
PIN_GROUP_GPIO("plt_clk3_grp", byt_score_plt_clk3_pins, 1),
307+
PIN_GROUP_GPIO("plt_clk4_grp", byt_score_plt_clk4_pins, 1),
308+
PIN_GROUP_GPIO("plt_clk5_grp", byt_score_plt_clk5_pins, 1),
309+
PIN_GROUP_GPIO("smbus_grp", byt_score_smbus_pins, 1),
308310
};
309311

310312
static const char * const byt_score_uart_groups[] = {
311-
"uart1_grp", "uart2_grp",
313+
"uart1_grp", "uart2_grp", "uart3_grp",
312314
};
313315
static const char * const byt_score_pwm_groups[] = {
314316
"pwm0_grp", "pwm1_grp",
@@ -332,12 +334,14 @@ static const char * const byt_score_plt_clk_groups[] = {
332334
};
333335
static const char * const byt_score_smbus_groups[] = { "smbus_grp" };
334336
static const char * const byt_score_gpio_groups[] = {
335-
"uart1_grp", "uart2_grp", "pwm0_grp", "pwm1_grp", "ssp0_grp",
336-
"ssp1_grp", "ssp2_grp", "sio_spi_grp", "i2c0_grp", "i2c1_grp",
337-
"i2c2_grp", "i2c3_grp", "i2c4_grp", "i2c5_grp", "i2c6_grp",
338-
"sdcard_grp", "sdio_grp", "emmc_grp", "lpc_grp", "sata_grp",
339-
"plt_clk0_grp", "plt_clk1_grp", "plt_clk2_grp", "plt_clk3_grp",
340-
"plt_clk4_grp", "plt_clk5_grp", "smbus_grp",
337+
"uart1_grp_gpio", "uart2_grp_gpio", "uart3_grp_gpio", "pwm0_grp_gpio",
338+
"pwm1_grp_gpio", "ssp0_grp_gpio", "ssp1_grp_gpio", "ssp2_grp_gpio",
339+
"sio_spi_grp_gpio", "i2c0_grp_gpio", "i2c1_grp_gpio", "i2c2_grp_gpio",
340+
"i2c3_grp_gpio", "i2c4_grp_gpio", "i2c5_grp_gpio", "i2c6_grp_gpio",
341+
"sdcard_grp_gpio", "sdio_grp_gpio", "emmc_grp_gpio", "lpc_grp_gpio",
342+
"sata_grp_gpio", "plt_clk0_grp_gpio", "plt_clk1_grp_gpio",
343+
"plt_clk2_grp_gpio", "plt_clk3_grp_gpio", "plt_clk4_grp_gpio",
344+
"plt_clk5_grp_gpio", "smbus_grp_gpio",
341345
};
342346

343347
static const struct intel_function byt_score_functions[] = {
@@ -456,8 +460,8 @@ static const struct intel_pingroup byt_sus_groups[] = {
456460
PIN_GROUP("usb_oc_grp_gpio", byt_sus_usb_over_current_pins, byt_sus_usb_over_current_gpio_mode_values),
457461
PIN_GROUP("usb_ulpi_grp_gpio", byt_sus_usb_ulpi_pins, byt_sus_usb_ulpi_gpio_mode_values),
458462
PIN_GROUP("pcu_spi_grp_gpio", byt_sus_pcu_spi_pins, byt_sus_pcu_spi_gpio_mode_values),
459-
PIN_GROUP("pmu_clk1_grp", byt_sus_pmu_clk1_pins, 1),
460-
PIN_GROUP("pmu_clk2_grp", byt_sus_pmu_clk2_pins, 1),
463+
PIN_GROUP_GPIO("pmu_clk1_grp", byt_sus_pmu_clk1_pins, 1),
464+
PIN_GROUP_GPIO("pmu_clk2_grp", byt_sus_pmu_clk2_pins, 1),
461465
};
462466

463467
static const char * const byt_sus_usb_groups[] = {
@@ -469,7 +473,7 @@ static const char * const byt_sus_pmu_clk_groups[] = {
469473
};
470474
static const char * const byt_sus_gpio_groups[] = {
471475
"usb_oc_grp_gpio", "usb_ulpi_grp_gpio", "pcu_spi_grp_gpio",
472-
"pmu_clk1_grp", "pmu_clk2_grp",
476+
"pmu_clk1_grp_gpio", "pmu_clk2_grp_gpio",
473477
};
474478

475479
static const struct intel_function byt_sus_functions[] = {

drivers/pinctrl/intel/pinctrl-intel.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ struct intel_community {
179179
.modes = __builtin_choose_expr(__builtin_constant_p((m)), NULL, (m)), \
180180
}
181181

182+
#define PIN_GROUP_GPIO(n, p, m) \
183+
PIN_GROUP(n, p, m), \
184+
PIN_GROUP(n "_gpio", p, 0)
185+
182186
#define FUNCTION(n, g) \
183187
{ \
184188
.func = PINCTRL_PINFUNCTION((n), (g), ARRAY_SIZE(g)), \

drivers/pinctrl/mediatek/pinctrl-paris.c

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -165,20 +165,21 @@ static int mtk_pinconf_get(struct pinctrl_dev *pctldev,
165165
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_SR, &ret);
166166
break;
167167
case PIN_CONFIG_INPUT_ENABLE:
168-
case PIN_CONFIG_OUTPUT_ENABLE:
168+
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_IES, &ret);
169+
if (!ret)
170+
err = -EINVAL;
171+
break;
172+
case PIN_CONFIG_OUTPUT:
169173
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DIR, &ret);
170174
if (err)
171175
break;
172-
/* CONFIG Current direction return value
173-
* ------------- ----------------- ----------------------
174-
* OUTPUT_ENABLE output 1 (= HW value)
175-
* input 0 (= HW value)
176-
* INPUT_ENABLE output 0 (= reverse HW value)
177-
* input 1 (= reverse HW value)
178-
*/
179-
if (param == PIN_CONFIG_INPUT_ENABLE)
180-
ret = !ret;
181176

177+
if (!ret) {
178+
err = -EINVAL;
179+
break;
180+
}
181+
182+
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DO, &ret);
182183
break;
183184
case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
184185
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DIR, &ret);
@@ -193,6 +194,8 @@ static int mtk_pinconf_get(struct pinctrl_dev *pctldev,
193194
}
194195

195196
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_SMT, &ret);
197+
if (!ret)
198+
err = -EINVAL;
196199
break;
197200
case PIN_CONFIG_DRIVE_STRENGTH:
198201
if (!hw->soc->drive_get)
@@ -281,26 +284,9 @@ static int mtk_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
281284
break;
282285
err = hw->soc->bias_set_combo(hw, desc, 0, arg);
283286
break;
284-
case PIN_CONFIG_OUTPUT_ENABLE:
285-
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT,
286-
MTK_DISABLE);
287-
/* Keep set direction to consider the case that a GPIO pin
288-
* does not have SMT control
289-
*/
290-
if (err != -ENOTSUPP)
291-
break;
292-
293-
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
294-
MTK_OUTPUT);
295-
break;
296287
case PIN_CONFIG_INPUT_ENABLE:
297288
/* regard all non-zero value as enable */
298289
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_IES, !!arg);
299-
if (err)
300-
break;
301-
302-
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
303-
MTK_INPUT);
304290
break;
305291
case PIN_CONFIG_SLEW_RATE:
306292
/* regard all non-zero value as enable */

drivers/pinctrl/meson/pinctrl-meson-a1.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static const unsigned int pdm_dclk_x_pins[] = { GPIOX_10 };
250250
static const unsigned int pdm_din2_a_pins[] = { GPIOA_6 };
251251
static const unsigned int pdm_din1_a_pins[] = { GPIOA_7 };
252252
static const unsigned int pdm_din0_a_pins[] = { GPIOA_8 };
253-
static const unsigned int pdm_dclk_pins[] = { GPIOA_9 };
253+
static const unsigned int pdm_dclk_a_pins[] = { GPIOA_9 };
254254

255255
/* gen_clk */
256256
static const unsigned int gen_clk_x_pins[] = { GPIOX_7 };
@@ -591,7 +591,7 @@ static struct meson_pmx_group meson_a1_periphs_groups[] = {
591591
GROUP(pdm_din2_a, 3),
592592
GROUP(pdm_din1_a, 3),
593593
GROUP(pdm_din0_a, 3),
594-
GROUP(pdm_dclk, 3),
594+
GROUP(pdm_dclk_a, 3),
595595
GROUP(pwm_c_a, 3),
596596
GROUP(pwm_b_a, 3),
597597

@@ -755,7 +755,7 @@ static const char * const spi_a_groups[] = {
755755

756756
static const char * const pdm_groups[] = {
757757
"pdm_din0_x", "pdm_din1_x", "pdm_din2_x", "pdm_dclk_x", "pdm_din2_a",
758-
"pdm_din1_a", "pdm_din0_a", "pdm_dclk",
758+
"pdm_din1_a", "pdm_din0_a", "pdm_dclk_a",
759759
};
760760

761761
static const char * const gen_clk_groups[] = {

drivers/pinctrl/renesas/pinctrl-rzg2l.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2045,7 +2045,9 @@ static void rzg2l_gpio_irq_restore(struct rzg2l_pinctrl *pctrl)
20452045

20462046
for (unsigned int i = 0; i < RZG2L_TINT_MAX_INTERRUPT; i++) {
20472047
struct irq_data *data;
2048+
unsigned long flags;
20482049
unsigned int virq;
2050+
int ret;
20492051

20502052
if (!pctrl->hwirq[i])
20512053
continue;
@@ -2063,8 +2065,18 @@ static void rzg2l_gpio_irq_restore(struct rzg2l_pinctrl *pctrl)
20632065
continue;
20642066
}
20652067

2066-
if (!irqd_irq_disabled(data))
2068+
/*
2069+
* This has to be atomically executed to protect against a concurrent
2070+
* interrupt.
2071+
*/
2072+
raw_spin_lock_irqsave(&pctrl->lock.rlock, flags);
2073+
ret = rzg2l_gpio_irq_set_type(data, irqd_get_trigger_type(data));
2074+
if (!ret && !irqd_irq_disabled(data))
20672075
rzg2l_gpio_irq_enable(data);
2076+
raw_spin_unlock_irqrestore(&pctrl->lock.rlock, flags);
2077+
2078+
if (ret)
2079+
dev_crit(pctrl->dev, "Failed to set IRQ type for virq=%u\n", virq);
20682080
}
20692081
}
20702082

0 commit comments

Comments
 (0)