]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.174/arm-iop-don-t-use-using-64-bit-dma-masks.patch
fix up queue-3.18/ipv6-flowlabel-wait-rcu-grace-period-before-put_pid.patch
[thirdparty/kernel/stable-queue.git] / releases / 4.9.174 / arm-iop-don-t-use-using-64-bit-dma-masks.patch
1 From bf6f59d857cafbb1c0ae688793a442bf56795b8a Mon Sep 17 00:00:00 2001
2 From: Arnd Bergmann <arnd@arndb.de>
3 Date: Mon, 25 Mar 2019 16:50:43 +0100
4 Subject: ARM: iop: don't use using 64-bit DMA masks
5
6 [ Upstream commit 2125801ccce19249708ca3245d48998e70569ab8 ]
7
8 clang warns about statically defined DMA masks from the DMA_BIT_MASK
9 macro with length 64:
10
11 arch/arm/mach-iop13xx/setup.c:303:35: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
12 static u64 iop13xx_adma_dmamask = DMA_BIT_MASK(64);
13 ^~~~~~~~~~~~~~~~
14 include/linux/dma-mapping.h:141:54: note: expanded from macro 'DMA_BIT_MASK'
15 #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
16 ^ ~~~
17
18 The ones in iop shouldn't really be 64 bit masks, so changing them
19 to what the driver can support avoids the warning.
20
21 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
22 Signed-off-by: Olof Johansson <olof@lixom.net>
23 Signed-off-by: Sasha Levin <sashal@kernel.org>
24 ---
25 arch/arm/mach-iop13xx/setup.c | 8 ++++----
26 arch/arm/mach-iop13xx/tpmi.c | 10 +++++-----
27 arch/arm/plat-iop/adma.c | 6 +++---
28 3 files changed, 12 insertions(+), 12 deletions(-)
29
30 diff --git a/arch/arm/mach-iop13xx/setup.c b/arch/arm/mach-iop13xx/setup.c
31 index 53c316f7301e..fe4932fda01d 100644
32 --- a/arch/arm/mach-iop13xx/setup.c
33 +++ b/arch/arm/mach-iop13xx/setup.c
34 @@ -300,7 +300,7 @@ static struct resource iop13xx_adma_2_resources[] = {
35 }
36 };
37
38 -static u64 iop13xx_adma_dmamask = DMA_BIT_MASK(64);
39 +static u64 iop13xx_adma_dmamask = DMA_BIT_MASK(32);
40 static struct iop_adma_platform_data iop13xx_adma_0_data = {
41 .hw_id = 0,
42 .pool_size = PAGE_SIZE,
43 @@ -324,7 +324,7 @@ static struct platform_device iop13xx_adma_0_channel = {
44 .resource = iop13xx_adma_0_resources,
45 .dev = {
46 .dma_mask = &iop13xx_adma_dmamask,
47 - .coherent_dma_mask = DMA_BIT_MASK(64),
48 + .coherent_dma_mask = DMA_BIT_MASK(32),
49 .platform_data = (void *) &iop13xx_adma_0_data,
50 },
51 };
52 @@ -336,7 +336,7 @@ static struct platform_device iop13xx_adma_1_channel = {
53 .resource = iop13xx_adma_1_resources,
54 .dev = {
55 .dma_mask = &iop13xx_adma_dmamask,
56 - .coherent_dma_mask = DMA_BIT_MASK(64),
57 + .coherent_dma_mask = DMA_BIT_MASK(32),
58 .platform_data = (void *) &iop13xx_adma_1_data,
59 },
60 };
61 @@ -348,7 +348,7 @@ static struct platform_device iop13xx_adma_2_channel = {
62 .resource = iop13xx_adma_2_resources,
63 .dev = {
64 .dma_mask = &iop13xx_adma_dmamask,
65 - .coherent_dma_mask = DMA_BIT_MASK(64),
66 + .coherent_dma_mask = DMA_BIT_MASK(32),
67 .platform_data = (void *) &iop13xx_adma_2_data,
68 },
69 };
70 diff --git a/arch/arm/mach-iop13xx/tpmi.c b/arch/arm/mach-iop13xx/tpmi.c
71 index db511ec2b1df..116feb6b261e 100644
72 --- a/arch/arm/mach-iop13xx/tpmi.c
73 +++ b/arch/arm/mach-iop13xx/tpmi.c
74 @@ -152,7 +152,7 @@ static struct resource iop13xx_tpmi_3_resources[] = {
75 }
76 };
77
78 -u64 iop13xx_tpmi_mask = DMA_BIT_MASK(64);
79 +u64 iop13xx_tpmi_mask = DMA_BIT_MASK(32);
80 static struct platform_device iop13xx_tpmi_0_device = {
81 .name = "iop-tpmi",
82 .id = 0,
83 @@ -160,7 +160,7 @@ static struct platform_device iop13xx_tpmi_0_device = {
84 .resource = iop13xx_tpmi_0_resources,
85 .dev = {
86 .dma_mask = &iop13xx_tpmi_mask,
87 - .coherent_dma_mask = DMA_BIT_MASK(64),
88 + .coherent_dma_mask = DMA_BIT_MASK(32),
89 },
90 };
91
92 @@ -171,7 +171,7 @@ static struct platform_device iop13xx_tpmi_1_device = {
93 .resource = iop13xx_tpmi_1_resources,
94 .dev = {
95 .dma_mask = &iop13xx_tpmi_mask,
96 - .coherent_dma_mask = DMA_BIT_MASK(64),
97 + .coherent_dma_mask = DMA_BIT_MASK(32),
98 },
99 };
100
101 @@ -182,7 +182,7 @@ static struct platform_device iop13xx_tpmi_2_device = {
102 .resource = iop13xx_tpmi_2_resources,
103 .dev = {
104 .dma_mask = &iop13xx_tpmi_mask,
105 - .coherent_dma_mask = DMA_BIT_MASK(64),
106 + .coherent_dma_mask = DMA_BIT_MASK(32),
107 },
108 };
109
110 @@ -193,7 +193,7 @@ static struct platform_device iop13xx_tpmi_3_device = {
111 .resource = iop13xx_tpmi_3_resources,
112 .dev = {
113 .dma_mask = &iop13xx_tpmi_mask,
114 - .coherent_dma_mask = DMA_BIT_MASK(64),
115 + .coherent_dma_mask = DMA_BIT_MASK(32),
116 },
117 };
118
119 diff --git a/arch/arm/plat-iop/adma.c b/arch/arm/plat-iop/adma.c
120 index a4d1f8de3b5b..d9612221e484 100644
121 --- a/arch/arm/plat-iop/adma.c
122 +++ b/arch/arm/plat-iop/adma.c
123 @@ -143,7 +143,7 @@ struct platform_device iop3xx_dma_0_channel = {
124 .resource = iop3xx_dma_0_resources,
125 .dev = {
126 .dma_mask = &iop3xx_adma_dmamask,
127 - .coherent_dma_mask = DMA_BIT_MASK(64),
128 + .coherent_dma_mask = DMA_BIT_MASK(32),
129 .platform_data = (void *) &iop3xx_dma_0_data,
130 },
131 };
132 @@ -155,7 +155,7 @@ struct platform_device iop3xx_dma_1_channel = {
133 .resource = iop3xx_dma_1_resources,
134 .dev = {
135 .dma_mask = &iop3xx_adma_dmamask,
136 - .coherent_dma_mask = DMA_BIT_MASK(64),
137 + .coherent_dma_mask = DMA_BIT_MASK(32),
138 .platform_data = (void *) &iop3xx_dma_1_data,
139 },
140 };
141 @@ -167,7 +167,7 @@ struct platform_device iop3xx_aau_channel = {
142 .resource = iop3xx_aau_resources,
143 .dev = {
144 .dma_mask = &iop3xx_adma_dmamask,
145 - .coherent_dma_mask = DMA_BIT_MASK(64),
146 + .coherent_dma_mask = DMA_BIT_MASK(32),
147 .platform_data = (void *) &iop3xx_aau_data,
148 },
149 };
150 --
151 2.20.1
152