mbox series

[0/3] Fixes and updates to pinctrl-amd

Message ID 20220613064127.220416-1-Basavaraj.Natikar@amd.com
Headers show
Series Fixes and updates to pinctrl-amd | expand

Message

Basavaraj Natikar June 13, 2022, 6:41 a.m. UTC
Changes include use of devm_platform_get_and_ioremap_resource,
save/restore pending irq bits and removing of
contact information.

Basavaraj Natikar (3):
  pinctrl: amd: Use devm_platform_get_and_ioremap_resource
  pinctrl: amd: Don't save/restore interrupt status and wake status bits
  pinctrl: amd: Remove contact information

 drivers/pinctrl/pinctrl-amd.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

Comments

Mario Limonciello July 7, 2022, 6:25 p.m. UTC | #1
On 6/13/2022 01:41, Basavaraj Natikar wrote:
> Changes include use of devm_platform_get_and_ioremap_resource,
> save/restore pending irq bits and removing of
> contact information.
> 
> Basavaraj Natikar (3):
>    pinctrl: amd: Use devm_platform_get_and_ioremap_resource
>    pinctrl: amd: Don't save/restore interrupt status and wake status bits
>    pinctrl: amd: Remove contact information
> 
>   drivers/pinctrl/pinctrl-amd.c | 24 ++++++++++++------------
>   1 file changed, 12 insertions(+), 12 deletions(-)
> 

Linus Walleij,

Just wanted to double check this series wasn't forgotten as you get 5.20 
preparations ready.  I didn't see it in ib-v5.20-amd-pinctrl.
Mario Limonciello July 9, 2022, 2:06 p.m. UTC | #2
On 6/13/22 09:17, Limonciello, Mario wrote:
> [Public]
> 
>> -----Original Message-----
>> From: Natikar, Basavaraj <Basavaraj.Natikar@amd.com>
>> Sent: Monday, June 13, 2022 01:41
>> To: linus.walleij@linaro.org; linux-gpio@vger.kernel.org; S-k, Shyam-sundar
>> <Shyam-sundar.S-k@amd.com>
>> Cc: Limonciello, Mario <Mario.Limonciello@amd.com>; Natikar, Basavaraj
>> <Basavaraj.Natikar@amd.com>
>> Subject: [PATCH 2/3] pinctrl: amd: Don't save/restore interrupt status and wake
>> status bits
>>
>> Saving/restoring interrupt and wake status bits across suspend can
>> cause the suspend to fail if an IRQ is serviced across the
>> suspend cycle.
>>
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
> 
> I think this should also pick up this tag:
> Fixes: 79d2c8bede2c ("pinctrl/amd: save pin registers over suspend/resume")

This was confirmed to fix a bug reported to AMD gitlab with multiple 
suspend/resume cycles.  So one more tag to add:

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1333

> 
>> ---
>>   drivers/pinctrl/pinctrl-amd.c | 11 +++++++++--
>>   1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
>> index ff3d0edbea48..40e23b5795b0 100644
>> --- a/drivers/pinctrl/pinctrl-amd.c
>> +++ b/drivers/pinctrl/pinctrl-amd.c
>> @@ -917,6 +917,7 @@ static int amd_gpio_suspend(struct device *dev)
>>   {
>>   	struct amd_gpio *gpio_dev = dev_get_drvdata(dev);
>>   	struct pinctrl_desc *desc = gpio_dev->pctrl->desc;
>> +	unsigned long flags;
>>   	int i;
>>
>>   	for (i = 0; i < desc->npins; i++) {
>> @@ -925,7 +926,9 @@ static int amd_gpio_suspend(struct device *dev)
>>   		if (!amd_gpio_should_save(gpio_dev, pin))
>>   			continue;
>>
>> -		gpio_dev->saved_regs[i] = readl(gpio_dev->base + pin*4);
>> +		raw_spin_lock_irqsave(&gpio_dev->lock, flags);
>> +		gpio_dev->saved_regs[i] = readl(gpio_dev->base + pin * 4) &
>> ~PIN_IRQ_PENDING;
>> +		raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
>>   	}
>>
>>   	return 0;
>> @@ -935,6 +938,7 @@ static int amd_gpio_resume(struct device *dev)
>>   {
>>   	struct amd_gpio *gpio_dev = dev_get_drvdata(dev);
>>   	struct pinctrl_desc *desc = gpio_dev->pctrl->desc;
>> +	unsigned long flags;
>>   	int i;
>>
>>   	for (i = 0; i < desc->npins; i++) {
>> @@ -943,7 +947,10 @@ static int amd_gpio_resume(struct device *dev)
>>   		if (!amd_gpio_should_save(gpio_dev, pin))
>>   			continue;
>>
>> -		writel(gpio_dev->saved_regs[i], gpio_dev->base + pin*4);
>> +		raw_spin_lock_irqsave(&gpio_dev->lock, flags);
>> +		gpio_dev->saved_regs[i] |= readl(gpio_dev->base + pin * 4) &
>> PIN_IRQ_PENDING;
>> +		writel(gpio_dev->saved_regs[i], gpio_dev->base + pin * 4);
>> +		raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
>>   	}
>>
>>   	return 0;
>> --
>> 2.25.1
Linus Walleij July 9, 2022, 11:09 p.m. UTC | #3
On Mon, Jun 13, 2022 at 8:43 AM Basavaraj Natikar
<Basavaraj.Natikar@amd.com> wrote:

> Changes include use of devm_platform_get_and_ioremap_resource,
> save/restore pending irq bits and removing of
> contact information.

Patches applied!

Yours,
Linus Walleij