Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1920368lql; Wed, 13 Mar 2024 11:52:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXzXlBrg/gdzEQCSza3oSI+BRQkRAcsZNdZHXh0lKdGYghkK9ivpW52xgg2cNZo1c0q2tN+CrwkAqM8vSV+tq5NM3u0qBRvBIIH+vuoxA== X-Google-Smtp-Source: AGHT+IE/IS9+ayCCaRZQ6h1z1wzX1dOgc0UKv5931hvemd5IV83MCnK1Ye3PJO3bCfC1CkhKnnA1 X-Received: by 2002:a19:7715:0:b0:513:a2b1:6291 with SMTP id s21-20020a197715000000b00513a2b16291mr7175663lfc.7.1710355959284; Wed, 13 Mar 2024 11:52:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710355959; cv=pass; d=google.com; s=arc-20160816; b=HDJiPj30ccPSZ71G9H7UUBom33+VAr/gPksd5TPW07uExQOMcZRBVmIMSJnCccj0eM ct+LOhIVvgWzsk7Lx3lx11UfRed0a865jLwM3TwoxH8BOVcGaw7gLhhoarO7JwQRDNT0 Ut7BwQLsdTCndAnNPcBn2j9/5tfCJMfTCgaEIw5OqcVqx/lxD1AWK9HnBFWEmNDB43h0 UWETysiRMrMM6CkahKq6wQvXiCsPJOhW3dNm9wRNAhgUFsjsokIxlQ3jXmADgUNHVKPP T/VpPQJPN4SHR7UxxxXE5SlNaTJ2agX0zDq0kC04LiGuqIRE4N7N41yRkEKwBhBuwvtQ Q9dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:cc:subject:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence; bh=RVdVRdgXuGM0z2PQOIi96GjOoDN6HMo/fKf4miMmIMc=; fh=CaAQddTqklVeUWBfoyfXYmP0T82wzPLXW0P5PHtwjKg=; b=svw+4JrTq9B6zhLA7t3NjW8pt/wYHg5w7RywX40SgHU4hANko9smu2R6iIl47YhD+4 gkNPnWEubmEvkneQMW5w6XiWSyA1LPglLBUdZCtyYDPJrRzX1z9hIIRBG/Ax4/w4pBjc 72dlC5vPeW6RR3YreglyueW+5XYWN+Y/n2u/WgOA72qFFktljzCJ1gyfCDmD1LA1Yo/I RuzJ3qu+QG9Qyr4fQLTTW7ZQWGRVDgY62UB5PXD4iDQ6ksRVCWQV3tQLOOsvNnh85Qhj adRhkqeOHMTZr3px4wc7wvQSD+e2jZgXPVkiwnKGcw4OiubK+SRuCc4F3jEZ9rh37vU/ xZTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=walle.cc); spf=pass (google.com: domain of linux-kernel+bounces-102271-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102271-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. [147.75.80.249]) by mx.google.com with ESMTPS id di22-20020a170906731600b00a45ad08475asi4941407ejc.78.2024.03.13.11.52.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 11:52:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102271-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=walle.cc); spf=pass (google.com: domain of linux-kernel+bounces-102271-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102271-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 9A3981F22DF5 for ; Wed, 13 Mar 2024 18:42:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8704E12B151; Wed, 13 Mar 2024 17:33:49 +0000 (UTC) Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) (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 27CF812AACA; Wed, 13 Mar 2024 17:33:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.201.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710351229; cv=none; b=V0oK+khyf3Y/PkMppEavlp8EIFnHQXLbrqtBXvreV2WeI8fGKmWXf6/hZhMYtfiDhsyWfCqY/jbepUjWyPIds4VjTNma5JX8E53Gy2PrR3xYXdHQoBbRLDIJvgavhs9cIqcR0ZMfPgTuTAi99nF51KDTSLw3EFO1Cbeo5y1fXcs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710351229; c=relaxed/simple; bh=CfE1Qa7B1pDeJJVcPNq/eHR71qDGkenzEfw4ps12Zd4=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:From:To: References:In-Reply-To; b=k4M2Klp7FhlbvgpHCNthAbe/QKjQxAsy1EWPbD/3kV7hnxQ2aWVMxWblM2EHVxNMeUEimhtsXnaDCjqukqw8tvpWk3Pa9VrZCX/9p0DIZgUQK5n02NP1dv65OEt1V0Cn+yA0wUg3bzzYSEMRF6zj4NfFEX/XyqmIMT1xayqMBZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=walle.cc; arc=none smtp.client-ip=159.69.201.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=walle.cc Received: from localhost (unknown [IPv6:2a02:810b:4340:6430:4685:ff:fe12:5967]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id 3D3685E6; Wed, 13 Mar 2024 18:33:44 +0100 (CET) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 13 Mar 2024 18:33:43 +0100 Message-Id: Subject: Re: [PATCH] spi: Fix error code checking in spi_mem_exec_op() Cc: "Mark Brown" , "Miquel Raynal" , "Mika Westerberg" , "Chia-Lin Kao (AceLan)" , "open list" From: "Michael Walle" To: "Florian Fainelli" , X-Mailer: aerc 0.16.0 References: <20240313171050.3505620-1-florian.fainelli@broadcom.com> In-Reply-To: <20240313171050.3505620-1-florian.fainelli@broadcom.com> On Wed Mar 13, 2024 at 6:10 PM CET, Florian Fainelli wrote: > 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") > Signed-off-by: Florian Fainelli > Change-Id: I4159811f6c582c4de2143382473d2000b8755872 Ha, thank you! Reviewed-by: Michael Walle FWIW in next, there is commit e63aef9c9121e ("spi: spi-mem: add statistics support to ->exec_op() calls") that probably will conflict with this one. Also, - not for this patch - but with that logic, spi_mem_exec_op() might return EOPNOTSUPP *or* ENOTSUPP, even for drivers which might still return ENOTSUPP, because there is one condition in spi_mem_exec_op() which will always return EOPNOTSUPP. That is somewhat confusing, no? -michael