From patchwork Fri Feb 26 14:13:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 1444942 X-Patchwork-Delegate: narmstrong@baylibre.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=1x9j6ult; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DnBTR03fWz9sBy for ; Sat, 27 Feb 2021 01:13:30 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 24AB4827B7; Fri, 26 Feb 2021 15:13:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.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=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="1x9j6ult"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 36A57827BF; Fri, 26 Feb 2021 15:13:24 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (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 3F8CE827AA for ; Fri, 26 Feb 2021 15:13:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=narmstrong@baylibre.com Received: by mail-wm1-x32b.google.com with SMTP id i9so7238958wml.0 for ; Fri, 26 Feb 2021 06:13:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=J4/QZBRcCm6TYdPJMGKl+G/X6SY8LW7bdny9tFrMl4k=; b=1x9j6ult/gFKJyLCGx7qAqFKzGZAtYU5jvwgIPCPlV5JjCJuo1wTobQemkbMVIckfU QdN/SL1rUTI36DSHiCXCEG6eJUnzbcfE3uuwrjDwG7KrhvpEYmeKnWrndIhBNHkCab8Z sDS4bS2oUZGlZfTPR19TLFwNPwapfIyBcIa5WvBfTfhzRInsAZBacRXaZIVs3ug6XLR6 wMiwsTAY8/qGtLWfOf/my8vN0VnUT39r43UMP1JmEzSzRQZhlYH2bXwiOoaT398l9TB4 tBWmtSeRtalMKt2DKyOZUbxRwhg0N+TkGZIi9c57KCmTskpPBcGrPNOEu/bJ0FakzJd1 Sp/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=J4/QZBRcCm6TYdPJMGKl+G/X6SY8LW7bdny9tFrMl4k=; b=nsiHwbA3IFKRcal3E2CVtvKAKC/zs2YIuAyNoSRSVTvP71fFGW1GehdbxuO4FuBdrL Wouy2mfctLFHRGMv/GGhKPSPGWIxmaTwUhbYB6RB6kprmrv1CLEUEA70njylp5uxyEPA 0DWUXIzWHwcpcaCBh9zVG+PhbFqNWM4fxtXHDPTHFsTo7ZzdZohDBVS9RHS7nKz69d6k kc4tKP1suhgMYm0dH6+2ZF4UyzSu93cksMJCWrEI0gXW+SXZb2efWrIs9QT6EMuteqr7 ItewEsCtCj+vIvnP6z1R60Zrr1XMi6BBvnvI4xLCeUuaHQNaFOCkDNYa4oxa+Kql8R/H 408g== X-Gm-Message-State: AOAM531dX8/5ys1c2dv4K+6HLH08zLZq0tfwowJECGOfFKTKzKMoUD0g ArGpw8STWFIveqTG+qM3w0wmEzzHmKL1iLUa X-Google-Smtp-Source: ABdhPJzudA+cNp2I0faLj1RoXbEL6Oed07KZmANv03Pu3nbXGbiqzHZQsJOgFuVoaqTeJD9lYM9f2g== X-Received: by 2002:a7b:cb45:: with SMTP id v5mr3058393wmj.58.1614348800518; Fri, 26 Feb 2021 06:13:20 -0800 (PST) Received: from bojack.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id d204sm3984954wmc.17.2021.02.26.06.13.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Feb 2021 06:13:20 -0800 (PST) From: Neil Armstrong To: u-boot@lists.denx.de Cc: u-boot-amlogic@groups.io, bmeng.cn@gmail.com, Neil Armstrong Subject: [PATCH] nvme: add cache flush in get/set_features Date: Fri, 26 Feb 2021 15:13:18 +0100 Message-Id: <20210226141318.3882733-1-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean On Amlogic G12A platforms, the NVME probe timeouts at get/set_feature(), adding a cache flush solves the timeout. Signed-off-by: Neil Armstrong --- drivers/nvme/nvme.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c index 5d6331ad34..44c00a0309 100644 --- a/drivers/nvme/nvme.c +++ b/drivers/nvme/nvme.c @@ -487,11 +487,11 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, c.features.nsid = cpu_to_le32(nsid); c.features.prp1 = cpu_to_le64(dma_addr); c.features.fid = cpu_to_le32(fid); - /* - * TODO: add cache invalidate operation when the size of + * TODO: add better cache invalidate operation when the size of * the DMA buffer is known */ + invalidate_dcache_all(); return nvme_submit_admin_cmd(dev, &c, result); } @@ -508,9 +508,10 @@ int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11, c.features.dword11 = cpu_to_le32(dword11); /* - * TODO: add cache flush operation when the size of + * TODO: add better cache flush operation when the size of * the DMA buffer is known */ + invalidate_dcache_all(); return nvme_submit_admin_cmd(dev, &c, result); }