Commit ab0296319a8cb970f4e42659472bb40fbfae3e56
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
Merge tag 'spi-v3.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi fixes from Mark Brown: "A few nasty issues, particularly a race with the interrupt controller in the xilinx driver, together with a couple of more minor fixes and a much needed move of the mailing list away from sourceforge." * tag 'spi-v3.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: hspi: fixup long delay time spi: spi-xilinx: Remove ISR race condition spi: topcliff-pch: fix error return code in pch_spi_probe() spi: topcliff-pch: Pass correct pointer to free_irq() spi: Move mailing list to vger
Showing 4 changed files Side-by-side Diff
MAINTAINERS
... | ... | @@ -7624,7 +7624,7 @@ |
7624 | 7624 | SPI SUBSYSTEM |
7625 | 7625 | M: Mark Brown <broonie@kernel.org> |
7626 | 7626 | M: Grant Likely <grant.likely@linaro.org> |
7627 | -L: spi-devel-general@lists.sourceforge.net | |
7627 | +L: linux-spi@vger.kernel.org | |
7628 | 7628 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git |
7629 | 7629 | Q: http://patchwork.kernel.org/project/spi-devel-general/list/ |
7630 | 7630 | S: Maintained |
drivers/spi/spi-sh-hspi.c
drivers/spi/spi-topcliff-pch.c
... | ... | @@ -1487,7 +1487,7 @@ |
1487 | 1487 | return 0; |
1488 | 1488 | |
1489 | 1489 | err_spi_register_master: |
1490 | - free_irq(board_dat->pdev->irq, board_dat); | |
1490 | + free_irq(board_dat->pdev->irq, data); | |
1491 | 1491 | err_request_irq: |
1492 | 1492 | pch_spi_free_resources(board_dat, data); |
1493 | 1493 | err_spi_get_resources: |
... | ... | @@ -1667,6 +1667,7 @@ |
1667 | 1667 | pd_dev = platform_device_alloc("pch-spi", i); |
1668 | 1668 | if (!pd_dev) { |
1669 | 1669 | dev_err(&pdev->dev, "platform_device_alloc failed\n"); |
1670 | + retval = -ENOMEM; | |
1670 | 1671 | goto err_platform_device; |
1671 | 1672 | } |
1672 | 1673 | pd_dev_save->pd_save[i] = pd_dev; |
drivers/spi/spi-xilinx.c
... | ... | @@ -267,7 +267,6 @@ |
267 | 267 | { |
268 | 268 | struct xilinx_spi *xspi = spi_master_get_devdata(spi->master); |
269 | 269 | u32 ipif_ier; |
270 | - u16 cr; | |
271 | 270 | |
272 | 271 | /* We get here with transmitter inhibited */ |
273 | 272 | |
... | ... | @@ -276,7 +275,6 @@ |
276 | 275 | xspi->remaining_bytes = t->len; |
277 | 276 | INIT_COMPLETION(xspi->done); |
278 | 277 | |
279 | - xilinx_spi_fill_tx_fifo(xspi); | |
280 | 278 | |
281 | 279 | /* Enable the transmit empty interrupt, which we use to determine |
282 | 280 | * progress on the transmission. |
283 | 281 | |
284 | 282 | |
... | ... | @@ -285,13 +283,42 @@ |
285 | 283 | xspi->write_fn(ipif_ier | XSPI_INTR_TX_EMPTY, |
286 | 284 | xspi->regs + XIPIF_V123B_IIER_OFFSET); |
287 | 285 | |
288 | - /* Start the transfer by not inhibiting the transmitter any longer */ | |
289 | - cr = xspi->read_fn(xspi->regs + XSPI_CR_OFFSET) & | |
290 | - ~XSPI_CR_TRANS_INHIBIT; | |
291 | - xspi->write_fn(cr, xspi->regs + XSPI_CR_OFFSET); | |
286 | + for (;;) { | |
287 | + u16 cr; | |
288 | + u8 sr; | |
292 | 289 | |
293 | - wait_for_completion(&xspi->done); | |
290 | + xilinx_spi_fill_tx_fifo(xspi); | |
294 | 291 | |
292 | + /* Start the transfer by not inhibiting the transmitter any | |
293 | + * longer | |
294 | + */ | |
295 | + cr = xspi->read_fn(xspi->regs + XSPI_CR_OFFSET) & | |
296 | + ~XSPI_CR_TRANS_INHIBIT; | |
297 | + xspi->write_fn(cr, xspi->regs + XSPI_CR_OFFSET); | |
298 | + | |
299 | + wait_for_completion(&xspi->done); | |
300 | + | |
301 | + /* A transmit has just completed. Process received data and | |
302 | + * check for more data to transmit. Always inhibit the | |
303 | + * transmitter while the Isr refills the transmit register/FIFO, | |
304 | + * or make sure it is stopped if we're done. | |
305 | + */ | |
306 | + cr = xspi->read_fn(xspi->regs + XSPI_CR_OFFSET); | |
307 | + xspi->write_fn(cr | XSPI_CR_TRANS_INHIBIT, | |
308 | + xspi->regs + XSPI_CR_OFFSET); | |
309 | + | |
310 | + /* Read out all the data from the Rx FIFO */ | |
311 | + sr = xspi->read_fn(xspi->regs + XSPI_SR_OFFSET); | |
312 | + while ((sr & XSPI_SR_RX_EMPTY_MASK) == 0) { | |
313 | + xspi->rx_fn(xspi); | |
314 | + sr = xspi->read_fn(xspi->regs + XSPI_SR_OFFSET); | |
315 | + } | |
316 | + | |
317 | + /* See if there is more data to send */ | |
318 | + if (!xspi->remaining_bytes > 0) | |
319 | + break; | |
320 | + } | |
321 | + | |
295 | 322 | /* Disable the transmit empty interrupt */ |
296 | 323 | xspi->write_fn(ipif_ier, xspi->regs + XIPIF_V123B_IIER_OFFSET); |
297 | 324 | |
... | ... | @@ -314,38 +341,7 @@ |
314 | 341 | xspi->write_fn(ipif_isr, xspi->regs + XIPIF_V123B_IISR_OFFSET); |
315 | 342 | |
316 | 343 | if (ipif_isr & XSPI_INTR_TX_EMPTY) { /* Transmission completed */ |
317 | - u16 cr; | |
318 | - u8 sr; | |
319 | - | |
320 | - /* A transmit has just completed. Process received data and | |
321 | - * check for more data to transmit. Always inhibit the | |
322 | - * transmitter while the Isr refills the transmit register/FIFO, | |
323 | - * or make sure it is stopped if we're done. | |
324 | - */ | |
325 | - cr = xspi->read_fn(xspi->regs + XSPI_CR_OFFSET); | |
326 | - xspi->write_fn(cr | XSPI_CR_TRANS_INHIBIT, | |
327 | - xspi->regs + XSPI_CR_OFFSET); | |
328 | - | |
329 | - /* Read out all the data from the Rx FIFO */ | |
330 | - sr = xspi->read_fn(xspi->regs + XSPI_SR_OFFSET); | |
331 | - while ((sr & XSPI_SR_RX_EMPTY_MASK) == 0) { | |
332 | - xspi->rx_fn(xspi); | |
333 | - sr = xspi->read_fn(xspi->regs + XSPI_SR_OFFSET); | |
334 | - } | |
335 | - | |
336 | - /* See if there is more data to send */ | |
337 | - if (xspi->remaining_bytes > 0) { | |
338 | - xilinx_spi_fill_tx_fifo(xspi); | |
339 | - /* Start the transfer by not inhibiting the | |
340 | - * transmitter any longer | |
341 | - */ | |
342 | - xspi->write_fn(cr, xspi->regs + XSPI_CR_OFFSET); | |
343 | - } else { | |
344 | - /* No more data to send. | |
345 | - * Indicate the transfer is completed. | |
346 | - */ | |
347 | - complete(&xspi->done); | |
348 | - } | |
344 | + complete(&xspi->done); | |
349 | 345 | } |
350 | 346 | |
351 | 347 | return IRQ_HANDLED; |