From patchwork Sat Aug 7 21:45:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 1514718 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=zMIFBp/N; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mess.org header.i=@mess.org header.a=rsa-sha256 header.s=2020 header.b=GBZHWpk0; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GhwsL0c51z9sWX for ; Sun, 8 Aug 2021 07:46:30 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RDPDLKqw9D1oc5L0ICTNVSp8C/lqUbKfN/e0SU1iN6E=; b=zMIFBp/NofDHDj hK8PmWDMpW/TojLMLBmSrqUQ0zwkCtRXOL2/T4YXxUw8E1cgT2QMLpBw7FDPA6uQab29Fk1FyUjJG ULfqTyDcMKvuvwJXGAb/rv2RgLkXb49wtAZR4HhViFlD9e7hSsAyyNYBEFkLsUeFP0l5/ZfmJWCeB ITKeyRyxHeaAc8vka/G40ibPVNr/62nIhW6qwSU1YY3XjvS02l5B/HTFOHV5IbLoopG9zGm53pl9U GcVZ7MjcwKu+CTVq1V14O4iIrHZJCjthrUo7PQpqegsKITJe7QpBYG0fEB7k9nCsIKbfKiTGj8DD7 GtsSqPB+lNhN/fqqhWtw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mCU8j-00FBP3-EQ; Sat, 07 Aug 2021 21:45:57 +0000 Received: from gofer.mess.org ([2a02:8011:d000:212::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mCU8U-00FBLN-M0 for linux-mtd@lists.infradead.org; Sat, 07 Aug 2021 21:45:44 +0000 Received: by gofer.mess.org (Postfix, from userid 1000) id 5A48FC667C; Sat, 7 Aug 2021 22:45:39 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mess.org; s=2020; t=1628372739; bh=kDade0ad3OhVxttuN5GL+Y+UbNLv2v/uY7NQFfrYxfQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GBZHWpk0tsELh+TV6L3pSoU/9/myK2R4o2XHtNrc/tw0akBmo3NBXGmkW6o8hirxD 5rT4DDxcJ35KotH3uOVRxNrHaYTQV7QXVR/czo85sF6wkHrAw+VR5PiCDXBe84tKIL S+O4zl7IMww25XQWKXwpD8MRy3tnP1h7kuWDuvFGnyUT1j09CS7cj9phAJL1lOnjxK vZUZU9CS9bykjR4Xe/b3VdKbZ5AC/mzafKWKIfIwqCZz0XFKGCRS5u5JoPaqoZbdeY io+BTc2IBIpKvTP0KZjGsX5JsiYTH2Zeyvk7Pw41cKkYZx6qQuZ1SYMRH08WVsH+/w zJI6gx8MyRBmQ== From: Sean Young To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org Subject: [PATCH v2 3/5] mtd: blk_devs: make discard work on FTLs Date: Sat, 7 Aug 2021 22:45:36 +0100 Message-Id: <20210807214538.14484-4-sean@mess.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210807214538.14484-1-sean@mess.org> References: <20210807214538.14484-1-sean@mess.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210807_144542_899891_3EC69350 X-CRM114-Status: UNSURE ( 8.40 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: If the discard_granularity is not set, discard will not work and the following error is logged: rfda: Error: discard_granularity is 0. Since all the FTLs use a sector size of 512, this can be hardcoded. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org If the discard_granularity is not set, discard will not work and the following error is logged: rfda: Error: discard_granularity is 0. Since all the FTLs use a sector size of 512, this can be hardcoded. Signed-off-by: Sean Young --- drivers/mtd/mtd_blkdevs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 6ce4bc57f919..486251e058a6 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -419,6 +419,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new) if (tr->discard) { blk_queue_flag_set(QUEUE_FLAG_DISCARD, new->rq); blk_queue_max_discard_sectors(new->rq, UINT_MAX); + new->rq->limits.discard_granularity = 512; } gd->queue = new->rq;