From nobody Mon Feb 19 11:03:08 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 4Tdflh2brgz5BTN0; Mon, 19 Feb 2024 11:03:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tdflh22tQz4nh7; Mon, 19 Feb 2024 11:03:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708340592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=05OLxZiBA2GIrDdjeDfDQXQdjwe6Q3NlBOqyMX0sFhk=; b=x79pMYeoIT4B0m+iU0s1MUKgaGG2G31RC39L7cHLxDNdfsVdjnuHxopSa7UODS8cCXggac TcJ1y4lB8mW8cmyLuwYUO6RuqupJWMMFmOftftkofvitZaOWFMxFrc8rQqyooC3aURdq3o bwiiX/z0nOf5Vy4Qq2Usg57nNDWvDIHStOcfdW1xbG6G6E7Gx00xnj2DIaaUMILxZLL/Ng NXm0sKnQkem3BvEjDS4tAA58q4QwmVlwXlXeNpHPxsFEOHCk+lKGAnnb3wcQeZuWXE47b1 13+lmMvG2iRuQu8epKqGq1F9fxmuefYoWVDulKen49f/pClmXY3FpUdoxFWO4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708340592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=05OLxZiBA2GIrDdjeDfDQXQdjwe6Q3NlBOqyMX0sFhk=; b=ExagxBaJUMdg5vrfS9PdhCmy05Vnfb8Vl3HI1uEDWpsQTa85u62/2K6BL/nExdwj365oaQ IbEkQPYpkL80xWdWpGtM2rjw7sm724SjjZrLLuHuyrEcDY+nb/zqVlPlJE6xksQjLp/ZJG 7vUDYdMcPwfmzj/S67ocqT2UnuD3hJtrcbXBH9pfxHk4Y0b2/u99P2auNmuVk+5Ktc4lzz d+PapfkqLWzPP3g7Ljq/rcpLVjFEyJpI/lXHHQwapM6yN/ftlyXpOEW9BKaOt0FqhJBOmi +7qhvmFeGzhb9gz4TCdVXeEZlM4okJQbokycKve3lZgDRXez7zzhOkzQuHhAlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708340592; a=rsa-sha256; cv=none; b=DLyLw2xwzWiDS9vvVb0pLdDoR7x2pC8MOKr17NlQjZ7+TcJUT9GhJIZhbInSGvANp/Wu2R FftU+8aKiO6LuKzSd+6NO+KklYw0sn1RYrAc0nMaYyGggQOYyUkhw8u/jpxsVcLBQ036sH FwBoskufAGYitIJz7RxxtLplVs0prRHF1F7GZkYfPj0sT/1mIq1LGJZJHwlHJMYnVOAA5Y UyAHDzVzS9/ag2WcB/dJ8wsuTziQnTj/UrABRshYlcl1UvDasfIdAG/x8LKcxHkEt+3Ojp UcI+M6/BdWV3vYW2NoEXzMADP+hMeooI/BijkK/SGwpYUPrK+N0Yq/X7gOqpbw== Received: from [192.168.0.88] (unknown [93.188.39.137]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: avg/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Tdflg43zlzhjd; Mon, 19 Feb 2024 11:03:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Message-ID: Date: Mon, 19 Feb 2024 13:03:08 +0200 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 User-Agent: Mozilla Thunderbird From: Andriy Gapon Subject: Re: git: c01af41c3c8f - main - ata_da: add quirk to disable NCQ TRIM for Samsung 860/870 SSDs Content-Language: en-US To: cglogic Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 19/02/2024 12:47, cglogic wrote: > Hello Andriy, > > I use ZFS with autotrim enabled on Samsung 860 PRO connected to Intel AHCI SATA controller for 9 years without any issue. I think that it was released in 2018? > Can I disable this quirk locally or have I revert the patch to continue use NCQ TRIM with this SSD? I don't think that there is a way to disable the quirk, so you'll have to revert. Note that ATA TRIM is still enabled, it's only NCQ TRIM that got disabled. > 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=c01af41c3c8fdd570764ff9b6bfbad6ac9ca1664 >> >> 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=201693 >> >> 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[] = >> { 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*) -- Andriy Gapon