[v2] i2c: ocores: Move system PM hooks to the NOIRQ phase

Message ID 20231113023249.1185682-1-samuel.holland@sifive.com
State New
Headers
Series [v2] i2c: ocores: Move system PM hooks to the NOIRQ phase |

Commit Message

Samuel Holland Nov. 13, 2023, 2:32 a.m. UTC
  When an I2C device contains a wake IRQ subordinate to a regmap-irq chip,
the regmap-irq code must be able to perform I2C transactions during
suspend_device_irqs() and resume_device_irqs(). Therefore, the bus must
be suspended/resumed during the NOIRQ phase.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
---

Changes in v2:
 - Rebase on v6.7-rc1

 drivers/i2c/busses/i2c-ocores.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Peter Korsgaard Nov. 13, 2023, 7:50 a.m. UTC | #1
>>>>> "Samuel" == Samuel Holland <samuel.holland@sifive.com> writes:

 > When an I2C device contains a wake IRQ subordinate to a regmap-irq chip,
 > the regmap-irq code must be able to perform I2C transactions during
 > suspend_device_irqs() and resume_device_irqs(). Therefore, the bus must
 > be suspended/resumed during the NOIRQ phase.

 > Signed-off-by: Samuel Holland <samuel.holland@sifive.com>

Acked-by: Peter Korsgaard <peter@korsgaard.com>

> ---

 > Changes in v2:
 >  - Rebase on v6.7-rc1

 >  drivers/i2c/busses/i2c-ocores.c | 4 ++--
 >  1 file changed, 2 insertions(+), 2 deletions(-)

 > diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
 > index 041a76f71a49..e106af83cef4 100644
 > --- a/drivers/i2c/busses/i2c-ocores.c
 > +++ b/drivers/i2c/busses/i2c-ocores.c
 > @@ -771,8 +771,8 @@ static int ocores_i2c_resume(struct device *dev)
 >  	return ocores_init(dev, i2c);
 >  }
 
 > -static DEFINE_SIMPLE_DEV_PM_OPS(ocores_i2c_pm,
 > -				ocores_i2c_suspend, ocores_i2c_resume);
 > +static DEFINE_NOIRQ_DEV_PM_OPS(ocores_i2c_pm,
 > +			       ocores_i2c_suspend, ocores_i2c_resume);
 
 >  static struct platform_driver ocores_i2c_driver = {
 >  	.probe   = ocores_i2c_probe,
 > -- 

 > 2.42.0
  
Wolfram Sang Nov. 13, 2023, 5:45 p.m. UTC | #2
On Sun, Nov 12, 2023 at 06:32:45PM -0800, Samuel Holland wrote:
> When an I2C device contains a wake IRQ subordinate to a regmap-irq chip,
> the regmap-irq code must be able to perform I2C transactions during
> suspend_device_irqs() and resume_device_irqs(). Therefore, the bus must
> be suspended/resumed during the NOIRQ phase.
> 
> Signed-off-by: Samuel Holland <samuel.holland@sifive.com>

Applied to for-current, thanks!
  

Patch

diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index 041a76f71a49..e106af83cef4 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -771,8 +771,8 @@  static int ocores_i2c_resume(struct device *dev)
 	return ocores_init(dev, i2c);
 }
 
-static DEFINE_SIMPLE_DEV_PM_OPS(ocores_i2c_pm,
-				ocores_i2c_suspend, ocores_i2c_resume);
+static DEFINE_NOIRQ_DEV_PM_OPS(ocores_i2c_pm,
+			       ocores_i2c_suspend, ocores_i2c_resume);
 
 static struct platform_driver ocores_i2c_driver = {
 	.probe   = ocores_i2c_probe,