All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] Runtime PM on the RZ/A series is never going to work right
@ 2017-01-23 19:58 Chris Brandt
  2017-01-24  7:52 ` Geert Uytterhoeven
  2017-01-24  7:53 ` Geert Uytterhoeven
  0 siblings, 2 replies; 11+ messages in thread
From: Chris Brandt @ 2017-01-23 19:58 UTC (permalink / raw)
  To: linux-renesas-soc

Hello Renesas SoC people,


One difference between R-Car/RZG vs RZA is that there is no status bits for the MSTP clocks.
This means even though you enable a clock by clearing the module-stop bit, you're not really guaranteed that the peripheral block is ready to be used.

For the most part, the register interface is accessible, but usage of the HW might not be fully ready.

Now that clock enable/disable has been fixed for RZ/A1 and actually works, you can start to see things break.

For RZ/A1 (r7s72100) you can see this for the I2C driver (i2c-riic.c) and SPI driver (spi-rspi.c).
Both of these drivers disable the clock in between EVERY TRANSFER as a means of runtime pm.

Since SDHI (tmio) needs to keep the clock running for the card detect logic, it does not implement runtime pm, so it's OK.


The only way to really fix this for RZ/A1 is to put an arbitrary delay in the clk-mstp.c driver:

	spin_lock_irqsave(&group->lock, flags);

	value = cpg_mstp_read(group, group->smstpcr);
	if (enable)
		value &= ~bitmask;
	else
		value |= bitmask;
	cpg_mstp_write(group, value, group->smstpcr);

	spin_unlock_irqrestore(&group->lock, flags);

+	if (enable || !group->mstpsr)
+		udelay(100);
+
	if (!enable || !group->mstpsr)
		return 0;


Or, just remove runtime PM for RZ/A1.

* i2c-riic.c: This driver is just for the RZ/A series, so just remove runtime pm completely
* spi-rspi.c: Disable runtime pm just for RZ/A series parts


Therefore, before I start firing off patches to remove runtime PM for RZ/A, does anyone have an opinion one way of the other????


Regards,
Chris

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-01-27  7:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-23 19:58 [RFC] Runtime PM on the RZ/A series is never going to work right Chris Brandt
2017-01-24  7:52 ` Geert Uytterhoeven
2017-01-24  7:53 ` Geert Uytterhoeven
2017-01-24 14:20   ` Chris Brandt
2017-01-24 14:40     ` Geert Uytterhoeven
2017-01-24 16:22       ` Chris Brandt
2017-01-25  8:53         ` Geert Uytterhoeven
2017-01-25 14:35           ` Chris Brandt
2017-01-25 14:37             ` Geert Uytterhoeven
2017-01-27  3:05           ` Chris Brandt
2017-01-27  7:51             ` Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.