From patchwork Sat Dec 16 20:11:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Moritz Fischer X-Patchwork-Id: 1876988 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=SxstWDX7; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Ssy0W0vsGz23ns for ; Sun, 17 Dec 2023 07:11:39 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5D9D487C4A; Sat, 16 Dec 2023 21:11:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com 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=google.com header.i=@google.com header.b="SxstWDX7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4050E87B0F; Sat, 16 Dec 2023 21:11:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-vk1-xa4a.google.com (mail-vk1-xa4a.google.com [IPv6:2607:f8b0:4864:20::a4a]) (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 2AE9A87B0F for ; Sat, 16 Dec 2023 21:11:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=3awR-ZQcKBp4KMPGRXDEMMEJC.AMKS-9MMRJGQRQ.BCLV.BC@flex--moritzf.bounces.google.com Received: by mail-vk1-xa4a.google.com with SMTP id 71dfb90a1353d-4b2c93002cbso686236e0c.2 for ; Sat, 16 Dec 2023 12:11:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702757483; x=1703362283; darn=lists.denx.de; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=R+TXkMJ/t6Q+3fjY90wLx224mzpS5P1fMn5YjECxOas=; b=SxstWDX7cD5/oJe6sQWpa1kXRc7M3MdeQKMiwJZA8pJNd0jOyopPFLbyNRNleF8qFG RUzkinOpcxBBaE+cHeyyNUCdegCiW556N2kc5foGv3QBOC+an500PjbDcydMYqSgP9gK VQUliZsTSP90cWuAisgVmB7JFxh8nWr/O28u83+/wQLmhoLC0bfjkwVE1MOOBObnlqlo NSN7NZZzO/GdBhrEPTF66nS/+cFiRwrjYOIkDb9WWDXG0vGXxQA86zh/OssM3yWuas6z IIJv6y7faOX/rf2ifeLqS25k7U0Z3+KR8YI+s4WKQ9k36AxJjdHygIFVUV2+lN35ii/N xP2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702757483; x=1703362283; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=R+TXkMJ/t6Q+3fjY90wLx224mzpS5P1fMn5YjECxOas=; b=Rj4f1MFU7BGYYaB7HUs/qB3sFOwe4rZoC1upa7iCZlAx8l+LQSZFsF8uB3FExC7mqx vk01Bl330tWX7lej2n08a0x8cEGQ554hjsgII1ov0rIY/mrjo/wnpvNENpOqLT3oHIiF OCvKgq2mKonRZK9xM6sth8kzeDP2YYmR2dXVVG7jbyUQKMM29YXbpSe4zhg1pa+REnDv pah8FNw4Wbnl5yJLREAA1XtwyUqs82OFlSPsZuVdjD9K64pbQFkWUqs4o++7aOR4gshP 2MT7dRJxg+xKbut1ZuC1reWfxwpfbSoT56Vm4WAph+AzldhWNl9qe1EXA8p4THSKZL9X 9neA== X-Gm-Message-State: AOJu0YyEzCB/a7MyQ2HCaw90OPyNuRhARMeLX8M7mMXMfy4GOz/Ex23H debtbTy1aGU13TqLrykydbdZQRCyr/Dq X-Google-Smtp-Source: AGHT+IGwePY9dUe876CZQIU5Z1jp7ZjbvOCDP02RrvTMWUfWzvp89BU19TL/2yu502bEKxvaLO/scCCHZPDf X-Received: from morats.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:d9e]) (user=moritzf job=sendgmr) by 2002:a05:6102:1612:b0:464:a368:25fc with SMTP id cu18-20020a056102161200b00464a36825fcmr380819vsb.4.1702757483712; Sat, 16 Dec 2023 12:11:23 -0800 (PST) Date: Sat, 16 Dec 2023 20:11:19 +0000 In-Reply-To: <20231216201120.2735840-1-moritzf@google.com> Mime-Version: 1.0 References: <20231216201120.2735840-1-moritzf@google.com> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog Message-ID: <20231216201120.2735840-2-moritzf@google.com> Subject: [PATCH v2 2/2] nvme: Update scan namespace to keep trying on busy From: Moritz Fischer To: bmeng.cn@gmail.com, sjg@chromium.org, wenbin.song@nxp.com, u-boot@lists.denx.de, trini@konsulko.com Cc: mdf@kernel.org, patrick@blueri.se, Moritz Fischer 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 A busy controller shouldn't be game-over for all controllers, so keep trying on hitting -EBUSY. This change brings the actual behavior of the routine in line with what the descriptions says. Fixes: 982388eaa991 ("nvme: Add NVM Express driver support") Reviewed-by: Simon Glass Signed-off-by: Moritz Fischer --- Changes from V1: - Added Simon's Reviewed-by --- drivers/nvme/nvme.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c index ec45f831a3..59a139baa0 100644 --- a/drivers/nvme/nvme.c +++ b/drivers/nvme/nvme.c @@ -695,7 +695,9 @@ int nvme_scan_namespace(void) if (ret) { log_err("Failed to probe '%s': err=%dE\n", dev->name, ret); - return ret; + /* Bail if we ran out of memory, else keep trying */ + if (ret != -EBUSY) + return ret; } }