Skip to content

Commit

Permalink
Merge remote-tracking branches 'spi/fix/lock', 'spi/fix/maintainers',…
Browse files Browse the repository at this point in the history
… 'spi/fix/put', 'spi/fix/pxa2xx', 'spi/fix/sh-msiof' and 'spi/fix/timeout' into spi-linus
  • Loading branch information
broonie committed Sep 6, 2016
7 parents c693593 + 764f216 + 2e365a7 + 2932c28 + b70cd2d + c3ccf35 + d0716dd commit ae4860b
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 7 deletions.
12 changes: 11 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,6 @@ F: drivers/*/*s3c64xx*
F: drivers/*/*s5pv210*
F: drivers/memory/samsung/*
F: drivers/soc/samsung/*
F: drivers/spi/spi-s3c*
F: Documentation/arm/Samsung/
F: Documentation/devicetree/bindings/arm/samsung/
F: Documentation/devicetree/bindings/sram/samsung-sram.txt
Expand Down Expand Up @@ -10254,6 +10253,17 @@ S: Supported
L: [email protected] (moderated for non-subscribers)
F: drivers/clk/samsung/

SAMSUNG SPI DRIVERS
M: Kukjin Kim <[email protected]>
M: Krzysztof Kozlowski <[email protected]>
M: Andi Shyti <[email protected]>
L: [email protected]
L: [email protected] (moderated for non-subscribers)
S: Maintained
F: Documentation/devicetree/bindings/spi/spi-samsung.txt
F: drivers/spi/spi-s3c*
F: include/linux/platform_data/spi-s3c64xx.h

SAMSUNG SXGBE DRIVERS
M: Byungho An <[email protected]>
M: Girish K S <[email protected]>
Expand Down
2 changes: 0 additions & 2 deletions drivers/spi/spi-img-spfi.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,8 +720,6 @@ static int img_spfi_remove(struct platform_device *pdev)
clk_disable_unprepare(spfi->sys_clk);
}

spi_master_put(master);

return 0;
}

Expand Down
1 change: 0 additions & 1 deletion drivers/spi/spi-mt65xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,6 @@ static int mtk_spi_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);

mtk_spi_reset(mdata);
spi_master_put(master);

return 0;
}
Expand Down
1 change: 1 addition & 0 deletions drivers/spi/spi-pxa2xx-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
return PTR_ERR(ssp->clk);

memset(&pi, 0, sizeof(pi));
pi.fwnode = dev->dev.fwnode;
pi.parent = &dev->dev;
pi.name = "pxa2xx-spi";
pi.id = ssp->port_id;
Expand Down
1 change: 0 additions & 1 deletion drivers/spi/spi-qup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,6 @@ static int spi_qup_remove(struct platform_device *pdev)

pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
spi_master_put(master);

return 0;
}
Expand Down
3 changes: 3 additions & 0 deletions drivers/spi/spi-sh-msiof.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ static void sh_msiof_spi_set_clk_regs(struct sh_msiof_spi_priv *p,

for (k = 0; k < ARRAY_SIZE(sh_msiof_spi_div_table); k++) {
brps = DIV_ROUND_UP(div, sh_msiof_spi_div_table[k].div);
/* SCR_BRDV_DIV_1 is valid only if BRPS is x 1/1 or x 1/2 */
if (sh_msiof_spi_div_table[k].div == 1 && brps > 2)
continue;
if (brps <= 32) /* max of brdv is 32 */
break;
}
Expand Down
10 changes: 8 additions & 2 deletions drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ static int spi_transfer_one_message(struct spi_master *master,
struct spi_transfer *xfer;
bool keep_cs = false;
int ret = 0;
unsigned long ms = 1;
unsigned long long ms = 1;
struct spi_statistics *statm = &master->statistics;
struct spi_statistics *stats = &msg->spi->statistics;

Expand Down Expand Up @@ -991,9 +991,13 @@ static int spi_transfer_one_message(struct spi_master *master,

if (ret > 0) {
ret = 0;
ms = xfer->len * 8 * 1000 / xfer->speed_hz;
ms = 8LL * 1000LL * xfer->len;
do_div(ms, xfer->speed_hz);
ms += ms + 100; /* some tolerance */

if (ms > UINT_MAX)
ms = UINT_MAX;

ms = wait_for_completion_timeout(&master->xfer_completion,
msecs_to_jiffies(ms));
}
Expand Down Expand Up @@ -1159,6 +1163,7 @@ static void __spi_pump_messages(struct spi_master *master, bool in_kthread)
if (ret < 0) {
dev_err(&master->dev, "Failed to power device: %d\n",
ret);
mutex_unlock(&master->io_mutex);
return;
}
}
Expand All @@ -1174,6 +1179,7 @@ static void __spi_pump_messages(struct spi_master *master, bool in_kthread)

if (master->auto_runtime_pm)
pm_runtime_put(master->dev.parent);
mutex_unlock(&master->io_mutex);
return;
}
}
Expand Down

0 comments on commit ae4860b

Please sign in to comment.