diff mbox

[3/3] RFC: spi: let SPI masters inherit suspend child ignorance

Message ID 1460035237-12037-4-git-send-email-linus.walleij@linaro.org
State New
Headers show

Commit Message

Linus Walleij April 7, 2016, 1:20 p.m. UTC
This patch is analogous to the I2C patch preceding it
and the reasoning is the same for all slow busses
where the master device should only wake up when
messages get transferred rather than constantly
babysitting its children.

the master devices need to inherit the child ignorance
from their hardware device (whether AMBA device or
platform device etc) so that the children on the
external bus see that they are actively ignored by their
parent and can runtime_force_resume() from system suspend
without getting an error code.

Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: Mark Brown <broonie@kernel.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

---
Mark: mostly trying to bring home a point here and fix
it in all places if possible. No SPI master seems to be
ignoring its children for the moment but I have a patch
for the spi-pl022 doing this (ignoring its children)
I just need to find a suitable test target.
---
 drivers/spi/spi.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Mark Brown April 7, 2016, 5:06 p.m. UTC | #1
On Thu, Apr 07, 2016 at 03:20:37PM +0200, Linus Walleij wrote:
> This patch is analogous to the I2C patch preceding it


Please write standalone changelogs so people can understand what the
patch is supposed to do from reading the changlog.  They'll have to
follow the change later on when looking at it in git.

> and the reasoning is the same for all slow busses

> where the master device should only wake up when

> messages get transferred rather than constantly

> babysitting its children.


This isn't really about the bus being slow, it's about the bus being
able to usefully pause itself.
diff mbox

Patch

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index de2f2f90d799..48affabd170a 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1764,6 +1764,7 @@  struct spi_master *spi_alloc_master(struct device *dev, unsigned size)
 	master->num_chipselect = 1;
 	master->dev.class = &spi_master_class;
 	master->dev.parent = dev;
+	pm_suspend_inherit_ignore_children(&master->dev);
 	spi_master_set_devdata(master, &master[1]);
 
 	return master;