brcm2708: organize kernel patches
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.19 / 950-0167-mmc-bcm2835-sdhost-Fix-warnings-on-arm64.patch
1 From c961f0534bdf659108eaf3352989683411767611 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 12 Nov 2018 22:54:40 +0000
4 Subject: [PATCH] mmc: bcm2835-sdhost: Fix warnings on arm64
5
6 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
7 ---
8 drivers/mmc/host/bcm2835-sdhost.c | 56 +++++++++++++++----------------
9 1 file changed, 28 insertions(+), 28 deletions(-)
10
11 --- a/drivers/mmc/host/bcm2835-sdhost.c
12 +++ b/drivers/mmc/host/bcm2835-sdhost.c
13 @@ -247,7 +247,7 @@ static void log_init(struct device *dev,
14 GFP_KERNEL);
15 if (sdhost_log_buf) {
16 pr_info("sdhost: log_buf @ %p (%x)\n",
17 - sdhost_log_buf, sdhost_log_addr);
18 + sdhost_log_buf, (u32)sdhost_log_addr);
19 timer_base = ioremap_nocache(bus_to_phys + 0x7e003000, SZ_4K);
20 if (!timer_base)
21 pr_err("sdhost: failed to remap timer\n");
22 @@ -301,7 +301,7 @@ static void log_dump(void)
23 }
24 }
25
26 -#define log_event(event, param1, param2) log_event_impl(event, param1, param2)
27 +#define log_event(event, param1, param2) log_event_impl(event, (u32)(uintptr_t)param1, (u32)(uintptr_t)param2)
28
29 #else
30
31 @@ -527,7 +527,7 @@ static void bcm2835_sdhost_dma_complete(
32 unsigned long flags;
33
34 spin_lock_irqsave(&host->lock, flags);
35 - log_event("DMA<", (u32)host->data, bcm2835_sdhost_read(host, SDHSTS));
36 + log_event("DMA<", host->data, bcm2835_sdhost_read(host, SDHSTS));
37 log_event("DMA ", bcm2835_sdhost_read(host, SDCMD),
38 bcm2835_sdhost_read(host, SDEDM));
39
40 @@ -559,7 +559,7 @@ static void bcm2835_sdhost_dma_complete(
41
42 bcm2835_sdhost_finish_data(host);
43
44 - log_event("DMA>", (u32)host->data, 0);
45 + log_event("DMA>", host->data, 0);
46 spin_unlock_irqrestore(&host->lock, flags);
47 }
48
49 @@ -748,7 +748,7 @@ static void bcm2835_sdhost_transfer_pio(
50 u32 sdhsts;
51 bool is_read;
52 BUG_ON(!host->data);
53 - log_event("XFP<", (u32)host->data, host->blocks);
54 + log_event("XFP<", host->data, host->blocks);
55
56 is_read = (host->data->flags & MMC_DATA_READ) != 0;
57 if (is_read)
58 @@ -773,7 +773,7 @@ static void bcm2835_sdhost_transfer_pio(
59 sdhsts);
60 host->data->error = -ETIMEDOUT;
61 }
62 - log_event("XFP>", (u32)host->data, host->blocks);
63 + log_event("XFP>", host->data, host->blocks);
64 }
65
66 static void bcm2835_sdhost_prepare_dma(struct bcm2835_host *host,
67 @@ -783,7 +783,7 @@ static void bcm2835_sdhost_prepare_dma(s
68 struct dma_async_tx_descriptor *desc = NULL;
69 struct dma_chan *dma_chan;
70
71 - log_event("PRD<", (u32)data, 0);
72 + log_event("PRD<", data, 0);
73 pr_debug("bcm2835_sdhost_prepare_dma()\n");
74
75 dma_chan = host->dma_chan_rxtx;
76 @@ -794,7 +794,7 @@ static void bcm2835_sdhost_prepare_dma(s
77 dir_data = DMA_TO_DEVICE;
78 dir_slave = DMA_MEM_TO_DEV;
79 }
80 - log_event("PRD1", (u32)dma_chan, 0);
81 + log_event("PRD1", dma_chan, 0);
82
83 BUG_ON(!dma_chan->device);
84 BUG_ON(!dma_chan->device->dev);
85 @@ -841,7 +841,7 @@ static void bcm2835_sdhost_prepare_dma(s
86 desc = dmaengine_prep_slave_sg(dma_chan, data->sg,
87 len, dir_slave,
88 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
89 - log_event("PRD3", (u32)desc, 0);
90 + log_event("PRD3", desc, 0);
91
92 if (desc) {
93 desc->callback = bcm2835_sdhost_dma_complete;
94 @@ -850,12 +850,12 @@ static void bcm2835_sdhost_prepare_dma(s
95 host->dma_chan = dma_chan;
96 host->dma_dir = dir_data;
97 }
98 - log_event("PDM>", (u32)data, 0);
99 + log_event("PDM>", data, 0);
100 }
101
102 static void bcm2835_sdhost_start_dma(struct bcm2835_host *host)
103 {
104 - log_event("SDMA", (u32)host->data, (u32)host->dma_chan);
105 + log_event("SDMA", host->data, host->dma_chan);
106 dmaengine_submit(host->dma_desc);
107 dma_async_issue_pending(host->dma_chan);
108 }
109 @@ -1079,7 +1079,7 @@ static void bcm2835_sdhost_finish_data(s
110 data = host->data;
111 BUG_ON(!data);
112
113 - log_event("FDA<", (u32)host->mrq, (u32)host->cmd);
114 + log_event("FDA<", host->mrq, host->cmd);
115 pr_debug("finish_data(error %d, stop %d, sbc %d)\n",
116 data->error, data->stop ? 1 : 0,
117 host->mrq->sbc ? 1 : 0);
118 @@ -1102,7 +1102,7 @@ static void bcm2835_sdhost_finish_data(s
119 }
120 else
121 bcm2835_sdhost_transfer_complete(host);
122 - log_event("FDA>", (u32)host->mrq, (u32)host->cmd);
123 + log_event("FDA>", host->mrq, host->cmd);
124 }
125
126 static void bcm2835_sdhost_transfer_complete(struct bcm2835_host *host)
127 @@ -1116,7 +1116,7 @@ static void bcm2835_sdhost_transfer_comp
128 data = host->data;
129 host->data = NULL;
130
131 - log_event("TCM<", (u32)data, data->error);
132 + log_event("TCM<", data, data->error);
133 pr_debug("transfer_complete(error %d, stop %d)\n",
134 data->error, data->stop ? 1 : 0);
135
136 @@ -1138,7 +1138,7 @@ static void bcm2835_sdhost_transfer_comp
137 bcm2835_sdhost_wait_transfer_complete(host);
138 tasklet_schedule(&host->finish_tasklet);
139 }
140 - log_event("TCM>", (u32)data, 0);
141 + log_event("TCM>", data, 0);
142 }
143
144 /* If irq_flags is valid, the caller is in a thread context and is allowed
145 @@ -1153,7 +1153,7 @@ static void bcm2835_sdhost_finish_comman
146 int timediff = 0;
147 #endif
148
149 - log_event("FCM<", (u32)host->mrq, (u32)host->cmd);
150 + log_event("FCM<", host->mrq, host->cmd);
151 pr_debug("finish_command(%x)\n", bcm2835_sdhost_read(host, SDCMD));
152
153 BUG_ON(!host->cmd || !host->mrq);
154 @@ -1310,7 +1310,7 @@ static void bcm2835_sdhost_finish_comman
155 else if (host->data_complete)
156 bcm2835_sdhost_transfer_complete(host);
157 }
158 - log_event("FCM>", (u32)host->mrq, (u32)host->cmd);
159 + log_event("FCM>", host->mrq, host->cmd);
160 }
161
162 static void bcm2835_sdhost_timeout(struct timer_list *t)
163 @@ -1347,7 +1347,7 @@ static void bcm2835_sdhost_timeout(struc
164
165 static void bcm2835_sdhost_busy_irq(struct bcm2835_host *host, u32 intmask)
166 {
167 - log_event("IRQB", (u32)host->cmd, intmask);
168 + log_event("IRQB", host->cmd, intmask);
169 if (!host->cmd) {
170 pr_err("%s: got command busy interrupt 0x%08x even "
171 "though no command operation was in progress.\n",
172 @@ -1400,7 +1400,7 @@ static void bcm2835_sdhost_data_irq(stru
173 data/space available FIFO status bits. It is therefore not
174 an error to get here when there is no data transfer in
175 progress. */
176 - log_event("IRQD", (u32)host->data, intmask);
177 + log_event("IRQD", host->data, intmask);
178 if (!host->data)
179 return;
180
181 @@ -1437,7 +1437,7 @@ static void bcm2835_sdhost_data_irq(stru
182
183 static void bcm2835_sdhost_block_irq(struct bcm2835_host *host, u32 intmask)
184 {
185 - log_event("IRQK", (u32)host->data, intmask);
186 + log_event("IRQK", host->data, intmask);
187 if (!host->data) {
188 pr_err("%s: got block interrupt 0x%08x even "
189 "though no data operation was in progress.\n",
190 @@ -1695,10 +1695,10 @@ static void bcm2835_sdhost_request(struc
191 edm = bcm2835_sdhost_read(host, SDEDM);
192 fsm = edm & SDEDM_FSM_MASK;
193
194 - log_event("REQ<", (u32)mrq, edm);
195 + log_event("REQ<", mrq, edm);
196 if ((fsm != SDEDM_FSM_IDENTMODE) &&
197 (fsm != SDEDM_FSM_DATAMODE)) {
198 - log_event("REQ!", (u32)mrq, edm);
199 + log_event("REQ!", mrq, edm);
200 if (host->debug) {
201 pr_warn("%s: previous command (%d) not complete (EDM %x)\n",
202 mmc_hostname(host->mmc),
203 @@ -1730,11 +1730,11 @@ static void bcm2835_sdhost_request(struc
204 bcm2835_sdhost_finish_command(host, &flags);
205 }
206
207 - log_event("CMD ", (u32)mrq->cmd->opcode,
208 + log_event("CMD ", mrq->cmd->opcode,
209 mrq->data ? (u32)mrq->data->blksz : 0);
210 mmiowb();
211
212 - log_event("REQ>", (u32)mrq, 0);
213 + log_event("REQ>", mrq, 0);
214 spin_unlock_irqrestore(&host->lock, flags);
215 }
216
217 @@ -1790,7 +1790,7 @@ static void bcm2835_sdhost_cmd_wait_work
218
219 spin_lock_irqsave(&host->lock, flags);
220
221 - log_event("CWK<", (u32)host->cmd, (u32)host->mrq);
222 + log_event("CWK<", host->cmd, host->mrq);
223
224 /*
225 * If this tasklet gets rescheduled while running, it will
226 @@ -1805,7 +1805,7 @@ static void bcm2835_sdhost_cmd_wait_work
227
228 mmiowb();
229
230 - log_event("CWK>", (u32)host->cmd, 0);
231 + log_event("CWK>", host->cmd, 0);
232
233 spin_unlock_irqrestore(&host->lock, flags);
234 }
235 @@ -1821,7 +1821,7 @@ static void bcm2835_sdhost_tasklet_finis
236
237 spin_lock_irqsave(&host->lock, flags);
238
239 - log_event("TSK<", (u32)host->mrq, 0);
240 + log_event("TSK<", host->mrq, 0);
241 /*
242 * If this tasklet gets rescheduled while running, it will
243 * be run again afterwards but without any active request.
244 @@ -1889,7 +1889,7 @@ static void bcm2835_sdhost_tasklet_finis
245 }
246
247 mmc_request_done(host->mmc, mrq);
248 - log_event("TSK>", (u32)mrq, 0);
249 + log_event("TSK>", mrq, 0);
250 }
251
252 int bcm2835_sdhost_add_host(struct bcm2835_host *host)