]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/arm-iop-don-t-use-using-64-bit-dma-masks.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / arm-iop-don-t-use-using-64-bit-dma-masks.patch
CommitLineData
288d6f25
SL
1From 7dc40e9d0b47d6f04548770b71be054e0ac115f0 Mon Sep 17 00:00:00 2001
2From: Arnd Bergmann <arnd@arndb.de>
3Date: Mon, 25 Mar 2019 16:50:43 +0100
4Subject: ARM: iop: don't use using 64-bit DMA masks
5
6[ Upstream commit 2125801ccce19249708ca3245d48998e70569ab8 ]
7
8clang warns about statically defined DMA masks from the DMA_BIT_MASK
9macro 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
18The ones in iop shouldn't really be 64 bit masks, so changing them
19to what the driver can support avoids the warning.
20
21Signed-off-by: Arnd Bergmann <arnd@arndb.de>
22Signed-off-by: Olof Johansson <olof@lixom.net>
23Signed-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
30diff --git a/arch/arm/mach-iop13xx/setup.c b/arch/arm/mach-iop13xx/setup.c
31index 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 };
70diff --git a/arch/arm/mach-iop13xx/tpmi.c b/arch/arm/mach-iop13xx/tpmi.c
71index 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
119diff --git a/arch/arm/plat-iop/adma.c b/arch/arm/plat-iop/adma.c
120index 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--
1512.20.1
152