Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CB79C4338F for ; Thu, 29 Jul 2021 11:59:02 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B29C660F23 for ; Thu, 29 Jul 2021 11:59:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B29C660F23 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E325782E9E; Thu, 29 Jul 2021 13:58:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="b0qbTO8H"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E0C9682E68; Thu, 29 Jul 2021 13:58:46 +0200 (CEST) Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) (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 0D8CA8060B for ; Thu, 29 Jul 2021 13:58:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-ej1-x62c.google.com with SMTP id x11so9305373ejj.8 for ; Thu, 29 Jul 2021 04:58:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=cjqjRlhKxZMndo28Q2A+fct74WCSRX1YdJs1h2SCqcI=; b=b0qbTO8HqvvlvEgMSNwNJbZMXcbNIGipf8Yq5rwNVaWGi0ktiPwWKH8bCM85myXCqL C2tKfRFki4wbkAUFy/vY8jH8SpYsg+bLr/UYk/M1rudapmApbodxBlCwVo10ToCkQOVL x7EqKbLj3WDGvUZWcPUje8vJfXyfDg6UZjXvMTPCN07+HMUETGapJ7mpuRRre1O7yx+g hP1MzbX+gYcxtqPAmy7ytb6/WFMT7+mORAs3e9xDb9YiUYRVt3pxwln/lrXEbjkcp7WG kzp56ySTmYanwa5N89FE9r5V5JIuZrEYk/iHXHLXmdLAeTGce+ikfG0tygqqckBXYDNk 4Jsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=cjqjRlhKxZMndo28Q2A+fct74WCSRX1YdJs1h2SCqcI=; b=m6XP+fbqWsd1Tu8STmrV6ZR+CLhJNOFk5i5PIgM0frYKAxaT7n7Iremmfi88c5HZMn KnpuyfKJcmLVpW1atf1iF6/7ozswYh9o5hne6f/qxwWBCKJLxKnmSHyGLOXy1q0kgs4Z uBDc3J3qx5UHmLOSFeg4MgxifatlVqaN1fFOLoYjPRTylNNozi+BYgSlkXoGBFK3G5c6 t3wGsbpIWm160drdKlOxF8HgMBZfXEX9UjVkVLw+6xGRZsVHIumro322xJEvFXNkfdcM QP1sC2EavC/v8mJL3ftWHO+DOwHzj2rXnsIldBFiXr5qgsR23ZgSwKLHs1HSYXZwwhsu v0iA== X-Gm-Message-State: AOAM532MctD2FVCo2+FeV+CfOod6myZKBkZ1Jcx3FkGy6g6y+/mGNs1k dYVtRMS7cWvJQ5kZmq7snL4= X-Google-Smtp-Source: ABdhPJz1W2qxyUwkESl6fXx5nyyB0XcESe+mXxSuT9Hvlnzehfu/r/KH9wfo4eXfB3KkuAncDJMMlQ== X-Received: by 2002:a17:906:5aca:: with SMTP id x10mr4361498ejs.414.1627559918684; Thu, 29 Jul 2021 04:58:38 -0700 (PDT) Received: from pek-vx-bsp2.wrs.com (ec2-44-242-66-180.us-west-2.compute.amazonaws.com. [44.242.66.180]) by smtp.gmail.com with ESMTPSA id n13sm1134997eda.36.2021.07.29.04.58.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 04:58:38 -0700 (PDT) From: Bin Meng To: Jagan Teki , Vignesh Raghavendra , Pratyush Yadav , u-boot@lists.denx.de Subject: [PATCH 1/2] mtd: spi-nor: Respect flash's hwcaps in spi_nor_adjust_hwcaps() Date: Thu, 29 Jul 2021 19:58:26 +0800 Message-Id: <20210729115827.603282-1-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.103.2 at phobos.denx.de X-Virus-Status: Clean The smart spi_nor_adjust_hwcaps() does not respect the SPI flash's hwcaps, and only looks to the controller on what can be supported. The flash's hwcaps needs to be AND'ed before checking. Fixes: 71025f013ccb ("mtd: spi-nor-core: Rework hwcaps selection") Signed-off-by: Bin Meng --- drivers/mtd/spi/spi-nor-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 99e2f16349..2883d092fc 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -2861,7 +2861,7 @@ spi_nor_adjust_hwcaps(struct spi_nor *nor, * Enable all caps by default. We will mask them after checking what's * really supported using spi_mem_supports_op(). */ - *hwcaps = SNOR_HWCAPS_ALL; + *hwcaps = SNOR_HWCAPS_ALL & params->hwcaps.mask; /* X-X-X modes are not supported yet, mask them all. */ *hwcaps &= ~SNOR_HWCAPS_X_X_X; -- 2.25.1