Received: by 10.213.65.68 with SMTP id h4csp646480imn; Fri, 6 Apr 2018 06:42:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+ZDEYIs/ilC25zOXYqbjBnK+xwjsjh3/JOtSXq5lsFglMj8xlEZiIHukba68Sn1lgsDky+ X-Received: by 2002:a17:902:728f:: with SMTP id d15-v6mr26723815pll.227.1523022161922; Fri, 06 Apr 2018 06:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523022161; cv=none; d=google.com; s=arc-20160816; b=zQKh+34fslrBe+t0qfB0fh3Ly7dyM+r4DwbJDHRzTisviMwnGwxfo9CsTL/K9u/wif xcS1Q7Xm8lPj21HHwPFhPdYLPK6xO2ouil3BF6k2nQRA5dzG0GYa2dx0hAvNQ4ijDZ0R QzfckFzsveOvTUUp3C0s8hy5C9zHTxA/vkPkB8EMPRumaXcxeEtijrudOhKzFic8NKHi IK9gHeNHCpDSWRk30hfNEC8heBwHpuFziHJJi9hcFYjfs3cEP4/yw0dURohQ2NcNaByl sPuqOyfblMFiOxnnohDSkO0uNKzWRNi1OPp7qSDQg6R23E3qftrbniCF1F/2XTVT9DuG fueQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=qnnPgswsWQ++GfcLkGFlwq1wTrqk8+Qw2EAQNEuvEmE=; b=YkLKAKZw2D2adthlQ2u248YQEhoHx/dCcyM84TiF55NKSJZSP+QFqZpBd7vTOydvmR jh/wBNRjfrCBJFMK5GBQvPf8yJTyIAv5nrXfouhKStbfqmrEYnw+yNrMaSLPxaTL9f81 JCIz66Hbcf2Bu+b1UmrQzclHgnrMzpQzp+MbVz1q5cZPfksyzNNhs6ExH4bvPOYTVCal rAKXWXTYW1skFrlU2BdfvGA3+D3m27Fw+7uoLQeOwDoaWwS7D73HN8hkA/MUXQRYIMRR gV1RbtVxivcBQob8KEgTvJZpxg0x2SQ926N23DyW8FvsuosTXO3tEtOXK6JEfE4/3ps8 68nQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p68si7138290pga.751.2018.04.06.06.42.28; Fri, 06 Apr 2018 06:42:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932861AbeDFNlQ (ORCPT + 99 others); Fri, 6 Apr 2018 09:41:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36170 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932849AbeDFNlM (ORCPT ); Fri, 6 Apr 2018 09:41:12 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2AD9FD96; Fri, 6 Apr 2018 13:41:12 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Olivier Schonken , Boris Brezillon , Richard Weinberger , Nicolas Ferre Subject: [PATCH 4.15 06/72] mtd: nand: atmel: Fix get_sectorsize() function Date: Fri, 6 Apr 2018 15:23:41 +0200 Message-Id: <20180406084350.027693387@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084349.367583460@linuxfoundation.org> References: <20180406084349.367583460@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Boris Brezillon commit 2b1b1b4ac716fd929a2d221bd4ade62263bed915 upstream. get_sectorsize() was not using the appropriate macro to extract the ECC sector size from the config cache, which led to buggy ECC when using 1024 byte sectors. Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver") Cc: Reported-by: Olivier Schonken Signed-off-by: Boris Brezillon Reviewed-by: Richard Weinberger Acked-by: Nicolas Ferre Tested-by: Olivier Schonken Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/atmel/pmecc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mtd/nand/atmel/pmecc.c +++ b/drivers/mtd/nand/atmel/pmecc.c @@ -426,7 +426,7 @@ static int get_strength(struct atmel_pme static int get_sectorsize(struct atmel_pmecc_user *user) { - return user->cache.cfg & PMECC_LOOKUP_TABLE_SIZE_1024 ? 1024 : 512; + return user->cache.cfg & PMECC_CFG_SECTOR1024 ? 1024 : 512; } static void atmel_pmecc_gen_syndrome(struct atmel_pmecc_user *user, int sector)