]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.69/mfd-hi655x-fix-regmap-area-declared-size-for-hi655x.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.69 / mfd-hi655x-fix-regmap-area-declared-size-for-hi655x.patch
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
5
6 From: Rafael David Tinoco <rafael.tinoco@linaro.org>
7
8 commit 6afebb70ee7a4bde106dc1a875e7ac7997248f84 upstream.
9
10 Fixes https://bugs.linaro.org/show_bug.cgi?id=3903
11
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):
15
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
19 ...
20 Hardware name: HiKey Development Board (DT)
21 ...
22 Call trace:
23 regmap_mmio_read8+0x24/0x40
24 regmap_mmio_read+0x48/0x70
25 _regmap_bus_reg_read+0x38/0x48
26 _regmap_read+0x68/0x170
27 regmap_read+0x50/0x78
28 regmap_read_debugfs+0x1a0/0x308
29 regmap_map_read_file+0x48/0x58
30 full_proxy_read+0x68/0x98
31 __vfs_read+0x48/0x80
32 vfs_read+0x94/0x150
33 SyS_read+0x6c/0xd8
34 el0_svc_naked+0x30/0x34
35 Code: aa1e03e0 d503201f f9400280 8b334000 (39400000)
36
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
40 time (4k).
41
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
44 the issue.
45
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>
50
51 ---
52 drivers/mfd/hi655x-pmic.c | 2 +-
53 1 file changed, 1 insertion(+), 1 deletion(-)
54
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
58 .reg_bits = 32,
59 .reg_stride = HI655X_STRIDE,
60 .val_bits = 8,
61 - .max_register = HI655X_BUS_ADDR(0xFFF),
62 + .max_register = HI655X_BUS_ADDR(0x400) - HI655X_STRIDE,
63 };
64
65 static struct resource pwrkey_resources[] = {