From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 321DE2F5481; Tue, 12 Aug 2025 19:19:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755026378; cv=none; b=csyCuORZrjS9WKtwQXhDdee32zeZco9Z2LwrvmkggjGq9XJ51kjglrXDZMzDrhTSQet8J/a4jl+/Brix1rqOqOMB66gK87Lk1mB+iF/r1HAfJUEooxUrLi6tHTy/kiFHJFEJYtsBOg3nINCl0wIsUCtTwHqXmxcaZtrV5Dng7zM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755026378; c=relaxed/simple; bh=xQgZL74oirEG7zNFx3V+5jxrDvQau2NYPUdnLbzVr9k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Av+aU8wD/2GJ8o6IoLyuFPEkKpY73mc1IQI5W1Z7MFvvDoRPL1jlluCRwEPt6s71j+xk8cyTGou0SiQhfLXS8092AZTmZQYW1ATWyVetoaFEX1Ijsd1UDwy/PIiLRdfnSSP2/KphwOH+ovq9iApJl9++ISgzenY/yAFSoYLqp0w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JaLj+fWc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="JaLj+fWc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39F92C4CEF0; Tue, 12 Aug 2025 19:19:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755026377; bh=xQgZL74oirEG7zNFx3V+5jxrDvQau2NYPUdnLbzVr9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JaLj+fWctv2QOCsXXEyakrX4T8A2PnWOEb1WbbtM2sRWbNFjRUCTpe5HbRwUYTyLC MV7rMbOf/MvLYQozLq7ZjW5b4ZVKZST1ZhYbwfSH871nNo1y0atAhtHQSYY9r7+Poq 8lEHRJHOwrqth2bs6IWs1SaY+vJ3JJRQoDBbJeL0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zixun LI , Ada Couprie Diaz , Balamanikandan Gunasundar , Miquel Raynal , Sasha Levin Subject: [PATCH 6.15 319/480] mtd: rawnand: atmel: set pmecc data setup time Date: Tue, 12 Aug 2025 19:48:47 +0200 Message-ID: <20250812174410.594948041@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250812174357.281828096@linuxfoundation.org> References: <20250812174357.281828096@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Balamanikandan Gunasundar [ Upstream commit f552a7c7e0a14215cb8a6fd89e60fa3932a74786 ] Setup the pmecc data setup time as 3 clock cycles for 133MHz as recommended by the datasheet. Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver") Reported-by: Zixun LI Closes: https://lore.kernel.org/all/c015bb20-6a57-4f63-8102-34b3d83e0f5b@microchip.com Suggested-by: Ada Couprie Diaz Signed-off-by: Balamanikandan Gunasundar Signed-off-by: Miquel Raynal Signed-off-by: Sasha Levin --- drivers/mtd/nand/raw/atmel/pmecc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mtd/nand/raw/atmel/pmecc.c b/drivers/mtd/nand/raw/atmel/pmecc.c index 3c7dee1be21d..0b402823b619 100644 --- a/drivers/mtd/nand/raw/atmel/pmecc.c +++ b/drivers/mtd/nand/raw/atmel/pmecc.c @@ -143,6 +143,7 @@ struct atmel_pmecc_caps { int nstrengths; int el_offset; bool correct_erased_chunks; + bool clk_ctrl; }; struct atmel_pmecc { @@ -843,6 +844,10 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev, if (IS_ERR(pmecc->regs.errloc)) return ERR_CAST(pmecc->regs.errloc); + /* pmecc data setup time */ + if (caps->clk_ctrl) + writel(PMECC_CLK_133MHZ, pmecc->regs.base + ATMEL_PMECC_CLK); + /* Disable all interrupts before registering the PMECC handler. */ writel(0xffffffff, pmecc->regs.base + ATMEL_PMECC_IDR); atmel_pmecc_reset(pmecc); @@ -896,6 +901,7 @@ static struct atmel_pmecc_caps at91sam9g45_caps = { .strengths = atmel_pmecc_strengths, .nstrengths = 5, .el_offset = 0x8c, + .clk_ctrl = true, }; static struct atmel_pmecc_caps sama5d4_caps = { -- 2.39.5