All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ata: ahci: Add new board low_power_no_debounce_delay
@ 2022-03-03 10:04 Paul Menzel
  2022-03-03 10:04 ` [PATCH 2/2] [RFC] ata: ahci: Skip debounce delay for AMD FCH SATA Controller Paul Menzel
  2022-03-03 11:14 ` [PATCH 1/2] ata: ahci: Add new board low_power_no_debounce_delay Sergei Shtylyov
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Menzel @ 2022-03-03 10:04 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: Paul Menzel, Hans de Goede, Mario Limonciello, linux-ide, linux-kernel

Some adapters d onot require the default 200 ms debounce delay in
`sata_link_resume()`. So, create the new board
`board_ahci_low_power_no_debounce_delay` with the link flag
`ATA_LFLAG_NO_DEBOUNCE_DELAY`.

Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/ata/ahci.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 84456c05e845..0fc09b86a559 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -51,6 +51,7 @@ enum board_ids {
 	board_ahci,
 	board_ahci_ign_iferr,
 	board_ahci_low_power,
+	board_ahci_low_power_no_debounce_delay,
 	board_ahci_no_debounce_delay,
 	board_ahci_nomsi,
 	board_ahci_noncq,
@@ -142,6 +143,14 @@ static const struct ata_port_info ahci_port_info[] = {
 		.udma_mask	= ATA_UDMA6,
 		.port_ops	= &ahci_ops,
 	},
+	[board_ahci_low_power_no_debounce_delay] = {
+		AHCI_HFLAGS	(AHCI_HFLAG_USE_LPM_POLICY),
+		.flags		= AHCI_FLAG_COMMON,
+		.link_flags	= ATA_LFLAG_NO_DEBOUNCE_DELAY,
+		.pio_mask	= ATA_PIO4,
+		.udma_mask	= ATA_UDMA6,
+		.port_ops	= &ahci_ops,
+	},
 	[board_ahci_no_debounce_delay] = {
 		.flags		= AHCI_FLAG_COMMON,
 		.link_flags	= ATA_LFLAG_NO_DEBOUNCE_DELAY,
-- 
2.30.2


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

* [PATCH 2/2] [RFC] ata: ahci: Skip debounce delay for AMD FCH SATA Controller
  2022-03-03 10:04 [PATCH 1/2] ata: ahci: Add new board low_power_no_debounce_delay Paul Menzel
@ 2022-03-03 10:04 ` Paul Menzel
  2022-03-03 12:23   ` Damien Le Moal
  2022-03-03 11:14 ` [PATCH 1/2] ata: ahci: Add new board low_power_no_debounce_delay Sergei Shtylyov
  1 sibling, 1 reply; 6+ messages in thread
From: Paul Menzel @ 2022-03-03 10:04 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: Paul Menzel, Hans de Goede, Mario Limonciello, linux-ide, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1584 bytes --]

AMD devices with the FCH SATA Controller 0x1022:0x7901 do not need the
default debounce delay of 200 ms.

    07:00.2 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 51)

So skip it, by mapping it to the board with no debounce delay.

Tested on the MSI MS-7A37/B350M MORTAR (MS-7A37).

To-do: Add test details and results.

Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Mario Limonciello <mario.limonciello@amd.com>
---
I am travelling so could not test this exact patch just yet, but I ran
something similar for several weeks already. It’d be great, if the
desktop and AMD folks could also give this a try.

 drivers/ata/ahci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 0fc09b86a559..44b79fe43d13 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -456,7 +456,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
 	{ PCI_VDEVICE(AMD, 0x7800), board_ahci }, /* AMD Hudson-2 */
 	{ PCI_VDEVICE(AMD, 0x7801), board_ahci_no_debounce_delay }, /* AMD Hudson-2 (AHCI mode) */
 	{ PCI_VDEVICE(AMD, 0x7900), board_ahci }, /* AMD CZ */
-	{ PCI_VDEVICE(AMD, 0x7901), board_ahci_low_power }, /* AMD Green Sardine */
+	{ PCI_VDEVICE(AMD, 0x7901), board_ahci_low_power_no_debounce_delay }, /* AMD Green Sardine */
 	/* AMD is using RAID class only for ahci controllers */
 	{ PCI_VENDOR_ID_AMD, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
 	  PCI_CLASS_STORAGE_RAID << 8, 0xffffff, board_ahci },
-- 
2.30.2


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

* Re: [PATCH 1/2] ata: ahci: Add new board low_power_no_debounce_delay
  2022-03-03 10:04 [PATCH 1/2] ata: ahci: Add new board low_power_no_debounce_delay Paul Menzel
  2022-03-03 10:04 ` [PATCH 2/2] [RFC] ata: ahci: Skip debounce delay for AMD FCH SATA Controller Paul Menzel
@ 2022-03-03 11:14 ` Sergei Shtylyov
  1 sibling, 0 replies; 6+ messages in thread
From: Sergei Shtylyov @ 2022-03-03 11:14 UTC (permalink / raw)
  To: Paul Menzel, Damien Le Moal
  Cc: Hans de Goede, Mario Limonciello, linux-ide, linux-kernel

On 3/3/22 1:04 PM, Paul Menzel wrote:

> Some adapters d onot require the default 200 ms debounce delay in

   Do not. Perhaps could be fixed while applying...

> `sata_link_resume()`. So, create the new board
> `board_ahci_low_power_no_debounce_delay` with the link flag
> `ATA_LFLAG_NO_DEBOUNCE_DELAY`.
> 
> Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Mario Limonciello <mario.limonciello@amd.com>
[...]

MBR, Sergey

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

* Re: [PATCH 2/2] [RFC] ata: ahci: Skip debounce delay for AMD FCH SATA Controller
  2022-03-03 10:04 ` [PATCH 2/2] [RFC] ata: ahci: Skip debounce delay for AMD FCH SATA Controller Paul Menzel
@ 2022-03-03 12:23   ` Damien Le Moal
  2022-03-03 13:19     ` Mario Limonciello
  0 siblings, 1 reply; 6+ messages in thread
From: Damien Le Moal @ 2022-03-03 12:23 UTC (permalink / raw)
  To: Paul Menzel; +Cc: Hans de Goede, Mario Limonciello, linux-ide, linux-kernel

On 2022/03/03 12:04, Paul Menzel wrote:
> AMD devices with the FCH SATA Controller 0x1022:0x7901 do not need the
> default debounce delay of 200 ms.
> 
>     07:00.2 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 51)
> 
> So skip it, by mapping it to the board with no debounce delay.
> 
> Tested on the MSI MS-7A37/B350M MORTAR (MS-7A37).
> 
> To-do: Add test details and results.

Please squash this patch together with patch 1. Since you are adding a new board
entry definition, it is better to have a user for it in the same patch (this
avoids reverts to leave unused code behind).

> 
> Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Mario Limonciello <mario.limonciello@amd.com>
> ---
> I am travelling so could not test this exact patch just yet, but I ran
> something similar for several weeks already. It’d be great, if the
> desktop and AMD folks could also give this a try.
> 
>  drivers/ata/ahci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> index 0fc09b86a559..44b79fe43d13 100644
> --- a/drivers/ata/ahci.c
> +++ b/drivers/ata/ahci.c
> @@ -456,7 +456,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
>  	{ PCI_VDEVICE(AMD, 0x7800), board_ahci }, /* AMD Hudson-2 */
>  	{ PCI_VDEVICE(AMD, 0x7801), board_ahci_no_debounce_delay }, /* AMD Hudson-2 (AHCI mode) */
>  	{ PCI_VDEVICE(AMD, 0x7900), board_ahci }, /* AMD CZ */
> -	{ PCI_VDEVICE(AMD, 0x7901), board_ahci_low_power }, /* AMD Green Sardine */
> +	{ PCI_VDEVICE(AMD, 0x7901), board_ahci_low_power_no_debounce_delay }, /* AMD Green Sardine */

Really long name, but I cannot think of anything better...

>  	/* AMD is using RAID class only for ahci controllers */
>  	{ PCI_VENDOR_ID_AMD, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
>  	  PCI_CLASS_STORAGE_RAID << 8, 0xffffff, board_ahci },


-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH 2/2] [RFC] ata: ahci: Skip debounce delay for AMD FCH SATA Controller
  2022-03-03 12:23   ` Damien Le Moal
@ 2022-03-03 13:19     ` Mario Limonciello
  2022-03-03 16:09       ` Damien Le Moal
  0 siblings, 1 reply; 6+ messages in thread
From: Mario Limonciello @ 2022-03-03 13:19 UTC (permalink / raw)
  To: Damien Le Moal, Paul Menzel; +Cc: Hans de Goede, linux-ide, linux-kernel

On 3/3/22 06:23, Damien Le Moal wrote:
> On 2022/03/03 12:04, Paul Menzel wrote:
>> AMD devices with the FCH SATA Controller 0x1022:0x7901 do not need the
>> default debounce delay of 200 ms.
>>
>>      07:00.2 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 51)
>>
>> So skip it, by mapping it to the board with no debounce delay.
>>
>> Tested on the MSI MS-7A37/B350M MORTAR (MS-7A37).
>>
>> To-do: Add test details and results.
> 
> Please squash this patch together with patch 1. Since you are adding a new board
> entry definition, it is better to have a user for it in the same patch (this
> avoids reverts to leave unused code behind). >
>>
>> Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
>> Cc: Hans de Goede <hdegoede@redhat.com>
>> Cc: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>> I am travelling so could not test this exact patch just yet, but I ran
>> something similar for several weeks already. It’d be great, if the
>> desktop and AMD folks could also give this a try.

As we are trying to drop the low power definition for 5.18, maybe can 
this wait until 5.19 so we can see if that sticks so this doesn't get 
caught up in possible reverts?

>>
>>   drivers/ata/ahci.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
>> index 0fc09b86a559..44b79fe43d13 100644
>> --- a/drivers/ata/ahci.c
>> +++ b/drivers/ata/ahci.c
>> @@ -456,7 +456,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
>>   	{ PCI_VDEVICE(AMD, 0x7800), board_ahci }, /* AMD Hudson-2 */
>>   	{ PCI_VDEVICE(AMD, 0x7801), board_ahci_no_debounce_delay }, /* AMD Hudson-2 (AHCI mode) */
>>   	{ PCI_VDEVICE(AMD, 0x7900), board_ahci }, /* AMD CZ */
>> -	{ PCI_VDEVICE(AMD, 0x7901), board_ahci_low_power }, /* AMD Green Sardine */
>> +	{ PCI_VDEVICE(AMD, 0x7901), board_ahci_low_power_no_debounce_delay }, /* AMD Green Sardine */
> 
> Really long name, but I cannot think of anything better...
> 
>>   	/* AMD is using RAID class only for ahci controllers */
>>   	{ PCI_VENDOR_ID_AMD, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
>>   	  PCI_CLASS_STORAGE_RAID << 8, 0xffffff, board_ahci },
> 
> 


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

* Re: [PATCH 2/2] [RFC] ata: ahci: Skip debounce delay for AMD FCH SATA Controller
  2022-03-03 13:19     ` Mario Limonciello
@ 2022-03-03 16:09       ` Damien Le Moal
  0 siblings, 0 replies; 6+ messages in thread
From: Damien Le Moal @ 2022-03-03 16:09 UTC (permalink / raw)
  To: Mario Limonciello, Paul Menzel; +Cc: Hans de Goede, linux-ide, linux-kernel

On 2022/03/03 15:19, Mario Limonciello wrote:
> On 3/3/22 06:23, Damien Le Moal wrote:
>> On 2022/03/03 12:04, Paul Menzel wrote:
>>> AMD devices with the FCH SATA Controller 0x1022:0x7901 do not need the
>>> default debounce delay of 200 ms.
>>>
>>>      07:00.2 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 51)
>>>
>>> So skip it, by mapping it to the board with no debounce delay.
>>>
>>> Tested on the MSI MS-7A37/B350M MORTAR (MS-7A37).
>>>
>>> To-do: Add test details and results.
>>
>> Please squash this patch together with patch 1. Since you are adding a new board
>> entry definition, it is better to have a user for it in the same patch (this
>> avoids reverts to leave unused code behind). >
>>>
>>> Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
>>> Cc: Hans de Goede <hdegoede@redhat.com>
>>> Cc: Mario Limonciello <mario.limonciello@amd.com>
>>> ---
>>> I am travelling so could not test this exact patch just yet, but I ran
>>> something similar for several weeks already. It’d be great, if the
>>> desktop and AMD folks could also give this a try.
> 
> As we are trying to drop the low power definition for 5.18, maybe can 
> this wait until 5.19 so we can see if that sticks so this doesn't get 
> caught up in possible reverts?

The "no debounce delay" addition is a valid change regardless of the "low_power
is default" change. So I do not think this is an issue. But you will need to
rebase your patch to include this change :)

Going forward, I would also like to have the "no debounce delay" as the default
too, after the low power default change settles and hopefully sticks.

> 
>>>
>>>   drivers/ata/ahci.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
>>> index 0fc09b86a559..44b79fe43d13 100644
>>> --- a/drivers/ata/ahci.c
>>> +++ b/drivers/ata/ahci.c
>>> @@ -456,7 +456,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
>>>   	{ PCI_VDEVICE(AMD, 0x7800), board_ahci }, /* AMD Hudson-2 */
>>>   	{ PCI_VDEVICE(AMD, 0x7801), board_ahci_no_debounce_delay }, /* AMD Hudson-2 (AHCI mode) */
>>>   	{ PCI_VDEVICE(AMD, 0x7900), board_ahci }, /* AMD CZ */
>>> -	{ PCI_VDEVICE(AMD, 0x7901), board_ahci_low_power }, /* AMD Green Sardine */
>>> +	{ PCI_VDEVICE(AMD, 0x7901), board_ahci_low_power_no_debounce_delay }, /* AMD Green Sardine */
>>
>> Really long name, but I cannot think of anything better...
>>
>>>   	/* AMD is using RAID class only for ahci controllers */
>>>   	{ PCI_VENDOR_ID_AMD, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
>>>   	  PCI_CLASS_STORAGE_RAID << 8, 0xffffff, board_ahci },
>>
>>
> 


-- 
Damien Le Moal
Western Digital Research

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

end of thread, other threads:[~2022-03-03 16:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-03 10:04 [PATCH 1/2] ata: ahci: Add new board low_power_no_debounce_delay Paul Menzel
2022-03-03 10:04 ` [PATCH 2/2] [RFC] ata: ahci: Skip debounce delay for AMD FCH SATA Controller Paul Menzel
2022-03-03 12:23   ` Damien Le Moal
2022-03-03 13:19     ` Mario Limonciello
2022-03-03 16:09       ` Damien Le Moal
2022-03-03 11:14 ` [PATCH 1/2] ata: ahci: Add new board low_power_no_debounce_delay Sergei Shtylyov

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.