mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-29 14:05:19 +08:00
d1dee81416
When we are building all the various pinctrl structures for the
Allwinner pinctrl devices, we do some estimation about the maximum
number of distinct function (names) that we will need.
So far we take the number of pins as an upper bound, even though we
can actually have up to four special functions per pin. This wasn't a
problem until now, since we indeed have typically far more pins than
functions, and most pins share common functions.
However the H616 "-r" pin controller has only two pins, but four
functions, so we run over the end of the array when we are looking for
a matching function name in sunxi_pinctrl_add_function - there is no
NULL sentinel left that would terminate the loop:
[ 8.200648] Unable to handle kernel paging request at virtual address fffdff7efbefaff5
[ 8.209179] Mem abort info:
....
[ 8.368456] Call trace:
[ 8.370925] __pi_strcmp+0x90/0xf0
[ 8.374559] sun50i_h616_r_pinctrl_probe+0x1c/0x28
[ 8.379557] platform_probe+0x68/0xd8
Do an actual worst case allocation (4 functions per pin, three common
functions and the sentinel) for the initial array allocation. This is
now heavily overestimating the number of functions in the common case,
but we will reallocate this array later with the actual number of
functions, so it's only temporarily.
Fixes:
|
||
---|---|---|
.. | ||
Kconfig | ||
Makefile | ||
pinctrl-sun4i-a10.c | ||
pinctrl-sun5i.c | ||
pinctrl-sun6i-a31-r.c | ||
pinctrl-sun6i-a31.c | ||
pinctrl-sun8i-a23-r.c | ||
pinctrl-sun8i-a23.c | ||
pinctrl-sun8i-a33.c | ||
pinctrl-sun8i-a83t-r.c | ||
pinctrl-sun8i-a83t.c | ||
pinctrl-sun8i-h3-r.c | ||
pinctrl-sun8i-h3.c | ||
pinctrl-sun8i-v3s.c | ||
pinctrl-sun9i-a80-r.c | ||
pinctrl-sun9i-a80.c | ||
pinctrl-sun50i-a64-r.c | ||
pinctrl-sun50i-a64.c | ||
pinctrl-sun50i-a100-r.c | ||
pinctrl-sun50i-a100.c | ||
pinctrl-sun50i-h5.c | ||
pinctrl-sun50i-h6-r.c | ||
pinctrl-sun50i-h6.c | ||
pinctrl-sun50i-h616-r.c | ||
pinctrl-sun50i-h616.c | ||
pinctrl-suniv-f1c100s.c | ||
pinctrl-sunxi.c | ||
pinctrl-sunxi.h |