diff mbox series

[v1,2/2] ata: libata-core: Disable READ LOG DMA EXT for Samsung 840 EVOs

Message ID 87d0ecd21aad4760d5889b2183ad0d21a73e55c6.1647594132.git.chunkeey@gmail.com
State Superseded, archived
Headers show
Series [v1,1/2] ata: sata_dwc_460ex: Fix crash due to OOB write | expand

Commit Message

Christian Lamparter March 18, 2022, 9:03 a.m. UTC
Samsung' 840 EVO with the latest firmware (EXT0DB6Q) locks up with
the a message: "READ LOG DMA EXT failed, trying PIO" during boot.

Initially this was discovered because it caused a crash
with the sata_dwc_460ex controller on a WD MyBook Live DUO [1].

The reporter "ticerex" which has the unique opportunity that he
has two Samsung 840 EVO SSD! One with the older firmware "EXT0BB0Q"
which boots fine. But the newer/latest firmware "EXT0DB6Q" caused
the headaches.

This failure is not limited to sata_dwc_460ex, it also happens on
ahci controllers (Asmedia) as found in this forum unraid thread [2].
(This was with a "Samsung SSD 840 EVO 120GB" with firmware "EXT0BB6Q")

[1] <https://forum.openwrt.org/t/my-book-live-duo-reboot-loop/122464/11>
[2] <https://forums.unraid.net/topic/77007-disks-not-showing-up/#comment-711295>

Cc: <stable@kernel.org> # 5.10+
Reported-by: ticerex (OpenWrt Forum)
Link: https://forum.openwrt.org/t/my-book-live-duo-reboot-loop/122464
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
---
"Please use my forum nick."
<https://forum.openwrt.org/t/my-book-live-duo-reboot-loop/122464/14>

The other patch in this series addresses the drivers crash.

Note: This "READ LOG DMA EXT failed" also happens on the newer
Samsung 870 EVOs too:
<https://bugzilla.kernel.org/show_bug.cgi?id=201693#c29>.
I guess there needs to be a database maybe based on the firmware
revision? For now I've settled with the "840 EVO" since I have
found a old, but updated Samsung 840 EVO 120GB in my spare-parts
box that I can test with.
---
 drivers/ata/libata-core.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Damien Le Moal March 18, 2022, 9:47 a.m. UTC | #1
On 3/18/22 18:03, Christian Lamparter wrote:
> Samsung' 840 EVO with the latest firmware (EXT0DB6Q) locks up with
> the a message: "READ LOG DMA EXT failed, trying PIO" during boot.
> 
> Initially this was discovered because it caused a crash
> with the sata_dwc_460ex controller on a WD MyBook Live DUO [1].
> 
> The reporter "ticerex" which has the unique opportunity that he
> has two Samsung 840 EVO SSD! One with the older firmware "EXT0BB0Q"
> which boots fine. But the newer/latest firmware "EXT0DB6Q" caused
> the headaches.
> 
> This failure is not limited to sata_dwc_460ex, it also happens on
> ahci controllers (Asmedia) as found in this forum unraid thread [2].
> (This was with a "Samsung SSD 840 EVO 120GB" with firmware "EXT0BB6Q")
> 
> [1] <https://forum.openwrt.org/t/my-book-live-duo-reboot-loop/122464/11>
> [2] <https://forums.unraid.net/topic/77007-disks-not-showing-up/#comment-711295>
> 
> Cc: <stable@kernel.org> # 5.10+
> Reported-by: ticerex (OpenWrt Forum)

Let's drop this. You mentioned the reporter in the commit message, that is
good enough and there is the forum link for reference.

> Link: https://forum.openwrt.org/t/my-book-live-duo-reboot-loop/122464
> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
> ---
> "Please use my forum nick."
> <https://forum.openwrt.org/t/my-book-live-duo-reboot-loop/122464/14>
> 
> The other patch in this series addresses the drivers crash.
> 
> Note: This "READ LOG DMA EXT failed" also happens on the newer
> Samsung 870 EVOs too:
> <https://bugzilla.kernel.org/show_bug.cgi?id=201693#c29>.
> I guess there needs to be a database maybe based on the firmware
> revision? For now I've settled with the "840 EVO" since I have
> found a old, but updated Samsung 840 EVO 120GB in my spare-parts
> box that I can test with.

If we go down to the FW revision, the blacklist size could get very big
very quickly... The difference between READ LOG DMA EXT and READ LOG EXT
is negligible anyway and that is not the hot path. So no worries.

> ---
>  drivers/ata/libata-core.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 0c854aebfe0b..760c0d81d148 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -4014,6 +4014,9 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
>  						ATA_HORKAGE_ZERO_AFTER_TRIM, },
>  	{ "Crucial_CT*MX100*",		"MU01",	ATA_HORKAGE_NO_NCQ_TRIM |
>  						ATA_HORKAGE_ZERO_AFTER_TRIM, },
> +	{ "Samsung SSD 840 EVO*",	NULL,	ATA_HORKAGE_NO_NCQ_TRIM |
> +						ATA_HORKAGE_NO_DMA_LOG |
> +						ATA_HORKAGE_ZERO_AFTER_TRIM, },
>  	{ "Samsung SSD 840*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM |
>  						ATA_HORKAGE_ZERO_AFTER_TRIM, },
>  	{ "Samsung SSD 850*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM |
Andy Shevchenko March 18, 2022, 2:20 p.m. UTC | #2
On Fri, Mar 18, 2022 at 10:03:12AM +0100, Christian Lamparter wrote:
> Samsung' 840 EVO with the latest firmware (EXT0DB6Q) locks up with
> the a message: "READ LOG DMA EXT failed, trying PIO" during boot.
> 
> Initially this was discovered because it caused a crash
> with the sata_dwc_460ex controller on a WD MyBook Live DUO [1].
> 
> The reporter "ticerex" which has the unique opportunity that he
> has two Samsung 840 EVO SSD! One with the older firmware "EXT0BB0Q"
> which boots fine. But the newer/latest firmware "EXT0DB6Q" caused
> the headaches.
> 
> This failure is not limited to sata_dwc_460ex, it also happens on
> ahci controllers (Asmedia) as found in this forum unraid thread [2].
> (This was with a "Samsung SSD 840 EVO 120GB" with firmware "EXT0BB6Q")
> 
> [1] <https://forum.openwrt.org/t/my-book-live-duo-reboot-loop/122464/11>
> [2] <https://forums.unraid.net/topic/77007-disks-not-showing-up/#comment-711295>

Can it be converted to BugLink tag(s)?
You may `git log --grep BugLink` to see examples.
diff mbox series

Patch

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 0c854aebfe0b..760c0d81d148 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4014,6 +4014,9 @@  static const struct ata_blacklist_entry ata_device_blacklist [] = {
 						ATA_HORKAGE_ZERO_AFTER_TRIM, },
 	{ "Crucial_CT*MX100*",		"MU01",	ATA_HORKAGE_NO_NCQ_TRIM |
 						ATA_HORKAGE_ZERO_AFTER_TRIM, },
+	{ "Samsung SSD 840 EVO*",	NULL,	ATA_HORKAGE_NO_NCQ_TRIM |
+						ATA_HORKAGE_NO_DMA_LOG |
+						ATA_HORKAGE_ZERO_AFTER_TRIM, },
 	{ "Samsung SSD 840*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM |
 						ATA_HORKAGE_ZERO_AFTER_TRIM, },
 	{ "Samsung SSD 850*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM |