Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7250018rwl; Thu, 23 Mar 2023 01:18:20 -0700 (PDT) X-Google-Smtp-Source: AK7set+nmSCGkQXO1PSB/3bPBgE+F0j1wR904aok9Tyd7Xi/Ob97CL351RO+Mvw/MSVIvyIiJ2xG X-Received: by 2002:aa7:c448:0:b0:4fc:8642:ce56 with SMTP id n8-20020aa7c448000000b004fc8642ce56mr10433168edr.25.1679559499994; Thu, 23 Mar 2023 01:18:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679559499; cv=none; d=google.com; s=arc-20160816; b=F7pU+Du2FiisWFEtcBwk4nD4KydBl9QIUgqOKUbR0/LDbJbG3WQjphKPZd5Hah/qDC lNyVT8+g8HV2MB9veY/ZK37flVBSJZjrpqFoEICQ+Q8z5Yq4xjjFbiUoX2IniDXRWUlV 21fE76rCh3PTrFIYJHS8iXfjuZb0XGpZentCpkUadv+4Ab9r4T74MuBD41/yBut/Xzu5 ab7x6OLxwF75w2F0J47Ozl3bgmO2YFCTtPukVFMBdIuKACTcvZYTTyZXxkdms7X7OftC hp0YiZm+JfECDi2Kcnx5n06EBIMkySbhW3kKqMdJNh0qeO4KQBb7vzAj4MTtKRSYzM7b yamg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=O7oYKc3LTw4AoaR0hMXQ+c+BRl+QFQbOY09tziUSnEs=; b=phsnos7Ki4xrjvAWC9CYFM4kmqzM6KgC7eMURv/CV+cVJdLbm/fNlANBDa8WhETY5j ZrLHUriwMHVKURv0ffywsGMX+1fbN1KY8WkQUEbXZnioMKZhpmkYtSPvloPdbOiIE3+R ltHUz4h0QMwVZiMgsKYzjYe3VX9oZc/2NBQv9fuY7kY9aLGSRXzd99A4mg6bzfrnN3Hd rJSViwhUVeTB9HdNPsASk591JG0TyP0rTrWaG5X3wftfhJdgphvs6B9FHa33NHvkA+3k e5j0VPbexbvTGd7eb0D9K4QQf8Ln8ul1hJzuk04xNzRWyUTwK2MEuiZ/3wk6xHy4NaHQ 5Xxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=c7xOLGbe; 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 h3-20020a50ed83000000b004fc43a04debsi17778688edr.294.2023.03.23.01.17.56; Thu, 23 Mar 2023 01:18:19 -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=c7xOLGbe; 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 S230350AbjCWIBQ (ORCPT + 99 others); Thu, 23 Mar 2023 04:01:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjCWIBP (ORCPT ); Thu, 23 Mar 2023 04:01:15 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A8272055E for ; Thu, 23 Mar 2023 01:01:12 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 5F4285FD45; Thu, 23 Mar 2023 11:01:09 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1679558469; bh=O7oYKc3LTw4AoaR0hMXQ+c+BRl+QFQbOY09tziUSnEs=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; b=c7xOLGbe7skXPzXF2yS/VEyLxNWBFVB7DBrvBlW/G6yZyEa/uAm8o/w1BTPJiEOEL zxN2FAOEBTwz09bwFsZ3jlNS4TCQBf8phoB7T8hyCsluBT4PfEALHWOvJsL4Xq0PXA xDkDpnfisQGv1mKmkU/gfIEgFg+z+VtzmEst051CZILhU+qRgyjI4pucTzN71U2PLJ EWYY3JLzx8yU1QNa3TlqMm5g4EdNwrmICq1GMYnjXYi0eYbXn9C3CgnG0d7sD3p/6I TQtuR6/7pFKyGyfcrzBRn+nk8XgrYF5CarIyMpDXYbztexd2KwmRx+OEmHhlLjp3br yX60YAxpgfCJw== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Thu, 23 Mar 2023 11:01:07 +0300 (MSK) Message-ID: Date: Thu, 23 Mar 2023 10:57:56 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v1] mtd: rawnand: meson: fix bitmask for length in command word Content-Language: en-US To: Martin Blumenstingl CC: Liang Yang , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Neil Armstrong , Kevin Hilman , Jerome Brunet , Jianxin Pan , Yixun Lan , , , , , , References: From: Arseniy Krasnov In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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/23 05:59:00 #20997558 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,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS 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 On 22.03.2023 23:10, Martin Blumenstingl wrote: > Hello Arseniy, > > thank you for submitting this fix! Thanks! > > On Wed, Mar 22, 2023 at 7:45 PM Arseniy Krasnov > wrote: >> >> 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 > This matches what I can see in the old vendor driver, so: Moreover it was clear that mask of 0x3f is too small for length of data in bytes, for example for 2048 + OOB size. > Acked-by: Martin Blumenstingl > > [...] >> - cmd = (len & GENMASK(5, 0)) | scrambler | DMA_DIR(dir); >> + cmd = (len & GENMASK(13, 0)) | scrambler | DMA_DIR(dir); > My understanding of the vendor driver is that this "len" is only used > for "raw" access (my own words: any access that doesn't use the HW ECC > engine). Exactly, 'len' is only for raw access. > As a future improvement (no need to update re-send this patch) it > would be great to have a #define with a meaningful name for > "GENMASK(13, 0)" (maybe something like NFC_CMD_RAW_LENGTH) as it's > used in multiple places now Ack Thanks, Arseniy > > > Best regards, > Martin