1 From 6afebb70ee7a4bde106dc1a875e7ac7997248f84 Mon Sep 17 00:00:00 2001
2 From: Rafael David Tinoco <rafael.tinoco@linaro.org>
3 Date: Fri, 6 Jul 2018 14:28:33 -0300
4 Subject: mfd: hi655x: Fix regmap area declared size for hi655x
6 From: Rafael David Tinoco <rafael.tinoco@linaro.org>
8 commit 6afebb70ee7a4bde106dc1a875e7ac7997248f84 upstream.
10 Fixes https://bugs.linaro.org/show_bug.cgi?id=3903
12 LTP Functional tests have caused a bad paging request when triggering
13 the regmap_read_debugfs() logic of the device PMIC Hi6553 (reading
14 regmap/f8000000.pmic/registers file during read_all test):
16 Unable to handle kernel paging request at virtual address ffff0
17 [ffff00000984e000] pgd=0000000077ffe803, pud=0000000077ffd803,0
18 Internal error: Oops: 96000007 [#1] SMP
20 Hardware name: HiKey Development Board (DT)
23 regmap_mmio_read8+0x24/0x40
24 regmap_mmio_read+0x48/0x70
25 _regmap_bus_reg_read+0x38/0x48
26 _regmap_read+0x68/0x170
28 regmap_read_debugfs+0x1a0/0x308
29 regmap_map_read_file+0x48/0x58
30 full_proxy_read+0x68/0x98
34 el0_svc_naked+0x30/0x34
35 Code: aa1e03e0 d503201f f9400280 8b334000 (39400000)
37 Investigations have showed that, when triggered by debugfs read()
38 handler, the mmio regmap logic was reading a bigger (16k) register area
39 than the one mapped by devm_ioremap_resource() during hi655x-pmic probe
42 This commit changes hi655x's max register, according to HW specs, to be
43 the same as the one declared in the pmic device in hi6220's dts, fixing
46 Cc: <stable@vger.kernel.org> #v4.9 #v4.14 #v4.16 #v4.17
47 Signed-off-by: Rafael David Tinoco <rafael.tinoco@linaro.org>
48 Signed-off-by: Lee Jones <lee.jones@linaro.org>
49 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
52 drivers/mfd/hi655x-pmic.c | 2 +-
53 1 file changed, 1 insertion(+), 1 deletion(-)
55 --- a/drivers/mfd/hi655x-pmic.c
56 +++ b/drivers/mfd/hi655x-pmic.c
57 @@ -49,7 +49,7 @@ static struct regmap_config hi655x_regma
59 .reg_stride = HI655X_STRIDE,
61 - .max_register = HI655X_BUS_ADDR(0xFFF),
62 + .max_register = HI655X_BUS_ADDR(0x400) - HI655X_STRIDE,
65 static struct resource pwrkey_resources[] = {