Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6529646rwl; Wed, 22 Mar 2023 11:47:24 -0700 (PDT) X-Google-Smtp-Source: AK7set95j8H9o6eAnl7D2WrsQb5y2hUmpZWNS/AASaLRMGZi5UJcLLmGMgG6xxKWQiKVei/jGtid X-Received: by 2002:a17:906:720f:b0:88f:8a5:b4cd with SMTP id m15-20020a170906720f00b0088f08a5b4cdmr8602669ejk.1.1679510844014; Wed, 22 Mar 2023 11:47:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679510844; cv=none; d=google.com; s=arc-20160816; b=wTM5mf7Un4pMkm0zZ6ykx96UTvVQ0rM0I5g+mzAQFvOeuXoyMOUChkqjllBCbTIJTg FLoNQP6MoQa6covnwPNPtXI4x6VPRsVbpyUbTIVHLC1FpGKtry51GMwq+fzvRhtbv9KK DvBACQPmSs+vfn32iMIgel93M/W9TSqIedZHUTLIZiAIDouVuZH/4id0YiT4NN/UvQ5P TKmYW1tVaZ7AcvhH/ElHJPXJvgBsXjoUd940eo6FHyvWP+cKyaM2RdOr5B3JHgrc6Fla Xr9lfcMMX0mxKDsaAKmOyAyyiknh0oXvXUZ297I9Siyz1u2UgumH/avZqIDlXwZMHYMn bxtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id :dkim-signature; bh=rVtVHS3YbcTr4exAe5aUDPpvfNLxMi2NgaBzD0hJtkI=; b=meqVC+z5ewHeKiSGZ57O/6QRYoc2XEdjezt6/DmHpBdWgPkC1VV6E/71qzbpUJ6BJ8 y9TBKUE11rRpyymUUdJL41YTgyswkEpRWXY/gf5J/r7NpAwS4TyFXwrFn5LYhyViwlxl 3L8vWKnk+XTSWlq65H3ZZC+tRv7XXWotXKA7uRZtCQbvXu93oslBDEAh0N7CZ9DJYjWT WpBNSwZCX1m+4wk8XauFq03Y89qZ6Zewa9YxUn00cNyMZTLQT8GkNUOOV8nS73HSnZVE eN4BhrFCTplyp9LNgFiGAmtHSdPF95E1zzgCkmdoqiRoUeAKC1RO16r73dGYnTwFlBMg bLeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b="cmNVA/O5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p4-20020a056402074400b004c5248cbebfsi16677420edy.101.2023.03.22.11.46.59; Wed, 22 Mar 2023 11:47:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b="cmNVA/O5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231238AbjCVSqb (ORCPT + 99 others); Wed, 22 Mar 2023 14:46:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231154AbjCVSqR (ORCPT ); Wed, 22 Mar 2023 14:46:17 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D19059E59 for ; Wed, 22 Mar 2023 11:46:04 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 6EBAB5FD3E; Wed, 22 Mar 2023 21:45:58 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1679510758; bh=rVtVHS3YbcTr4exAe5aUDPpvfNLxMi2NgaBzD0hJtkI=; h=Message-ID:Date:MIME-Version:To:From:Subject:Content-Type; b=cmNVA/O5C1NVFgyexdnp+OOdABIBGzbys02plXb0EjUgKtFozxdkfVzG9zLs16WR5 BsDm1Ai5iKya/Py+xGP0fiefb0ajDtIqzMdjE/cbJQUeuzWFFcbZajrGe7vfPt/u4j Ze0/KQll445prTsaFh0JAdlUD3KFYhCh3wc+OuS86VMVRL5FIM/KIJNUIliCeWqPhU TG2rfabA/1YuF3Fbrw4wxLfszRw0vUTL5hIvi6FBs/i7sQNU6Tcw5LbQ8US5iZ13nb KmIEmJqmGwZSSGPhF5H71bWPsXokRiWewwBpjLJBbEDDUn69QTgYk/WCU0Ybf5ps9N gjeqj6iSL2mMg== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Wed, 22 Mar 2023 21:45:56 +0300 (MSK) Message-ID: Date: Wed, 22 Mar 2023 21:42:46 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US To: Liang Yang , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Jianxin Pan , Yixun Lan CC: , , , , , From: Arseniy Krasnov Subject: [PATCH v1] mtd: rawnand: meson: fix bitmask for length in command word Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH01.sberdevices.ru (172.16.1.4) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/03/22 14:20:00 #20991698 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Valid mask is 0x3FFF, without this patch the following problems were found: 1) [ 0.938914] Could not find a valid ONFI parameter page, trying bit-wise majority to recover it [ 0.947384] ONFI parameter recovery failed, aborting 2) Read with disabled ECC mode was broken. Fixes: 8fae856c5350 ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") Signed-off-by: Arseniy Krasnov --- drivers/mtd/nand/raw/meson_nand.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index a28574c00900..074e14225c06 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -280,7 +280,7 @@ static void meson_nfc_cmd_access(struct nand_chip *nand, int raw, bool dir, if (raw) { len = mtd->writesize + mtd->oobsize; - cmd = (len & GENMASK(5, 0)) | scrambler | DMA_DIR(dir); + cmd = (len & GENMASK(13, 0)) | scrambler | DMA_DIR(dir); writel(cmd, nfc->reg_base + NFC_REG_CMD); return; } @@ -544,7 +544,7 @@ static int meson_nfc_read_buf(struct nand_chip *nand, u8 *buf, int len) if (ret) goto out; - cmd = NFC_CMD_N2M | (len & GENMASK(5, 0)); + cmd = NFC_CMD_N2M | (len & GENMASK(13, 0)); writel(cmd, nfc->reg_base + NFC_REG_CMD); meson_nfc_drain_cmd(nfc); @@ -568,7 +568,7 @@ static int meson_nfc_write_buf(struct nand_chip *nand, u8 *buf, int len) if (ret) return ret; - cmd = NFC_CMD_M2N | (len & GENMASK(5, 0)); + cmd = NFC_CMD_M2N | (len & GENMASK(13, 0)); writel(cmd, nfc->reg_base + NFC_REG_CMD); meson_nfc_drain_cmd(nfc); -- 2.35.0