From patchwork Mon Dec 21 10:00:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Nyekjaer X-Patchwork-Id: 1418945 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=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=geanix.com 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=merlin.20170209 header.b=eoVwRc0s; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=geanix.com header.i=@geanix.com header.a=rsa-sha256 header.s=first header.b=L61J9MVQ; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4Czw5D28Bdz9sVs for ; Mon, 21 Dec 2020 21:02:52 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=YccXrMDGqdbLmSH9rHuvaiBpQCEzsVxIEVIKAJTxLMU=; b=eoVwRc0sJLAWpda+f/YAg0MN8i DYfSG95yKZcvomZowzdYI4Ues0v9GxSiCUviGhO+14NhYVybWrj+72JKTZ73Oe+ExedqPFignkWCg J+HSF31iGujvMq+dSTY717cg4MJfMmbOZkvjCGqOMvJgbiXi1g8VTFUo11+SU+kaZmcJiTkURnaOK A0StUPgFYuCphXRXuV7mFS9Zg7S5y/n7tZ5arIxlwK9Z2i4B03RVpg/MG0SbdBQqm3yPu0AD4mgV5 0KOOZag0nXwAh80fgAswzn/tHc+2gH5EIVEtUIWOv3e+PB3b4La9cZ69QZMmhdHkMSgpEyrIjswwk 55hTmLxw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krI0X-00029K-Vd; Mon, 21 Dec 2020 10:01:38 +0000 Received: from first.geanix.com ([116.203.34.67]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krI0T-00027x-BJ for linux-mtd@lists.infradead.org; Mon, 21 Dec 2020 10:01:34 +0000 Received: from zen.. (unknown [185.17.218.86]) by first.geanix.com (Postfix) with ESMTPSA id DDFF6487688; Mon, 21 Dec 2020 10:01:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=geanix.com; s=first; t=1608544889; bh=QoIAAJdcJ2xARRst3umA4sJ7s7wi/Qvh4ASN+q/gFmw=; h=From:To:Cc:Subject:Date; b=L61J9MVQVz0CvG/ywTsNVAhA8yuwqWZizP0l97nYX2IXq3mbR8d5YhcUzSkxw035V TLufyfev/ejpinvQjGC4r7+9+6+uwY15YNG05diQtfYwtgHpuJgyaPIxS06Rt6kD9b jnO/y0TcfMcNl1diIUnbX/hdpLsCwnLofqYw5kT2jFIC0KqjGjIHyp+yD3VCe4flAo f9Mvtfl0KkkSGPu00dN4yEvZCnAtgY3+Jdy9sRX3HCL3UtWqW9YoV/hOLdSPapaE++ X/ZeTV/CjXZDCq4prHW5P7u2wXwB+/xppvFg/LKrrHOM7b7HJRYryTXKeJ4FfAm+ia uZBkJDrx0zoWQ== From: Sean Nyekjaer To: Han Xu , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Subject: [PATCH] mtd: rawnand: gpmi: fix dst bit offset when extracting raw payload Date: Mon, 21 Dec 2020 11:00:13 +0100 Message-Id: <20201221100013.2715675-1-sean@geanix.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Spam-Status: No, score=-3.1 required=4.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on ff3d05386fc5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201221_050134_234190_E94F6747 X-CRM114-Status: GOOD ( 11.46 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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_EF Message has a valid DKIM or DK signature from envelope-from 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_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Martin_Hundeb=C3=B8ll?= , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Sean Nyekjaer Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Re-add the multiply by 8 to "step * eccsize" to correct the destination bit offset when extracting the data payload in gpmi_ecc_read_page_raw(). Fixes: e5e5631cc889 ("mtd: rawnand: gpmi: Use nand_extract_bits()") Cc: stable@vger.kernel.org Reported-by: Martin Hundebøll Signed-off-by: Sean Nyekjaer --- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c index dc8104e67506..f0726e69a312 100644 --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c @@ -1611,7 +1611,7 @@ static int gpmi_ecc_read_page_raw(struct nand_chip *chip, uint8_t *buf, /* Extract interleaved payload data and ECC bits */ for (step = 0; step < nfc_geo->ecc_chunk_count; step++) { if (buf) - nand_extract_bits(buf, step * eccsize, tmp_buf, + nand_extract_bits(buf, step * eccsize * 8, tmp_buf, src_bit_off, eccsize * 8); src_bit_off += eccsize * 8;