linux_dsm_epyc7002/drivers/pinctrl/sh-pfc
Niklas Söderlund d3b861bccd pinctrl: sh-pfc: r8a7795: Use lookup function for bias data
There is a bug in the r8a7795 bias code where a WARN() is trigged
anytime a pin from PUEN0/PUD0 is accessed.

 # cat /sys/kernel/debug/pinctrl/e6060000.pfc/pinconf-pins

 WARNING: CPU: 2 PID: 2391 at drivers/pinctrl/sh-pfc/pfc-r8a7795.c:5364 r8a7795_pinmux_get_bias+0xbc/0xc8
 [..]
 Call trace:
 [<ffff0000083c442c>] r8a7795_pinmux_get_bias+0xbc/0xc8
 [<ffff0000083c37f4>] sh_pfc_pinconf_get+0x194/0x270
 [<ffff0000083b0768>] pin_config_get_for_pin+0x20/0x30
 [<ffff0000083b11e8>] pinconf_generic_dump_one+0x168/0x188
 [<ffff0000083b144c>] pinconf_generic_dump_pins+0x5c/0x98
 [<ffff0000083b0628>] pinconf_pins_show+0xc8/0x128
 [<ffff0000081fe3bc>] seq_read+0x16c/0x420
 [<ffff00000831a110>] full_proxy_read+0x58/0x88
 [<ffff0000081d7ad4>] __vfs_read+0x1c/0xf8
 [<ffff0000081d8874>] vfs_read+0x84/0x148
 [<ffff0000081d9d64>] SyS_read+0x44/0xa0
 [<ffff000008082f4c>] __sys_trace_return+0x0/0x4

This is due to the WARN() check if the reg field of the pullups struct
is zero, and this should be 0 for pins controlled by the PUEN0/PUD0
registers since PU0 is defined as 0. Change the data structure and use
the generic sh_pfc_pin_to_bias_info() function to get the register
offset and bit information.

Fixes: 560655247b ("pinctrl: sh-pfc: r8a7795: Add bias pinconf support")
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-11-16 10:29:10 +01:00
..
core.c pinctrl: sh-pfc: Add helper to handle bias lookup table 2016-11-15 11:01:09 +01:00
core.h pinctrl: sh-pfc: Add helper to handle bias lookup table 2016-11-15 11:01:09 +01:00
gpio.c pinctrl: sh-pfc: Convert to devm_gpiochip_add_data() 2016-06-21 09:24:58 +02:00
Kconfig pinctrl: sh-pfc: Initial R8A7796 PFC support 2016-08-19 09:37:11 +02:00
Makefile pinctrl: sh-pfc: Initial R8A7796 PFC support 2016-08-19 09:37:11 +02:00
pfc-emev2.c pinctrl: sh-pfc: emev2: Correct comment for CFI data pins 2015-12-08 14:18:39 +01:00
pfc-r8a73a4.c pinctrl: sh-pfc: Improve core and user API separation 2016-06-21 09:24:55 +02:00
pfc-r8a7740.c pinctrl: sh-pfc: Improve core and user API separation 2016-06-21 09:24:55 +02:00
pfc-r8a7778.c pinctrl: sh-pfc: Improve core and user API separation 2016-06-21 09:24:55 +02:00
pfc-r8a7779.c pinctrl: sh-pfc: Rename PINMUX_IPSR_DATA() to PINMUX_IPSR_GPSR() 2016-02-08 16:50:08 +01:00
pfc-r8a7790.c pinctrl: sh-pfc: Improve core and user API separation 2016-06-21 09:24:55 +02:00
pfc-r8a7791.c pinctrl: sh-pfc: r8a7791: Implement voltage switching for SDHI 2016-09-14 09:26:49 +02:00
pfc-r8a7792.c pinctrl: sh-pfc: r8a7792: Add MSIOF pin groups 2016-09-12 10:54:35 +02:00
pfc-r8a7794.c pinctrl: sh-pfc: r8a7794: Implement voltage switching for SDHI 2016-09-14 09:26:54 +02:00
pfc-r8a7795.c pinctrl: sh-pfc: r8a7795: Use lookup function for bias data 2016-11-16 10:29:10 +01:00
pfc-r8a7796.c pinctrl: sh-pfc: r8a7796: Add DU support 2016-11-15 11:01:08 +01:00
pfc-sh73a0.c pinctrl: sh-pfc: sh73a0: Add MSIOF support 2015-12-08 14:18:41 +01:00
pfc-sh7203.c pinctrl: sh-pfc: Rename .gpio_data[] to .pinmux_data[] 2015-10-20 16:03:30 +02:00
pfc-sh7264.c pinctrl: sh-pfc: Rename .gpio_data[] to .pinmux_data[] 2015-10-20 16:03:30 +02:00
pfc-sh7269.c pinctrl: sh-pfc: Rename .gpio_data[] to .pinmux_data[] 2015-10-20 16:03:30 +02:00
pfc-sh7720.c pinctrl: sh-pfc: Rename .gpio_data[] to .pinmux_data[] 2015-10-20 16:03:30 +02:00
pfc-sh7722.c pinctrl: sh-pfc: Rename .gpio_data[] to .pinmux_data[] 2015-10-20 16:03:30 +02:00
pfc-sh7723.c pinctrl: sh-pfc: Rename .gpio_data[] to .pinmux_data[] 2015-10-20 16:03:30 +02:00
pfc-sh7724.c pinctrl: sh-pfc: Rename .gpio_data[] to .pinmux_data[] 2015-10-20 16:03:30 +02:00
pfc-sh7734.c pinctrl: sh-pfc: Rename PINMUX_IPSR_DATA() to PINMUX_IPSR_GPSR() 2016-02-08 16:50:08 +01:00
pfc-sh7757.c pinctrl: sh-pfc: sh7757: Fix duplicate initializer in GPIO pinmux data 2016-06-14 09:41:41 +02:00
pfc-sh7785.c pinctrl: sh-pfc: Rename .gpio_data[] to .pinmux_data[] 2015-10-20 16:03:30 +02:00
pfc-sh7786.c pinctrl: sh-pfc: Rename .gpio_data[] to .pinmux_data[] 2015-10-20 16:03:30 +02:00
pfc-shx3.c pinctrl: sh-pfc: Rename .gpio_data[] to .pinmux_data[] 2015-10-20 16:03:30 +02:00
pinctrl.c pinctrl: sh-pfc: Do not unconditionally support PIN_CONFIG_BIAS_DISABLE 2016-11-15 11:01:09 +01:00
sh_pfc.h pinctrl: sh-pfc: Add helper to handle bias lookup table 2016-11-15 11:01:09 +01:00