linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI / LPSS: Save/restore LPSS private registers also on Lynxpoint
@ 2019-08-22  8:32 Jarkko Nikula
  2019-08-22  9:05 ` Andy Shevchenko
  2019-08-26  9:08 ` Rafael J. Wysocki
  0 siblings, 2 replies; 4+ messages in thread
From: Jarkko Nikula @ 2019-08-22  8:32 UTC (permalink / raw)
  To: linux-acpi
  Cc: Rafael J . Wysocki, Len Brown, Curtis Malainey, Heikki Krogerus,
	Andy Shevchenko, Jarkko Nikula, stable

My assumption in the commit b53548f9d9e4 ("spi: pxa2xx: Remove LPSS private
register restoring during resume") that Intel Lynxpoint and compatible
based chipsets may not need LPSS private registers saving and restoring
over suspend/resume cycle turned out to be false on Intel Broadwell.

Curtis Malainey sent a patch bringing above change back and reported the
LPSS SPI Chip Select control was lost over suspend/resume cycle on
Broadwell machine.

Instead of reverting above commit lets add LPSS private register
saving/restoring also for all LPSS SPI, I2C and UART controllers on
Lynxpoint and compatible chipset to make sure context is not lost in
case nothing else preserves it like firmware or if LPSS is always on.

Fixes: b53548f9d9e4 ("spi: pxa2xx: Remove LPSS private register restoring during resume")
Reported-by: Curtis Malainey <cujomalainey@chromium.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
---
 drivers/acpi/acpi_lpss.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index d696f165a50e..60bbc5090abe 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -219,12 +219,13 @@ static void bsw_pwm_setup(struct lpss_private_data *pdata)
 }
 
 static const struct lpss_device_desc lpt_dev_desc = {
-	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR,
+	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR
+			| LPSS_SAVE_CTX,
 	.prv_offset = 0x800,
 };
 
 static const struct lpss_device_desc lpt_i2c_dev_desc = {
-	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_LTR,
+	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_LTR | LPSS_SAVE_CTX,
 	.prv_offset = 0x800,
 };
 
@@ -236,7 +237,8 @@ static struct property_entry uart_properties[] = {
 };
 
 static const struct lpss_device_desc lpt_uart_dev_desc = {
-	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR,
+	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR
+			| LPSS_SAVE_CTX,
 	.clk_con_id = "baudclk",
 	.prv_offset = 0x800,
 	.setup = lpss_uart_setup,
-- 
2.23.0.rc1


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

* Re: [PATCH] ACPI / LPSS: Save/restore LPSS private registers also on Lynxpoint
  2019-08-22  8:32 [PATCH] ACPI / LPSS: Save/restore LPSS private registers also on Lynxpoint Jarkko Nikula
@ 2019-08-22  9:05 ` Andy Shevchenko
  2019-08-22 16:51   ` Curtis Malainey
  2019-08-26  9:08 ` Rafael J. Wysocki
  1 sibling, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2019-08-22  9:05 UTC (permalink / raw)
  To: Jarkko Nikula
  Cc: linux-acpi, Rafael J . Wysocki, Len Brown, Curtis Malainey,
	Heikki Krogerus, stable

On Thu, Aug 22, 2019 at 11:32:00AM +0300, Jarkko Nikula wrote:
> My assumption in the commit b53548f9d9e4 ("spi: pxa2xx: Remove LPSS private
> register restoring during resume") that Intel Lynxpoint and compatible
> based chipsets may not need LPSS private registers saving and restoring
> over suspend/resume cycle turned out to be false on Intel Broadwell.
> 
> Curtis Malainey sent a patch bringing above change back and reported the
> LPSS SPI Chip Select control was lost over suspend/resume cycle on
> Broadwell machine.
> 
> Instead of reverting above commit lets add LPSS private register
> saving/restoring also for all LPSS SPI, I2C and UART controllers on
> Lynxpoint and compatible chipset to make sure context is not lost in
> case nothing else preserves it like firmware or if LPSS is always on.
> 

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Fixes: b53548f9d9e4 ("spi: pxa2xx: Remove LPSS private register restoring during resume")
> Reported-by: Curtis Malainey <cujomalainey@chromium.org>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> ---
>  drivers/acpi/acpi_lpss.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
> index d696f165a50e..60bbc5090abe 100644
> --- a/drivers/acpi/acpi_lpss.c
> +++ b/drivers/acpi/acpi_lpss.c
> @@ -219,12 +219,13 @@ static void bsw_pwm_setup(struct lpss_private_data *pdata)
>  }
>  
>  static const struct lpss_device_desc lpt_dev_desc = {
> -	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR,
> +	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR
> +			| LPSS_SAVE_CTX,
>  	.prv_offset = 0x800,
>  };
>  
>  static const struct lpss_device_desc lpt_i2c_dev_desc = {
> -	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_LTR,
> +	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_LTR | LPSS_SAVE_CTX,
>  	.prv_offset = 0x800,
>  };
>  
> @@ -236,7 +237,8 @@ static struct property_entry uart_properties[] = {
>  };
>  
>  static const struct lpss_device_desc lpt_uart_dev_desc = {
> -	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR,
> +	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR
> +			| LPSS_SAVE_CTX,
>  	.clk_con_id = "baudclk",
>  	.prv_offset = 0x800,
>  	.setup = lpss_uart_setup,
> -- 
> 2.23.0.rc1
> 

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH] ACPI / LPSS: Save/restore LPSS private registers also on Lynxpoint
  2019-08-22  9:05 ` Andy Shevchenko
@ 2019-08-22 16:51   ` Curtis Malainey
  0 siblings, 0 replies; 4+ messages in thread
From: Curtis Malainey @ 2019-08-22 16:51 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jarkko Nikula, linux-acpi, Rafael J . Wysocki, Len Brown,
	Curtis Malainey, Heikki Krogerus, stable

On Thu, Aug 22, 2019 at 2:05 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Thu, Aug 22, 2019 at 11:32:00AM +0300, Jarkko Nikula wrote:
> > My assumption in the commit b53548f9d9e4 ("spi: pxa2xx: Remove LPSS private
> > register restoring during resume") that Intel Lynxpoint and compatible
> > based chipsets may not need LPSS private registers saving and restoring
> > over suspend/resume cycle turned out to be false on Intel Broadwell.
> >
> > Curtis Malainey sent a patch bringing above change back and reported the
> > LPSS SPI Chip Select control was lost over suspend/resume cycle on
> > Broadwell machine.
> >
> > Instead of reverting above commit lets add LPSS private register
> > saving/restoring also for all LPSS SPI, I2C and UART controllers on
> > Lynxpoint and compatible chipset to make sure context is not lost in
> > case nothing else preserves it like firmware or if LPSS is always on.
> >
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
Tested-by: Curtis Malainey <cujomalainey@chromium.org>

> > Fixes: b53548f9d9e4 ("spi: pxa2xx: Remove LPSS private register restoring during resume")
> > Reported-by: Curtis Malainey <cujomalainey@chromium.org>
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> > ---
> >  drivers/acpi/acpi_lpss.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
> > index d696f165a50e..60bbc5090abe 100644
> > --- a/drivers/acpi/acpi_lpss.c
> > +++ b/drivers/acpi/acpi_lpss.c
> > @@ -219,12 +219,13 @@ static void bsw_pwm_setup(struct lpss_private_data *pdata)
> >  }
> >
> >  static const struct lpss_device_desc lpt_dev_desc = {
> > -     .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR,
> > +     .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR
> > +                     | LPSS_SAVE_CTX,
> >       .prv_offset = 0x800,
> >  };
> >
> >  static const struct lpss_device_desc lpt_i2c_dev_desc = {
> > -     .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_LTR,
> > +     .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_LTR | LPSS_SAVE_CTX,
> >       .prv_offset = 0x800,
> >  };
> >
> > @@ -236,7 +237,8 @@ static struct property_entry uart_properties[] = {
> >  };
> >
> >  static const struct lpss_device_desc lpt_uart_dev_desc = {
> > -     .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR,
> > +     .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR
> > +                     | LPSS_SAVE_CTX,
> >       .clk_con_id = "baudclk",
> >       .prv_offset = 0x800,
> >       .setup = lpss_uart_setup,
> > --
> > 2.23.0.rc1
> >
>
> --
> With Best Regards,
> Andy Shevchenko
>
>

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

* Re: [PATCH] ACPI / LPSS: Save/restore LPSS private registers also on Lynxpoint
  2019-08-22  8:32 [PATCH] ACPI / LPSS: Save/restore LPSS private registers also on Lynxpoint Jarkko Nikula
  2019-08-22  9:05 ` Andy Shevchenko
@ 2019-08-26  9:08 ` Rafael J. Wysocki
  1 sibling, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2019-08-26  9:08 UTC (permalink / raw)
  To: Jarkko Nikula
  Cc: linux-acpi, Len Brown, Curtis Malainey, Heikki Krogerus,
	Andy Shevchenko, stable

On Thursday, August 22, 2019 10:32:00 AM CEST Jarkko Nikula wrote:
> My assumption in the commit b53548f9d9e4 ("spi: pxa2xx: Remove LPSS private
> register restoring during resume") that Intel Lynxpoint and compatible
> based chipsets may not need LPSS private registers saving and restoring
> over suspend/resume cycle turned out to be false on Intel Broadwell.
> 
> Curtis Malainey sent a patch bringing above change back and reported the
> LPSS SPI Chip Select control was lost over suspend/resume cycle on
> Broadwell machine.
> 
> Instead of reverting above commit lets add LPSS private register
> saving/restoring also for all LPSS SPI, I2C and UART controllers on
> Lynxpoint and compatible chipset to make sure context is not lost in
> case nothing else preserves it like firmware or if LPSS is always on.
> 
> Fixes: b53548f9d9e4 ("spi: pxa2xx: Remove LPSS private register restoring during resume")
> Reported-by: Curtis Malainey <cujomalainey@chromium.org>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> ---
>  drivers/acpi/acpi_lpss.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
> index d696f165a50e..60bbc5090abe 100644
> --- a/drivers/acpi/acpi_lpss.c
> +++ b/drivers/acpi/acpi_lpss.c
> @@ -219,12 +219,13 @@ static void bsw_pwm_setup(struct lpss_private_data *pdata)
>  }
>  
>  static const struct lpss_device_desc lpt_dev_desc = {
> -	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR,
> +	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR
> +			| LPSS_SAVE_CTX,
>  	.prv_offset = 0x800,
>  };
>  
>  static const struct lpss_device_desc lpt_i2c_dev_desc = {
> -	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_LTR,
> +	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_LTR | LPSS_SAVE_CTX,
>  	.prv_offset = 0x800,
>  };
>  
> @@ -236,7 +237,8 @@ static struct property_entry uart_properties[] = {
>  };
>  
>  static const struct lpss_device_desc lpt_uart_dev_desc = {
> -	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR,
> +	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR
> +			| LPSS_SAVE_CTX,
>  	.clk_con_id = "baudclk",
>  	.prv_offset = 0x800,
>  	.setup = lpss_uart_setup,
> 

Applied, thanks!





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

end of thread, other threads:[~2019-08-26  9:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-22  8:32 [PATCH] ACPI / LPSS: Save/restore LPSS private registers also on Lynxpoint Jarkko Nikula
2019-08-22  9:05 ` Andy Shevchenko
2019-08-22 16:51   ` Curtis Malainey
2019-08-26  9:08 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).