From patchwork Wed Sep 11 07:11:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 827366 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp663780wrc; Wed, 11 Sep 2024 00:11:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWpUd2iHfL8l2slZWUuluUjmKPENlA8KKOVHwgzmVaC0uYzJr8ld0t2iRzrIlRsYgG0avFdOg==@linaro.org X-Google-Smtp-Source: AGHT+IEqoWjoIhKnpyog32D+8OubJt7+B6VK/NTVYsVNNl+nbhlkVQTK9ekff4L2E97b0wiY4vFY X-Received: by 2002:a5d:5f50:0:b0:371:a60e:a821 with SMTP id ffacd0b85a97d-378b07f37fdmr1306808f8f.38.1726038714313; Wed, 11 Sep 2024 00:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726038714; cv=none; d=google.com; s=arc-20240605; b=VnU+RXsGB3KlhaurRpmlh6RijPZjORiRpcc1t1ZlUOLdoBqC0+Zws8ujeCCMkxUEK1 sM3aJbj1SZPwU7aOHVtOfrQNnm1+K+j98IEZcr397Hx/deSWnaKkh8lcmd/KufXdzYKb xDaWf5XcVzs9cBUJjINidPCTLuEGpApnCU/TUqja1X6HfzdzKdJHz7QV79Ns8+joaomW IN2Uel2z3fjN9EH2Mnpw9TnyOdCoOXjGWWoPJdbK5goUyGKurol3yjddokHrnMR83Asb hcBNy8ZkbWktcjJO2IYsKmkTXk+hXViYwMO1qQuSWYMoehGrVO2IMGS8P24AHvUXJ5Wq Ny5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=cy0AelE8X6/ImwZyMOvnLyspFv+MmXcjl2xKIRLZjow=; fh=bbSjVJcsz6ma3Arirz+KWNos93PEC62yDVUDN8y6koA=; b=c4gET86wX6BMEptJm192yWeFhJY9xiSgIzsEBD1RwZxaGYxKPnNVUPRYrJbljxPdyZ F+LeKU9hPr083nnjYZI9cnSTmGzBWUItQMvT5i+IWZ3RT1j1gZ0PHY+XSdCzhtYhQjcC QJhwvsB2j8XK0GFq5VDHo2wsOMqkemUxf3KTNgitA2HLfPm1m1vEeqcEjnaDd1ARG9tj SXfqg9+8DJ+H4Dyt97GHTY6KuqZ1pr/0FmaKJHIz/UhKg1FYie2ywaS4k1dTW5Bp+Qq1 MrhKFlaGxavN+FxZyW8WelIcijIKwDdu/05sPQz0/5ijoF7hxC9jJH0tnJ8M4LIoBzqM ynjQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=or6zx83L; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id ffacd0b85a97d-378956d7e4esi3624394f8f.952.2024.09.11.00.11.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 00:11:54 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=or6zx83L; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5D6A7891C4; Wed, 11 Sep 2024 09:11:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="or6zx83L"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6FCE5891DA; Wed, 11 Sep 2024 09:11:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8098A891B4 for ; Wed, 11 Sep 2024 09:11:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=linus.walleij@linaro.org Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a8a6d1766a7so197825566b.3 for ; Wed, 11 Sep 2024 00:11:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726038692; x=1726643492; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=cy0AelE8X6/ImwZyMOvnLyspFv+MmXcjl2xKIRLZjow=; b=or6zx83LwwSfqBIAtqQ62KRpd3Yj65aL2pKoLVmLV+ZqfxihXVIa74oBGUGTGCwDng gTApGUQuGpMwx+8MeG4mqGyNhPAuq1Owu82++edWmiX126uqIoZZ4a0eAKfu+xh/wAOG ztenGlGnGcJ1/EQsMIKntpNSJlhm+AxBZMDEcaQutt6CrZHFFk/1RbiLb2qjsYRYIeYJ k18w1rQsz2B46zHm77318Kb0kUaLqeFTU8suwdPDlWAca3v6ITTmmj87GA0oiyn7F1oJ SR/gB4Wxa+a3EScXrRr0If10Pij7UhNDWx9m7oFDQyiFhkURnIbB7FBJ1UwiiznhtJVw vYeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726038692; x=1726643492; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cy0AelE8X6/ImwZyMOvnLyspFv+MmXcjl2xKIRLZjow=; b=gk70JzBiS6qvZZJvHHA5JJoMXlyJtHhZSsASaCvuWEiYIwnfRt3PYeMgpKgeR9+eNF QD+5IhqG9D2W6DWnLFunW3Zcs92VbFZYuJczPVOsbfV+l8v2QWPXHPzeh+5qe1gjjv8Y MA90oHgV51x4msrx01rwiWFXBUpSNvpyk8tnfH7iweE/FFwF275uDlv5WczMw1mPZPy5 5EE98mccA6y3bUZbDtlnOqFbZaKEPEAvzR0nlUx84fXJktFrEcoQTtQ0P/JLWmv0p4XD QuSM1mkDGaQpoTyUzpPQtGsJXxDGC/S0LVee3J1D6AfYYM3YG4dzKCyNHc/iA0E7Sxd2 nfmw== X-Gm-Message-State: AOJu0YzUL48g8qJ79bJOz49rbFP4RgkxGLT3u1SV43lMZ9I/l+d+n8Ru 6Ssb40pb/Dl3CNFpU5fwRCpxu+y5U345jiC5gPaz6Ai1+2IlcinhIgWxU/a2JuQ= X-Received: by 2002:a17:907:94c5:b0:a8a:1ffe:70f1 with SMTP id a640c23a62f3a-a9004a46f0amr172951366b.50.1726038691781; Wed, 11 Sep 2024 00:11:31 -0700 (PDT) Received: from lino.lan ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25926ee8sm580523866b.50.2024.09.11.00.11.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 00:11:31 -0700 (PDT) From: Linus Walleij Date: Wed, 11 Sep 2024 09:11:13 +0200 Subject: [PATCH 2/7] mtd: rawnand: brcmnand: Fix potential false time out warning MIME-Version: 1.0 Message-Id: <20240911-brcmnand-fixes-v1-2-be112a20aaf1@linaro.org> References: <20240911-brcmnand-fixes-v1-0-be112a20aaf1@linaro.org> In-Reply-To: <20240911-brcmnand-fixes-v1-0-be112a20aaf1@linaro.org> To: u-boot@lists.denx.de, Dario Binacchi , Michael Trimarchi , Anand Gore , William Zhang , Kursad Oney , Philippe Reynes Cc: Linus Walleij , Florian Fainelli , Miquel Raynal X-Mailer: b4 0.14.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: William Zhang Backport from the Linux kernel: commit 9cc0a598b944816f2968baf2631757f22721b996 "mtd: rawnand: brcmnand: Fix potential false time out warning" 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. Signed-off-by: William Zhang Reviewed-by: Florian Fainelli Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230706182909.79151-3-william.zhang@broadcom.com Signed-off-by: Linus Walleij --- 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 700d1122639f..46a4107a83a9 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -1011,6 +1011,14 @@ static int bcmnand_ctrl_poll_status(struct brcmnand_controller *ctrl, } while (get_timer(base) < limit); #endif /* __UBOOT__ */ + /* + * do a final check after time out in case the CPU was busy and the driver + * did not get enough time to perform the polling to avoid false alarms + */ + 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);