Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2402512lqp; Sun, 24 Mar 2024 18:01:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXoIv9+rwu3SiK9TS0AP5opmZK+PeDTql+GQg7CzrktTqHB0y902o/O9+NFNb+cFzad+FXEBojJXdhMpIZibdveKn3mfl365IIww7aCvw== X-Google-Smtp-Source: AGHT+IECVLYm/LhEppYFGzreTYzGaFmGGbydEiLNqkhITRIQ9x/pkPmrvJBfjO8QqoTfLI6M0MSS X-Received: by 2002:a17:907:37a:b0:a46:1e:d199 with SMTP id rs26-20020a170907037a00b00a46001ed199mr3717645ejb.39.1711328512678; Sun, 24 Mar 2024 18:01:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711328512; cv=pass; d=google.com; s=arc-20160816; b=n1IfID2AjeOVWoQYrJtSpraoen6xemzY96VVAEdGPaRUKFGJS0E4zEL1X2yAFovoOg q/HyVDbFFHRh1fIesHvlSqjeRcQoofWY5g7krV+01wTLHT7kNitL8niS1lRnWPmZGgEy ktiouhRAzZdPs9raRddNyM938IH2enTwRfA9NZo9MsntzD4trYO50YbBnJ7TGxuJJd+P BLOVxSM95FhP1AKzE8GV9jQqH13RVjNX+/8M54dE/zouZS4zVE1s+VyZgkUZoBl2d9Tr aUgUtqvxrTh/ArAHqEDbVcETWpr3UGkMlEVpPF5CeNJZSbbGW1bYKrpMVweW7FzQl5Dz cdsw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=2kk4YVPs3ibRogaC/tQxGAQwFMz5aWMggLX/0apA0B8=; fh=PxnQhH3N57/4zedOdBIPceU9ETUwCG1lGzSxtQobvfA=; b=07pe5GYvae04Fm7oY3F4AVbS6rUpjpXF8V76270l3p14nIlSIyqca6sZKzbCPBa6F5 2m3v1mFLAMxcCdZNGIEnlEKkNTqnnwu7QkpEZT8pnhxRamBsotudqHPQY0KKdmPX4agw QbdKpNSpeD/oyahphJSD4ZF2jwEQMP4bZJmDFlwrPAuc6oqWInPoPcHd9sYhYO8agNzw JNS3SODCplZlm6Hu0NNSCmVec/3omB/jxjL5sauZnMvZ7HT/V65c9gjgNO6SsZ8c6VYd gLuM+rZKgO7pG05RU1I9d1xv1ZN8XGrMFdbMYKyHrnIztY8joam9DMeSO+mt5wzfgMKt Sksw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GDW8Qr4V; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113550-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113550-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g2-20020a170906198200b00a4720ded97dsi2048745ejd.185.2024.03.24.18.01.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 18:01:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113550-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GDW8Qr4V; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113550-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113550-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6A89A1F231CB for ; Mon, 25 Mar 2024 01:01:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 91C431C3A35; Sun, 24 Mar 2024 22:45:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GDW8Qr4V" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD14B1C3A19; Sun, 24 Mar 2024 22:45:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320352; cv=none; b=nNVFINjsBuY02rTvzAPxX3ZUNHE+i0SBv9R4tSf1UZBI7JBzTfBWUN6Lw+DptoTpNctwRWsC65ss6b7mTN7Yvi9jn8AQwCEU8Pom+NZ0OzrF3D+qMjUP7vdN4ZnNkqhHeMgnD6OC5oLHWzN6eLey1zjU5y5cXvEhlUK7S9XJvTw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320352; c=relaxed/simple; bh=ZjFtkj7Sg9roU8JTgLvzvOkOFj7QNLiKkRGYICIm8bQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=grygXGd37Zid8poupXLUL1JwyVH2scd330TioO1UNmey5jlK0dTsNSMZdICMN4ZFge14Vk7ePMF7u4li37zLuLMyqbW2+xWbj9VzAobkU7eKNTXkQ8OODLA7o0pEUNX6TzWBRZjQY3t0Gwvt3Y2oAIMsvOk/XjbDyOnhZLPolbc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GDW8Qr4V; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67CF6C433C7; Sun, 24 Mar 2024 22:45:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320352; bh=ZjFtkj7Sg9roU8JTgLvzvOkOFj7QNLiKkRGYICIm8bQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GDW8Qr4VMNLmPC7ExZahDUpOue4PzQMe15tPVIh3ieewf8TPOnJF/g5mJm49R863c CQvDZ1VwBnTVpBmYYJQ0uoXyJGcRakor4ajOruLhRTeQGmV3l0tI6s+Sjv/WRvvyu5 1AV8DPCHCcl0uQJ3JFKOHb8r1y0vYbNIRb5g4gVEz3HqwNLgIe9ZM/bWSa2+tJSqn+ fGmSoeVnwimh+MfSMx6X8hn43rLUfCA0063XYiIj2MDP6XTeglOFFxg2nL9+Cf2fgs vI1tFEk/YEeIveUzBihGrTkhSD7szkf4mM8q025QNaOy8EtyNopeqeUhIPmSM1RNXk LAB3v+FpWQs0w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Florian Fainelli , Michael Walle , Pratyush Yadav , Miquel Raynal , Mika Westerberg , Tudor Ambarus , Mark Brown , Sasha Levin Subject: [PATCH 6.8 659/715] spi: Fix error code checking in spi_mem_exec_op() Date: Sun, 24 Mar 2024 18:33:58 -0400 Message-ID: <20240324223455.1342824-660-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Florian Fainelli [ Upstream commit 29895ce18311ddd702973ddb3a6c687db663e0fb ] After commit cff49d58f57e ("spi: Unify error codes by replacing -ENOTSUPP with -EOPNOTSUPP"), our SPI NOR flashes would stop probing with the following visible in the kernel log: [ 2.196300] brcmstb_qspi f0440920.qspi: using bspi-mspi mode [ 2.210295] spi-nor: probe of spi1.0 failed with error -95 It turns out that the check in spi_mem_exec_op() was changed to check for -ENOTSUPP (old error code) or -EOPNOTSUPP (new error code), but this means that for drivers that were converted, the second condition is now true, and we stop falling through like we used to. Fix the error to check for neither error being neither -ENOTSUPP *nor* -EOPNOTSUPP. Fixes: cff49d58f57e ("spi: Unify error codes by replacing -ENOTSUPP with -EOPNOTSUPP") Reviewed-by: Michael Walle Reviewed-by: Pratyush Yadav Signed-off-by: Florian Fainelli Reviewed-by: Miquel Raynal Reviewed-by: Mika Westerberg Reviewed-by: Tudor Ambarus Link: https://msgid.link/r/20240313194530.3150446-1-florian.fainelli@broadcom.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index c9d6d42a88f55..17b8baf749e6a 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -382,7 +382,7 @@ int spi_mem_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) * read path) and expect the core to use the regular SPI * interface in other cases. */ - if (!ret || ret != -ENOTSUPP || ret != -EOPNOTSUPP) { + if (!ret || (ret != -ENOTSUPP && ret != -EOPNOTSUPP)) { spi_mem_add_op_stats(ctlr->pcpu_statistics, op, ret); spi_mem_add_op_stats(mem->spi->pcpu_statistics, op, ret); -- 2.43.0