spi: Fixes for v5.15

This contains a couple of fixes, one fix for handling of zero length
 transfers on Rockchip devices and a warning fix which will conflict with
 a version you did but cleans up some extra unneeded forward declarations
 as well which seems a bit neater.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmFIe4sACgkQJNaLcl1U
 h9DCFgf8Cc12VfS6/KxYW47ao0NxquP32gXsMXRU4iec3XNBDBsQzpygWy0zTZXK
 buev94gTCsFSdqqnWuB0xvT6JR6VBtuey0XJJPPmFeSDcHYrHLlweHbibusTaDoL
 6a4b6sW92K2lHq5Sm0VrEui+LSF08DGe9kt28qspItAQF+lg0ilGr9VavIiN9Mb6
 Aex94LTVoEdpFp9iTacbRhyoyg4feA16+xREO742SIqVnvuJqHV34NGc0za6NUs4
 yySFZpGCo0PCrxtsJ9q7U+2porDt4q687B4bmY7NpxrCh7uzkYRX3T1CXWw318o3
 xB7S91xxVSi+u0f04lGU/KirfklsOQ==
 =Z8CP
 -----END PGP SIGNATURE-----

Merge tag 'spi-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark BrownL
 "This contains a couple of fixes, one fix for handling of zero length
  transfers on Rockchip devices and a warning fix which will conflict
  with a version you did but cleans up some extra unneeded forward
  declarations as well which seems a bit neater"

* tag 'spi-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: tegra20-slink: Declare runtime suspend and resume functions conditionally
  spi: rockchip: handle zero length transfers without timing out
This commit is contained in:
Linus Torvalds 2021-09-20 12:14:33 -07:00
commit 4c17ca2792
2 changed files with 10 additions and 5 deletions

View File

@ -600,6 +600,12 @@ static int rockchip_spi_transfer_one(
int ret; int ret;
bool use_dma; bool use_dma;
/* Zero length transfers won't trigger an interrupt on completion */
if (!xfer->len) {
spi_finalize_current_transfer(ctlr);
return 1;
}
WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) && WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) &&
(readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY)); (readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY));

View File

@ -204,9 +204,6 @@ struct tegra_slink_data {
struct dma_async_tx_descriptor *tx_dma_desc; struct dma_async_tx_descriptor *tx_dma_desc;
}; };
static int tegra_slink_runtime_suspend(struct device *dev);
static int tegra_slink_runtime_resume(struct device *dev);
static inline u32 tegra_slink_readl(struct tegra_slink_data *tspi, static inline u32 tegra_slink_readl(struct tegra_slink_data *tspi,
unsigned long reg) unsigned long reg)
{ {
@ -1185,7 +1182,8 @@ static int tegra_slink_resume(struct device *dev)
} }
#endif #endif
static int __maybe_unused tegra_slink_runtime_suspend(struct device *dev) #ifdef CONFIG_PM
static int tegra_slink_runtime_suspend(struct device *dev)
{ {
struct spi_master *master = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
struct tegra_slink_data *tspi = spi_master_get_devdata(master); struct tegra_slink_data *tspi = spi_master_get_devdata(master);
@ -1197,7 +1195,7 @@ static int __maybe_unused tegra_slink_runtime_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused tegra_slink_runtime_resume(struct device *dev) static int tegra_slink_runtime_resume(struct device *dev)
{ {
struct spi_master *master = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
struct tegra_slink_data *tspi = spi_master_get_devdata(master); struct tegra_slink_data *tspi = spi_master_get_devdata(master);
@ -1210,6 +1208,7 @@ static int __maybe_unused tegra_slink_runtime_resume(struct device *dev)
} }
return 0; return 0;
} }
#endif /* CONFIG_PM */
static const struct dev_pm_ops slink_pm_ops = { static const struct dev_pm_ops slink_pm_ops = {
SET_RUNTIME_PM_OPS(tegra_slink_runtime_suspend, SET_RUNTIME_PM_OPS(tegra_slink_runtime_suspend,