Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2711147lqp; Mon, 25 Mar 2024 07:17:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVp2xwWkvZmVi4pCBpS70Bcv1pF3EtSFjT0iYVkcmzSyysgGk1nk8cfmxIiSscQON/Mgm11Eyfu39/s7jKU5VY39hkoLR/UPKn9Ub9v7A== X-Google-Smtp-Source: AGHT+IEoUsEc7EG3yA7BIfmTkQ+ryJfXQH7BBTnsPcARX29oozQJTSea9Y8uOHvJ6Jxk0g95I9eT X-Received: by 2002:a50:a6dc:0:b0:56b:a017:e9 with SMTP id f28-20020a50a6dc000000b0056ba01700e9mr4198319edc.41.1711376234395; Mon, 25 Mar 2024 07:17:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711376234; cv=pass; d=google.com; s=arc-20160816; b=zoJDeIXanKxM3FTzNUb8JgERJDAqEch/HG0+UUVjg8o4hRa6ZSG3d4RXSsZCwzZfmo tuOSzD1SVevLrU8Yxhr6Gi+A1F3bosdwGFetdwhPLhpbhk8g6zusNHkjVvtQaQYyUGZl qdkvA/5aKppI3VK9kgUHUevHJRPsnvQu1oZYQtVNp1xc/0mrlv30ct4meprUkjeYcO7B AAUNpKtoqgpvQJzBKQ9LwUxkeFSdtLT6HRpvPZMsXSLrOzXn8KIGLEaAtP1mTZot2fK5 ebWaA35anKopXKYdSU37uaL4JNyEO+tFfWPoQJmr89lf4crO8mViJQtGUXYUtqpo+RbO xdIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:references:mail-followup-to:message-id:subject :cc:to:from:date:dkim-signature; bh=CamFrT0reqTDJ7jbhj/1NySGwvpXr3L1a1Ko18MM4wI=; fh=tNwGgq48rDpbGL7X/Mwnq5OaseWDir5u1+tYZeyTa5o=; b=rukrVqfb8Z3EyvuV5952HCWLk1AswYjQkpdtCbpqpKpJwQE/RtHxnpaf2nLCWfu2dD ex8VpEZh1I9NxBwH/hDhthvWTDXI2ORpF4RUXpbKVxqG4VTjgIGACcE+G8j2/tCwEh3p /IGZZl/c9xlHUeYN2caDHORRBhWUfKehZpsNBqcSnIg6wbsHUqE9sTRqQ1Z/hpWaEt+1 T5GV4eng9YJfIvxuWeTyIq0wmqHrj1O9cWOfSCafGEKGZtUai5WY8joGXo2D1T8995iN dQtFoNfJ3Op8M3bDPjHYN2maZmNEQ83Z/+ocKiJO6DqAZg6ymfFEsUVvpO6dHPI6A9hs 8bgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@thorsis.com header.s=dkim header.b=Xyi6vghX; arc=pass (i=1 spf=pass spfdomain=thorsis.com dkim=pass dkdomain=thorsis.com dmarc=pass fromdomain=thorsis.com); spf=pass (google.com: domain of linux-kernel+bounces-116799-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116799-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=thorsis.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h12-20020a05640250cc00b0056bfab7fa48si2358989edb.671.2024.03.25.07.17.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 07:17:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116799-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@thorsis.com header.s=dkim header.b=Xyi6vghX; arc=pass (i=1 spf=pass spfdomain=thorsis.com dkim=pass dkdomain=thorsis.com dmarc=pass fromdomain=thorsis.com); spf=pass (google.com: domain of linux-kernel+bounces-116799-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116799-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=thorsis.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5A0631F2864D for ; Mon, 25 Mar 2024 14:17:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A0D4181D1A; Mon, 25 Mar 2024 10:47:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=thorsis.com header.i=@thorsis.com header.b="Xyi6vghX" Received: from mail.thorsis.com (mail.thorsis.com [217.92.40.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C822A181CEC for ; Mon, 25 Mar 2024 10:07:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.92.40.78 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711361242; cv=none; b=MpvXB+Ln9u+OrErOWwTNOXKMmKjT0dGUX9NGvthPDt99+VXzZQfx0jh0mrW8yEKpc1dc2XG+bhFeOB0luyEwb3kZBisCxgbOSJ6e62Mfu5oBZVBujR5ZwxkyWqgFFhniIA2OARLDZ+hgG1D0PzSdYNJIaVzOfavOtuxEPZz8h9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711361242; c=relaxed/simple; bh=MXPVqAABq7kB9ZThxwEzUc/ew8Bqvh+Zyd4mkqv/lus=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uwLs9Hd2PHvVNZSmUSq93F4RagporYXZ5EOJdV+StFmr+ukcrjawG+A5myi9Y4rryp/2o5L8vgdtzrWPfBjDTK9/PJ+7XFqPrn9h17LB9fwAeITnkZ2fxizNVSjsB2xpFzkyazZsenKb7T0F2yeZcz4WehTeXKk5zimG+l8lbos= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=thorsis.com; spf=pass smtp.mailfrom=thorsis.com; dkim=pass (2048-bit key) header.d=thorsis.com header.i=@thorsis.com header.b=Xyi6vghX; arc=none smtp.client-ip=217.92.40.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=thorsis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=thorsis.com Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 472731484B07; Mon, 25 Mar 2024 10:59:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=dkim; t=1711360765; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=CamFrT0reqTDJ7jbhj/1NySGwvpXr3L1a1Ko18MM4wI=; b=Xyi6vghXh4FTX8vYs+zIjiiogALaahRNb8Cc56dQkwsVwBkWneolgu3D9b5oH9WkpSzQSo WlkfY/7V5NvgfWugGODt3oLdnWpkGXsKKOzcPKb2gpbi5PWrxFVzV3px1PM5VblbbZHiXy 8Hk4lwaZwyBFxjHTOA6uc4KVYr7tkdxbhRxsqwIfECkHQQfTKirrt3u7GoRo/BYM0wRl3h YLzciLsQW+/zekSNbvuUzAg2fxwkUbvxkybccTsPHpN4GB/0LlUeWH1qpE0k9FFNhgjBz9 f0oilnIchjFMWGvTP4k1VzgolnqWYQ/7SuETD/SkMh81+GxqPdzsLXAfk1tqOg== Date: Mon, 25 Mar 2024 10:59:09 +0100 From: Alexander Dahl To: Miquel Raynal Cc: Alexander Dahl , linux-mtd@lists.infradead.org, Richard Weinberger , Vignesh Raghavendra , linux-kernel@vger.kernel.org Subject: Re: mtd: nand: raw: Possible bug in nand_onfi_detect()? Message-ID: <20240325-dig-user-c4b9af6f8ea2@thorsis.com> Mail-Followup-To: Miquel Raynal , linux-mtd@lists.infradead.org, Richard Weinberger , Vignesh Raghavendra , linux-kernel@vger.kernel.org References: <20240306-shaky-bunion-d28b65ea97d7@thorsis.com> <20240306164831.29eed907@xps-13> <20240307-pantry-deceit-78ce20f47899@thorsis.com> <20240307181931.440c9c3f@xps-13> <20240325100917.502c75b7@xps-13> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240325100917.502c75b7@xps-13> User-Agent: Mutt/2.2.12 (2023-09-09) X-Last-TLS-Session-Version: TLSv1.3 Hello Miqu?l, Am Mon, Mar 25, 2024 at 10:09:16AM +0100 schrieb Miquel Raynal: > Hello Alexander, > > > > > > The condition is true and nand_change_read_column_op() returns with > > > > > -EINVAL, because mtd->writesize and mtd->oobsize are not set yet in > > > > > that code path. Those are probably initialized later, maybe with > > > > > parameters read from that ONFI param page? > > > > > > > > > > Returning with error from nand_change_read_column_op() leads to > > > > > jumping out of nand_onfi_detect() early, and no ONFI param page is > > > > > evaluated at all, although the second or third page could be intact. > > > > > > > > > > I guess this would also fail with any other reason for not matching > > > > > CRCs in the first page, but I have not faulty NAND flash chip to > > > > > confirm that. > > > > > > > > Thanks for the whole report, it is interesting and should lead to fixes: > > > > - why does the controller refuses the datain op? > > > > > > See above. > > > > > > > - why nand_soft_waitrdy is not enough? > > > > > > I don't know. That's one reason I asked here. > > > > > > > - changing the condition in nand_change_read_column_op() > > > > > > > > Can you take care of these? > > Now would be a perfect time to send these fixes. Could you work on them? I'm sorry, no not yet. Have some more important work to do, which will take another one or two weeks before I can return to this problem. Will have to wait, at least from my side. Greets Alex > > Thanks! > Miqu?l