From nobody Mon Feb 19 10:47:37 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdfPx5dFzz5BRSd for ; Mon, 19 Feb 2024 10:47:49 +0000 (UTC) (envelope-from cglogic@protonmail.com) Received: from mail-4319.protonmail.ch (mail-4319.protonmail.ch [185.70.43.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "protonmail.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdfPx2Gq1z4mlq; Mon, 19 Feb 2024 10:47:49 +0000 (UTC) (envelope-from cglogic@protonmail.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1708339666; x=1708598866; bh=ZyHJ1pfTi2eLBFL05V1Uo09EGrAJjQZtVytjPAgHq+E=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=uDdzWsKoc/vDaXC8pd1gMt+E9WGn4X/eezJPLqVIpa724mAxyC2w84al3GAjWbR9C If38EZrAujfxuQV8uVvbPuslx5L2qlqTtR+fl1RUcOchSfjZp7RG4dZc5VjWP92e2k js80BYKLwi34j+qx3YXkbwgoyn5q/MwAWMtoaH2n3/sm+ICPiKsZV5vS2qNewF8b4R Ub0OR813w3tn4xdNhKP/fHg1tLHwUIMZW1TD8glfbNZTKAZsitJJk9BS5gB14Ot4tg PvXjU3t17qV6tfRm6EII3JQYLLYLy7Umr5PWpV8DrabRp5kR9HVgxR5+eDpmUvj6P8 N8lOh50yajRyQ== Date: Mon, 19 Feb 2024 10:47:37 +0000 To: Andriy Gapon From: cglogic Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: c01af41c3c8f - main - ata_da: add quirk to disable NCQ TRIM for Samsung 860/870 SSDs Message-ID: In-Reply-To: <202402191009.41JA925j018706@gitrepo.freebsd.org> References: <202402191009.41JA925j018706@gitrepo.freebsd.org> Feedback-ID: 25313618:user:proton List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4TdfPx2Gq1z4mlq X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:62371, ipnet:185.70.43.0/24, country:CH] Hello Andriy, I use ZFS with autotrim enabled on Samsung 860 PRO connected to Intel AHCI = SATA controller for 9 years without any issue. Can I disable this quirk locally or have I revert the patch to continue use= NCQ TRIM with this SSD? Thank you. On Monday, February 19th, 2024 at 12:09 PM, Andriy Gapon = wrote: > The branch main has been updated by avg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dc01af41c3c8fdd570764ff9b6b= fbad6ac9ca1664 > > commit c01af41c3c8fdd570764ff9b6bfbad6ac9ca1664 > Author: Andriy Gapon avg@FreeBSD.org > > AuthorDate: 2024-02-19 10:08:12 +0000 > Commit: Andriy Gapon avg@FreeBSD.org > > CommitDate: 2024-02-19 10:08:12 +0000 > > ata_da: add quirk to disable NCQ TRIM for Samsung 860/870 SSDs > > NCQ TRIM for Samsung 860/870 SSDs results in data corruption on systems > with some SATA controllers. > > This can be easily reproduced using ZFS which uses TRIM and is able to > detect block content changes. > > Linux bug report for this issue: > https://bugzilla.kernel.org/show_bug.cgi?id=3D201693 > > Since at present we can not limit a quirk based on the contorller / SIM, > apply the quirk in all cases. > > Reviewed by: imp > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D43961 > --- > sys/cam/ata/ata_da.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c > index f5d3aeca9329..d4a591943307 100644 > --- a/sys/cam/ata/ata_da.c > +++ b/sys/cam/ata/ata_da.c > @@ -727,6 +727,22 @@ static struct ada_quirk_entry ada_quirk_table[] =3D > { T_DIRECT, SIP_MEDIA_FIXED, "", "Samsung SSD 850", "" }, > /quirks/ADA_Q_4K | ADA_Q_NCQ_TRIM_BROKEN > }, > + { > + / > + * Samsung 860 SSDs > + * 4k optimised, NCQ TRIM broken (normal TRIM fine) > + / > + { T_DIRECT, SIP_MEDIA_FIXED, "", "Samsung SSD 860*", "" }, > + /quirks/ADA_Q_4K | ADA_Q_NCQ_TRIM_BROKEN > + }, > + { > + / > + * Samsung 870 SSDs > + * 4k optimised, NCQ TRIM broken (normal TRIM fine) > + / > + { T_DIRECT, SIP_MEDIA_FIXED, "", "Samsung SSD 870*", "" }, > + /quirks/ADA_Q_4K | ADA_Q_NCQ_TRIM_BROKEN > + }, > { > / > * Samsung SM863 Series SSDs (MZ7KM*)