mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-11 08:18:47 +00:00
spi: Fixes for v3.10
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. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAABAgAGBQJRrissAAoJELSic+t+oim99qsQAJZJsEnlp/NOSt7OmPVrXv4c 4nlqSFgqNA0wEwIjgRJgusVQsSPlTzmJpoMJrA1PDSV5lC6ilaqo1z2Nlg6w0PzL BGJU72vbmfCd9+rIqm5icEZPDG5CajM5fFl6cngNDUhPbOYz1Lo+DHVebkBp9won SNEG2UM2GL5orEvPNvy6DRrLJLBnfFAtezyC8gcL9Q4wyL2woQAaF3FaytFvL0sz lehIwejLQgJ9Irzz+ciqQQI+jWyII2pjSWBXb9tmoL1HAeeODrxeH/Qs1dn/s9MQ 3ImWAOhQJCjajBzwRxuvW+I08piAr8ZaMMbVhLBUR2ZuJcjEdcJ2h5zKdU97cv2D hFS1JJjb1f88iOJMmcApE/NM8FVtJJjit5G6NaNGcEIi2RriTNZ6ZP8bfxvC1/sT wBXG3C8KTMYKHhYkM0LmBI5deQGgj5Xm1Yq/aFLiil0UCrnxIK/1cWY5UT6EWWpa /G6UfkE4Vt13leW/xPJtpPM9q2dsSzGFIf108t7DAVIsg2kCKFQ58yLqi4uNNnxl yqyhW2dCfFmas9+Oef4XdQa4e7SWQ6hCmXx1x4GncY9y/PeJqRmbpq4ROW6HwCgy URNvbJGoJxv+hzNlpTVI18MEq4ej1dTwJCHnMjtZir6Nt0nbjofxpCplsbRkwN4b eI0ubMqyFUBpTcXgYPuu =Lvj8 -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
ab0296319a
@ -7624,7 +7624,7 @@ F: drivers/clk/spear/
|
||||
SPI SUBSYSTEM
|
||||
M: Mark Brown <broonie@kernel.org>
|
||||
M: Grant Likely <grant.likely@linaro.org>
|
||||
L: spi-devel-general@lists.sourceforge.net
|
||||
L: linux-spi@vger.kernel.org
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
|
||||
Q: http://patchwork.kernel.org/project/spi-devel-general/list/
|
||||
S: Maintained
|
||||
|
@ -89,7 +89,7 @@ static int hspi_status_check_timeout(struct hspi_priv *hspi, u32 mask, u32 val)
|
||||
if ((mask & hspi_read(hspi, SPSR)) == val)
|
||||
return 0;
|
||||
|
||||
msleep(20);
|
||||
udelay(10);
|
||||
}
|
||||
|
||||
dev_err(hspi->dev, "timeout\n");
|
||||
|
@ -1487,7 +1487,7 @@ static int pch_spi_pd_probe(struct platform_device *plat_dev)
|
||||
return 0;
|
||||
|
||||
err_spi_register_master:
|
||||
free_irq(board_dat->pdev->irq, board_dat);
|
||||
free_irq(board_dat->pdev->irq, data);
|
||||
err_request_irq:
|
||||
pch_spi_free_resources(board_dat, data);
|
||||
err_spi_get_resources:
|
||||
@ -1667,6 +1667,7 @@ static int pch_spi_probe(struct pci_dev *pdev,
|
||||
pd_dev = platform_device_alloc("pch-spi", i);
|
||||
if (!pd_dev) {
|
||||
dev_err(&pdev->dev, "platform_device_alloc failed\n");
|
||||
retval = -ENOMEM;
|
||||
goto err_platform_device;
|
||||
}
|
||||
pd_dev_save->pd_save[i] = pd_dev;
|
||||
|
@ -267,7 +267,6 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
|
||||
{
|
||||
struct xilinx_spi *xspi = spi_master_get_devdata(spi->master);
|
||||
u32 ipif_ier;
|
||||
u16 cr;
|
||||
|
||||
/* We get here with transmitter inhibited */
|
||||
|
||||
@ -276,7 +275,6 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
|
||||
xspi->remaining_bytes = t->len;
|
||||
INIT_COMPLETION(xspi->done);
|
||||
|
||||
xilinx_spi_fill_tx_fifo(xspi);
|
||||
|
||||
/* Enable the transmit empty interrupt, which we use to determine
|
||||
* progress on the transmission.
|
||||
@ -285,12 +283,41 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
|
||||
xspi->write_fn(ipif_ier | XSPI_INTR_TX_EMPTY,
|
||||
xspi->regs + XIPIF_V123B_IIER_OFFSET);
|
||||
|
||||
/* Start the transfer by not inhibiting the transmitter any longer */
|
||||
cr = xspi->read_fn(xspi->regs + XSPI_CR_OFFSET) &
|
||||
~XSPI_CR_TRANS_INHIBIT;
|
||||
xspi->write_fn(cr, xspi->regs + XSPI_CR_OFFSET);
|
||||
for (;;) {
|
||||
u16 cr;
|
||||
u8 sr;
|
||||
|
||||
wait_for_completion(&xspi->done);
|
||||
xilinx_spi_fill_tx_fifo(xspi);
|
||||
|
||||
/* Start the transfer by not inhibiting the transmitter any
|
||||
* longer
|
||||
*/
|
||||
cr = xspi->read_fn(xspi->regs + XSPI_CR_OFFSET) &
|
||||
~XSPI_CR_TRANS_INHIBIT;
|
||||
xspi->write_fn(cr, xspi->regs + XSPI_CR_OFFSET);
|
||||
|
||||
wait_for_completion(&xspi->done);
|
||||
|
||||
/* A transmit has just completed. Process received data and
|
||||
* check for more data to transmit. Always inhibit the
|
||||
* transmitter while the Isr refills the transmit register/FIFO,
|
||||
* or make sure it is stopped if we're done.
|
||||
*/
|
||||
cr = xspi->read_fn(xspi->regs + XSPI_CR_OFFSET);
|
||||
xspi->write_fn(cr | XSPI_CR_TRANS_INHIBIT,
|
||||
xspi->regs + XSPI_CR_OFFSET);
|
||||
|
||||
/* Read out all the data from the Rx FIFO */
|
||||
sr = xspi->read_fn(xspi->regs + XSPI_SR_OFFSET);
|
||||
while ((sr & XSPI_SR_RX_EMPTY_MASK) == 0) {
|
||||
xspi->rx_fn(xspi);
|
||||
sr = xspi->read_fn(xspi->regs + XSPI_SR_OFFSET);
|
||||
}
|
||||
|
||||
/* See if there is more data to send */
|
||||
if (!xspi->remaining_bytes > 0)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Disable the transmit empty interrupt */
|
||||
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)
|
||||
xspi->write_fn(ipif_isr, xspi->regs + XIPIF_V123B_IISR_OFFSET);
|
||||
|
||||
if (ipif_isr & XSPI_INTR_TX_EMPTY) { /* Transmission completed */
|
||||
u16 cr;
|
||||
u8 sr;
|
||||
|
||||
/* A transmit has just completed. Process received data and
|
||||
* check for more data to transmit. Always inhibit the
|
||||
* transmitter while the Isr refills the transmit register/FIFO,
|
||||
* or make sure it is stopped if we're done.
|
||||
*/
|
||||
cr = xspi->read_fn(xspi->regs + XSPI_CR_OFFSET);
|
||||
xspi->write_fn(cr | XSPI_CR_TRANS_INHIBIT,
|
||||
xspi->regs + XSPI_CR_OFFSET);
|
||||
|
||||
/* Read out all the data from the Rx FIFO */
|
||||
sr = xspi->read_fn(xspi->regs + XSPI_SR_OFFSET);
|
||||
while ((sr & XSPI_SR_RX_EMPTY_MASK) == 0) {
|
||||
xspi->rx_fn(xspi);
|
||||
sr = xspi->read_fn(xspi->regs + XSPI_SR_OFFSET);
|
||||
}
|
||||
|
||||
/* See if there is more data to send */
|
||||
if (xspi->remaining_bytes > 0) {
|
||||
xilinx_spi_fill_tx_fifo(xspi);
|
||||
/* Start the transfer by not inhibiting the
|
||||
* transmitter any longer
|
||||
*/
|
||||
xspi->write_fn(cr, xspi->regs + XSPI_CR_OFFSET);
|
||||
} else {
|
||||
/* No more data to send.
|
||||
* Indicate the transfer is completed.
|
||||
*/
|
||||
complete(&xspi->done);
|
||||
}
|
||||
complete(&xspi->done);
|
||||
}
|
||||
|
||||
return IRQ_HANDLED;
|
||||
|
Loading…
x
Reference in New Issue
Block a user