Received: by 10.213.65.68 with SMTP id h4csp688036imn; Fri, 6 Apr 2018 07:20:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx48vUtK5tWkvwKqvBIyoNLykJlz4Vn3Yu1MR1IHUCALykhKDn5LlReVK6b4pua8lvRDdCnnd X-Received: by 10.99.126.19 with SMTP id z19mr2400712pgc.325.1523024400039; Fri, 06 Apr 2018 07:20:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523024400; cv=none; d=google.com; s=arc-20160816; b=z89LAzjARen8nXn47RaqTvDZ+u0Br5YCgZBYhMUxFeqDJ2bnkHhMftLA+9GhAFGsrd tt+rCPUieD9/jvigphF/u5MxUVFcBLkqwKdfhpplVGAs1K1zO1C5Nr/rkth3fK1mIoYw I9FGfdtuss2MWr75pbSCWbpDhR7Va1NNTNo+05aBii6Zwo3KaNJq3BQyXz6nqXZYRpHy l1RYEzAeK1Ax//zwK5MxNSByl+mtOOOuiwqqUByMnrXyaSlKZ24VP5KqE31nEWSrFzvx A5o7DHBfO1+aOHi68mbDM4Mf4+rbZyu93PfDYN6RMX+BO1egiZ7gPECEIlvU62r3IY5O cKaQ== 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=tDqpD6h/VN/nWO3gQVXhBynU6K6w2O4UR+xfd/a/kOc=; b=XnTKIOGcwjs9CL+ZmlOJBR2ppXznMw4ry6Tu8BPfGET6vg/95wMI9KBCQ8b24UpqP7 GOLF01X1hh4sfJlqNNduF4hUKR88oQykzj6h0EErXjORlF4LOzYIIjnnsPnlnUOQHv7W IRKzcIZDNBAa6fCy1FgE33gZpiQAiTZJP+C4qhVDTKOaz0ruJkb423NY3Z88LeSgBBK+ W090co5ys2DssVN3i9H/YXS/l8+sXH+36HrEgMH5HozmvEg4p4VAQpJsaZ1Ixt90hfSi vjXvyPiwDL5i6cVaTQnUOw6wuL0QO2Bdn706fRwcY/v5/AalVIb0N5RO/g+GCLshScl9 gdHw== 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 u7-v6si8364322plz.562.2018.04.06.07.19.45; Fri, 06 Apr 2018 07:20:00 -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 S932510AbeDFNiu (ORCPT + 99 others); Fri, 6 Apr 2018 09:38:50 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33632 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932225AbeDFNiq (ORCPT ); Fri, 6 Apr 2018 09:38:46 -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 78E20D1F; Fri, 6 Apr 2018 13:38:45 +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.14 06/67] mtd: nand: atmel: Fix get_sectorsize() function Date: Fri, 6 Apr 2018 15:23:36 +0200 Message-Id: <20180406084342.105772056@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084341.225558262@linuxfoundation.org> References: <20180406084341.225558262@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.14-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)