Message ID | 20230617022920.67173-3-william.zhang@broadcom.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1745857vqr; Fri, 16 Jun 2023 19:50:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7NSlwZ0wSeOvLV76fCZ9YF0kQQ8WTIgfwVTu06M9UQcUDKVhgQSkD6XvBabTYpHsDETAGQ X-Received: by 2002:a05:6870:e0cd:b0:19e:d407:a753 with SMTP id a13-20020a056870e0cd00b0019ed407a753mr1170478oab.46.1686970245461; Fri, 16 Jun 2023 19:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686970245; cv=none; d=google.com; s=arc-20160816; b=GYe22dIC8HR/3pWsQQSxh6pKSzEDiu6c8zBBhm6ZrrvlAwAT05+Yzh9ac6NRUi8/uQ S/maumejW2BZC4J19lJlsbv14mv5fM/DzpFMG6HM80k36RrILUirw90l1nucgdx/UgNf u2APLdTDAsXDQgCCMuuAdR0bebtCjqlThN8PQXxWgUzcCk/KamI8QjXVmdMf9M7YqAuy 9kc2xHibuYi7SjCfH/AO2i98BLYYi1Ml06uLSxI57mKfVD+PfgCtO32Ok/da1gJiFOTz zNxmvasRMWixS+01PeKJ41soAOh4JeuPzEo1FwrSYnm7FGz9arVAE49n6+Xv4qArQszZ SsQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=5L72TTx+dKa/JLr0h0CV6Na7um/FCULAucW/lLCIBB4=; b=OWnMIs1Xi/jRziBvyZBMH7wRRNSnr7YzDYXd22Zb52Os6URpBHECY2J+uwCxVrwldm 67nzZhq3x+6Qr0CrBaI3cQtHkMqsVyhP6pjUClz0vwqOOuMiwr0ZsxJ/soeTtfANu97G BHN3XhyVzlAs5pIkKMM89Dc2CY5zFaJGPgz9qaUdEHAaZBkQN8ihYQjwcOdjFrookpD8 uocJ0FrXtzBTDaueU9tyGnPiD175N6y/Y3rOgYhm9BvkxKX3d8RUQn+22SaZvhaZszWY aB0OtRFLXdxoySCWZo5FmuLpx4ZX19b4KXy2uVbdaYXAP+4KwBIkVL7wv3bF5vkVSUFW xGrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=auFma5nI; 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=broadcom.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a8-20020aa795a8000000b006501b3c2009si13591523pfk.58.2023.06.16.19.50.32; Fri, 16 Jun 2023 19:50:44 -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=@broadcom.com header.s=google header.b=auFma5nI; 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=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232910AbjFQCaC (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Fri, 16 Jun 2023 22:30:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232772AbjFQC36 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 16 Jun 2023 22:29:58 -0400 Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96AF63AA8 for <linux-kernel@vger.kernel.org>; Fri, 16 Jun 2023 19:29:56 -0700 (PDT) Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-6b29c972e00so1270219a34.1 for <linux-kernel@vger.kernel.org>; Fri, 16 Jun 2023 19:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686968996; x=1689560996; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=5L72TTx+dKa/JLr0h0CV6Na7um/FCULAucW/lLCIBB4=; b=auFma5nI4ODhCg+Cu18tcTpI8H6v4Y3+wFwY7wnZ7RFKvUsb4+Yf8RLU21FL96Fc9a Z4vDJkIIPkorKF/eXqKek5HOMM6WcFyOU7NZfGOPzrwIl4n5lQeHgqlIJ8Pd4Ve/Lbjt YqkGoVMeGRCS6msts6x5WuM6nbOlgcsdlEYEs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686968996; x=1689560996; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5L72TTx+dKa/JLr0h0CV6Na7um/FCULAucW/lLCIBB4=; b=IZB73/gGyv6JzYtolo5bc7hBv5XUXfdPL9o9gcayzwMBR0AJNexR6etU8RWQTENjQS /sMBUszoK0I6VpBYDzkh27Ou3MTDxGYOiVrWCmO3KlzvQ0ppIF0V4uZEJ/+Q1rbwuKaC pWZveDkdwvmVtr7Cl115xnEd2/OXxP1GRgmUaf8MoNvnokcV21Ji1RZvs8IZAIV5blK+ u1ilXansh618Fghmc6C5zEbM4EoBHVlxrzpP2q8YRIVo+ec1YaINc5KlljKv7fxUBveW NUdcR8MMoDKQrh5i2TIvLi/y+1u/YPKzEOaVJev26tlCkhm8ylE2nGiuMXOOrGUqJrJh shfA== X-Gm-Message-State: AC+VfDzGaIUMe9zU5D82OCLmCaI7OqUSDBAx6goa4lrLTinIfqrZNtKh 6rL8+qaihMWoHmNLAX/SvYk5RQ== X-Received: by 2002:a05:6359:d11:b0:129:b96c:1d2b with SMTP id gp17-20020a0563590d1100b00129b96c1d2bmr786023rwb.28.1686968995801; Fri, 16 Jun 2023 19:29:55 -0700 (PDT) Received: from ubuntu-22.localdomain ([192.19.222.250]) by smtp.gmail.com with ESMTPSA id b2-20020aa78702000000b006668f004420sm3520239pfo.148.2023.06.16.19.29.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jun 2023 19:29:54 -0700 (PDT) From: William Zhang <william.zhang@broadcom.com> To: Broadcom Kernel List <bcm-kernel-feedback-list@broadcom.com>, Linux MTD List <linux-mtd@lists.infradead.org> Cc: f.fainelli@gmail.com, rafal@milecki.pl, kursad.oney@broadcom.com, joel.peshkin@broadcom.com, computersforpeace@gmail.com, anand.gore@broadcom.com, dregan@mail.com, kamal.dasu@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, William Zhang <william.zhang@broadcom.com>, Florian Fainelli <florian.fainelli@broadcom.com>, Miquel Raynal <miquel.raynal@bootlin.com>, linux-kernel@vger.kernel.org, Vignesh Raghavendra <vigneshr@ti.com>, Richard Weinberger <richard@nod.at>, Boris Brezillon <bbrezillon@kernel.org>, Kamal Dasu <kdasu.kdev@gmail.com> Subject: [PATCH v2 2/4] mtd: rawnand: brcmnand: Fix potential false time out warning Date: Fri, 16 Jun 2023 19:29:18 -0700 Message-Id: <20230617022920.67173-3-william.zhang@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230617022920.67173-1-william.zhang@broadcom.com> References: <20230617022920.67173-1-william.zhang@broadcom.com> MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000c305f205fe4a132b" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768916511811994299?= X-GMAIL-MSGID: =?utf-8?q?1768916511811994299?= |
Series |
mtd: rawnand: brcmnand: driver and doc updates
|
|
Commit Message
William Zhang
June 17, 2023, 2:29 a.m. UTC
If system is busy during the command status polling function, the driver may not get the chance to poll the status register till the end of time out and return the premature status. Do a final check after time out happens to ensure reading the correct status. Fixes: 9d2ee0a60b8b ("mtd: nand: brcmnand: Check flash #WP pin status before nand erase/program") Signed-off-by: William Zhang <william.zhang@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> --- Changes in v2: None drivers/mtd/nand/raw/brcmnand/brcmnand.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c index 69709419516a..37c2c7cfa00e 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -1080,6 +1080,14 @@ static int bcmnand_ctrl_poll_status(struct brcmnand_controller *ctrl, cpu_relax(); } while (time_after(limit, jiffies)); + /* + * do a final check after time out in case CPU is busy and driver does + * not get the enough time to poll to avoid false alarm + */ + val = brcmnand_read_reg(ctrl, BRCMNAND_INTFC_STATUS); + if ((val & mask) == expected_val) + return 0; + dev_warn(ctrl->dev, "timeout on status poll (expected %x got %x)\n", expected_val, val & mask);