* [intel-lts:5.4/yocto 17196/20394] drivers/tty/serial/8250/8250_dma.c:258 serial8250_request_dma() warn: inconsistent indenting
@ 2022-01-22 3:46 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-01-22 3:46 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 4712 bytes --]
tree: https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: 36f93ff941f127f4137ab369aecbdd995fb58c66
commit: bb65ef7d36911280609696a0f96a557defaee3ce [17196/20394] serial: 8250: PSE DMA quirk fix
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20220122/202201221116.ducxk05N-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
smatch warnings:
drivers/tty/serial/8250/8250_dma.c:258 serial8250_request_dma() warn: inconsistent indenting
vim +258 drivers/tty/serial/8250/8250_dma.c
169
170 int serial8250_request_dma(struct uart_8250_port *p)
171 {
172 struct uart_8250_dma *dma = p->dma;
173 phys_addr_t rx_dma_addr = dma->rx_dma_addr ?
174 dma->rx_dma_addr : p->port.mapbase;
175 phys_addr_t tx_dma_addr = dma->tx_dma_addr ?
176 dma->tx_dma_addr : p->port.mapbase;
177 dma_cap_mask_t mask;
178 struct dma_slave_caps caps;
179 int ret;
180
181 /* Default slave configuration parameters */
182 dma->rxconf.direction = DMA_DEV_TO_MEM;
183 dma->rxconf.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
184 dma->rxconf.src_addr = rx_dma_addr + UART_RX;
185
186 dma->txconf.direction = DMA_MEM_TO_DEV;
187 dma->txconf.dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
188 dma->txconf.dst_addr = tx_dma_addr + UART_TX;
189
190 dma_cap_zero(mask);
191 dma_cap_set(DMA_SLAVE, mask);
192
193 /* Get a channel for RX */
194 dma->rxchan = dma_request_slave_channel_compat(mask,
195 dma->fn, dma->rx_param,
196 p->port.dev, "rx");
197 if (!dma->rxchan)
198 return -ENODEV;
199
200 /* 8250 rx dma requires dmaengine driver to support pause/terminate */
201 ret = dma_get_slave_caps(dma->rxchan, &caps);
202 if (ret)
203 goto release_rx;
204 if (!caps.cmd_pause || !caps.cmd_terminate ||
205 caps.residue_granularity == DMA_RESIDUE_GRANULARITY_DESCRIPTOR) {
206 ret = -EINVAL;
207 goto release_rx;
208 }
209
210 dmaengine_slave_config(dma->rxchan, &dma->rxconf);
211
212 /* Get a channel for TX */
213 dma->txchan = dma_request_slave_channel_compat(mask,
214 dma->fn, dma->tx_param,
215 p->port.dev, "tx");
216 if (!dma->txchan) {
217 ret = -ENODEV;
218 goto release_rx;
219 }
220
221 /* 8250 tx dma requires dmaengine driver to support terminate */
222 ret = dma_get_slave_caps(dma->txchan, &caps);
223 if (ret)
224 goto err;
225 if (!caps.cmd_terminate) {
226 ret = -EINVAL;
227 goto err;
228 }
229
230 dmaengine_slave_config(dma->txchan, &dma->txconf);
231
232 /* RX buffer */
233 if (!dma->rx_size)
234 dma->rx_size = PAGE_SIZE;
235
236 if (pse_dma_quirk) {
237 dma->rx_buf = dma_alloc_coherent(p->port.dev, dma->rx_size,
238 &dma->rx_addr, GFP_KERNEL);
239 } else {
240 dma->rx_buf = dma_alloc_coherent(dma->rxchan->device->dev,
241 dma->rx_size, &dma->rx_addr, GFP_KERNEL);
242 }
243
244 if (!dma->rx_buf) {
245 ret = -ENOMEM;
246 goto err;
247 }
248
249 /* TX buffer */
250 if (pse_dma_quirk) {
251 dma->tx_addr = dma_map_single(p->port.dev,
252 p->port.state->xmit.buf,
253 UART_XMIT_SIZE,
254 DMA_TO_DEVICE);
255 if (dma_mapping_error(p->port.dev, dma->tx_addr)) {
256 dma_free_coherent(p->port.dev, dma->rx_size,
257 dma->rx_buf, dma->rx_addr);
> 258 ret = -ENOMEM;
259 goto err;
260 }
261 } else {
262 dma->tx_addr = dma_map_single(dma->txchan->device->dev,
263 p->port.state->xmit.buf,
264 UART_XMIT_SIZE,
265 DMA_TO_DEVICE);
266
267 if (dma_mapping_error(dma->txchan->device->dev, dma->tx_addr)) {
268 dma_free_coherent(dma->rxchan->device->dev,
269 dma->rx_size, dma->rx_buf,
270 dma->rx_addr);
271 ret = -ENOMEM;
272 goto err;
273 }
274 }
275
276 dev_dbg_ratelimited(p->port.dev, "got both dma channels\n");
277
278 return 0;
279 err:
280 dma_release_channel(dma->txchan);
281 release_rx:
282 dma_release_channel(dma->rxchan);
283 return ret;
284 }
285 EXPORT_SYMBOL_GPL(serial8250_request_dma);
286
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-22 3:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-22 3:46 [intel-lts:5.4/yocto 17196/20394] drivers/tty/serial/8250/8250_dma.c:258 serial8250_request_dma() warn: inconsistent indenting kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.