diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-06-10 16:28:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-06-10 16:28:39 -0400 |
commit | ab0296319a8cb970f4e42659472bb40fbfae3e56 (patch) | |
tree | 41b16ae5f9e7e3e28256f07f4ad9c0dc3020bf11 | |
parent | 50e6f8511a6b6a61611dae36794b5400cdc80ea1 (diff) | |
parent | c1d926a5d2280e35d87dea3128e826fe98776ed4 (diff) |
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
-rw-r--r-- | MAINTAINERS | 2 | ||||
-rw-r--r-- | drivers/spi/spi-sh-hspi.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-topcliff-pch.c | 3 | ||||
-rw-r--r-- | drivers/spi/spi-xilinx.c | 74 |
4 files changed, 39 insertions, 42 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 250dc970c62d..0fda00f39849 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -7624,7 +7624,7 @@ F: drivers/clk/spear/ | |||
7624 | SPI SUBSYSTEM | 7624 | SPI SUBSYSTEM |
7625 | M: Mark Brown <broonie@kernel.org> | 7625 | M: Mark Brown <broonie@kernel.org> |
7626 | M: Grant Likely <grant.likely@linaro.org> | 7626 | M: Grant Likely <grant.likely@linaro.org> |
7627 | L: spi-devel-general@lists.sourceforge.net | 7627 | L: linux-spi@vger.kernel.org |
7628 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git | 7628 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git |
7629 | Q: http://patchwork.kernel.org/project/spi-devel-general/list/ | 7629 | Q: http://patchwork.kernel.org/project/spi-devel-general/list/ |
7630 | S: Maintained | 7630 | S: Maintained |
diff --git a/drivers/spi/spi-sh-hspi.c b/drivers/spi/spi-sh-hspi.c index 60cfae51c713..eab593eaaafa 100644 --- a/drivers/spi/spi-sh-hspi.c +++ b/drivers/spi/spi-sh-hspi.c | |||
@@ -89,7 +89,7 @@ static int hspi_status_check_timeout(struct hspi_priv *hspi, u32 mask, u32 val) | |||
89 | if ((mask & hspi_read(hspi, SPSR)) == val) | 89 | if ((mask & hspi_read(hspi, SPSR)) == val) |
90 | return 0; | 90 | return 0; |
91 | 91 | ||
92 | msleep(20); | 92 | udelay(10); |
93 | } | 93 | } |
94 | 94 | ||
95 | dev_err(hspi->dev, "timeout\n"); | 95 | dev_err(hspi->dev, "timeout\n"); |
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index 35f60bd252dd..637d728fbeb5 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c | |||
@@ -1487,7 +1487,7 @@ static int pch_spi_pd_probe(struct platform_device *plat_dev) | |||
1487 | return 0; | 1487 | return 0; |
1488 | 1488 | ||
1489 | err_spi_register_master: | 1489 | err_spi_register_master: |
1490 | free_irq(board_dat->pdev->irq, board_dat); | 1490 | free_irq(board_dat->pdev->irq, data); |
1491 | err_request_irq: | 1491 | err_request_irq: |
1492 | pch_spi_free_resources(board_dat, data); | 1492 | pch_spi_free_resources(board_dat, data); |
1493 | err_spi_get_resources: | 1493 | err_spi_get_resources: |
@@ -1667,6 +1667,7 @@ static int pch_spi_probe(struct pci_dev *pdev, | |||
1667 | pd_dev = platform_device_alloc("pch-spi", i); | 1667 | pd_dev = platform_device_alloc("pch-spi", i); |
1668 | if (!pd_dev) { | 1668 | if (!pd_dev) { |
1669 | dev_err(&pdev->dev, "platform_device_alloc failed\n"); | 1669 | dev_err(&pdev->dev, "platform_device_alloc failed\n"); |
1670 | retval = -ENOMEM; | ||
1670 | goto err_platform_device; | 1671 | goto err_platform_device; |
1671 | } | 1672 | } |
1672 | pd_dev_save->pd_save[i] = pd_dev; | 1673 | pd_dev_save->pd_save[i] = pd_dev; |
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c index e1d769607425..34d18dcfa0db 100644 --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xilinx.c | |||
@@ -267,7 +267,6 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t) | |||
267 | { | 267 | { |
268 | struct xilinx_spi *xspi = spi_master_get_devdata(spi->master); | 268 | struct xilinx_spi *xspi = spi_master_get_devdata(spi->master); |
269 | u32 ipif_ier; | 269 | u32 ipif_ier; |
270 | u16 cr; | ||
271 | 270 | ||
272 | /* We get here with transmitter inhibited */ | 271 | /* We get here with transmitter inhibited */ |
273 | 272 | ||
@@ -276,7 +275,6 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t) | |||
276 | xspi->remaining_bytes = t->len; | 275 | xspi->remaining_bytes = t->len; |
277 | INIT_COMPLETION(xspi->done); | 276 | INIT_COMPLETION(xspi->done); |
278 | 277 | ||
279 | xilinx_spi_fill_tx_fifo(xspi); | ||
280 | 278 | ||
281 | /* Enable the transmit empty interrupt, which we use to determine | 279 | /* Enable the transmit empty interrupt, which we use to determine |
282 | * progress on the transmission. | 280 | * progress on the transmission. |
@@ -285,12 +283,41 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t) | |||
285 | xspi->write_fn(ipif_ier | XSPI_INTR_TX_EMPTY, | 283 | xspi->write_fn(ipif_ier | XSPI_INTR_TX_EMPTY, |
286 | xspi->regs + XIPIF_V123B_IIER_OFFSET); | 284 | xspi->regs + XIPIF_V123B_IIER_OFFSET); |
287 | 285 | ||
288 | /* Start the transfer by not inhibiting the transmitter any longer */ | 286 | for (;;) { |
289 | cr = xspi->read_fn(xspi->regs + XSPI_CR_OFFSET) & | 287 | u16 cr; |
290 | ~XSPI_CR_TRANS_INHIBIT; | 288 | u8 sr; |
291 | xspi->write_fn(cr, xspi->regs + XSPI_CR_OFFSET); | 289 | |
290 | xilinx_spi_fill_tx_fifo(xspi); | ||
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 | } | ||
292 | 316 | ||
293 | wait_for_completion(&xspi->done); | 317 | /* See if there is more data to send */ |
318 | if (!xspi->remaining_bytes > 0) | ||
319 | break; | ||
320 | } | ||
294 | 321 | ||
295 | /* Disable the transmit empty interrupt */ | 322 | /* Disable the transmit empty interrupt */ |
296 | xspi->write_fn(ipif_ier, xspi->regs + XIPIF_V123B_IIER_OFFSET); | 323 | xspi->write_fn(ipif_ier, xspi->regs + XIPIF_V123B_IIER_OFFSET); |
@@ -314,38 +341,7 @@ static irqreturn_t xilinx_spi_irq(int irq, void *dev_id) | |||
314 | xspi->write_fn(ipif_isr, xspi->regs + XIPIF_V123B_IISR_OFFSET); | 341 | xspi->write_fn(ipif_isr, xspi->regs + XIPIF_V123B_IISR_OFFSET); |
315 | 342 | ||
316 | if (ipif_isr & XSPI_INTR_TX_EMPTY) { /* Transmission completed */ | 343 | if (ipif_isr & XSPI_INTR_TX_EMPTY) { /* Transmission completed */ |
317 | u16 cr; | 344 | complete(&xspi->done); |
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 | } | ||
349 | } | 345 | } |
350 | 346 | ||
351 | return IRQ_HANDLED; | 347 | return IRQ_HANDLED; |