Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1954392lql; Wed, 13 Mar 2024 12:56:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWNspudpYmqjNMJP2jMGscNBKHgj7aTjcCYlZKyjDBUub/YVEc+eA0QjRgjcbT7kBs4+iFCgE1xtlCPSch7/jn9pwjvcW+svWIm6+Ev5g== X-Google-Smtp-Source: AGHT+IGf+yPN1pVCa6DuUgc3dMraPc4lrHA4zw1GJ/CbV40/xeEXLD3F86QJ33rlEH8p6Aty06ur X-Received: by 2002:a05:6a00:2190:b0:6e6:4e28:6e6e with SMTP id h16-20020a056a00219000b006e64e286e6emr4291238pfi.2.1710359813229; Wed, 13 Mar 2024 12:56:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710359813; cv=pass; d=google.com; s=arc-20160816; b=UbnWGimmv7O4wGSpBjb88Uu9ECHnBDIwWINI0gYuhjSF05ioJ9+t77UAvfKUwaDJjv Kaw9E4hcaHi5fiby5OvEi1a8IEMKhTmiiNHQzj1tGO15U1eCT1toW6c/YX53n36nfr09 nWDtNwiqzqK/gIzkORlFyn4Jtt9B6Was62aMSgcrgFZh950AcYI5JN3eLDNSAPKFwvvt gHaeXh8CmTpuRhhzZjXNYqY93EOT6gmy6X0LzUKy3UkHRlg7dtuLHP74mo2JC4k9irTe uT9rESr4A9Tj0xF18T5vGXonerAdPHnseZ6U91WkMNUN/7LnM+ZO++EQ4Rtzm/H22qZG OluA== 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:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter; bh=pIGAd2rqYtQxxsIXtgBq5nnVzrOF7adYldqVqitSDZ8=; fh=sT0uOVwZlj92XLsM5iKbNG1sIWOKJZ9+WUOGHJJN/lw=; b=sMuF+1q5FtXJ6qIzOr1y78XwyNZDmF05y1+jatMe0V7qk+njf0t85rsSjplzKI4dYa Z9PZZqJYuz3omGMqtoeBei2Wx+NZ8Cf2JX0/7vWvu/Ted3puRkxwAXoSc50z1p97H0GP FuYMbx5Sver5HCftg3gMObodB1rKWrKW6H59ZclM3dPDLv89mE67rYBSO2NQn6u9N3iu dXs27NBggKkZYpHYOkATOLD0yfeVm0oHUV7dIMCk+PUyHO+RKx6xD0T/AD1tNpabaFJ9 lWcRV/s5guP8j/0/JdBEvsoM6/eWA9FeokS3HdhKjLySU7mDZJtVbLmO6iePq6Bs/WVK SAFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=tUta5kxe; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-102457-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102457-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id fi37-20020a056a0039a500b006e6a93e7a29si3612680pfb.102.2024.03.13.12.56.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 12:56:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102457-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=tUta5kxe; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-102457-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102457-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E583A285B21 for ; Wed, 13 Mar 2024 19:56:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4DE224CB38; Wed, 13 Mar 2024 19:56:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="tUta5kxe" Received: from relay.smtp-ext1.broadcom.com (unknown [192.19.166.228]) (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 EA8C54C60C; Wed, 13 Mar 2024 19:56:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.19.166.228 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710359806; cv=none; b=X1P9VhLca9MbnG9FFY/ORwEZCjDo45lfPtWWvShbq830FqmSIlo/BwTI2acqMZShzYjpOzeCV32Io14Blveg7NYhR554/e4vt4EShRAJWFVn71YDt2HST78szUFJdGtEF2MRThUvk4MtEiP116bLW5LVEKvtcxL5hLxpqYBiOX8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710359806; c=relaxed/simple; bh=3BD4gGhAqghzw6gpQVHVO4yadhEZRKKYCsiViAsbDhM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=S3vKyZuAjoEgrbf5okDH+g5Cr9ACQwBNbctJ4tL1D12K2Xw9CdsjE4dFQNDKpzIpFdvQnNzU4vvWaK4oSQEhMqnb3Haua+/5EY78b5EYGXnGaH7EOGHCUUQ0c7zzEhK1I12MB/GRMwNT1jXQdDjWoDqgSXW1M/okrb8fyQUKY8Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=tUta5kxe; arc=none smtp.client-ip=192.19.166.228 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Received: from mail-lvn-it-01.lvn.broadcom.net (mail-lvn-it-01.lvn.broadcom.net [10.36.132.253]) by relay.smtp-ext1.broadcom.com (Postfix) with ESMTP id C325CC0029DF; Wed, 13 Mar 2024 12:46:51 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext1.broadcom.com C325CC0029DF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1710359211; bh=3BD4gGhAqghzw6gpQVHVO4yadhEZRKKYCsiViAsbDhM=; h=From:To:Cc:Subject:Date:From; b=tUta5kxe1gtE33JzJgGyTd5oeSmmxvUFDJwjpG12tNxx+xEM433oOsW88mKXz/bGq s8Ehaqk8Ijf3J4guH05GXDrZgV2bCWgDDTqU0P87YRyI16jJoKEoPVwGQdm7w9IVSz PMvjprG9LlKjJX7IbSjVInpl2qmeeRsfkGfzDZXQ= Received: from fainelli-desktop.igp.broadcom.net (fainelli-desktop.dhcp.broadcom.net [10.67.48.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail-lvn-it-01.lvn.broadcom.net (Postfix) with ESMTPSA id 2521C18041CAC4; Wed, 13 Mar 2024 12:46:50 -0700 (PDT) From: Florian Fainelli To: linux-spi@vger.kernel.org Cc: Florian Fainelli , Michael Walle , Pratyush Yadav , Mark Brown , Michael Walle , "Chia-Lin Kao (AceLan)" , Mika Westerberg , Miquel Raynal , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2] spi: Fix error code checking in spi_mem_exec_op() Date: Wed, 13 Mar 2024 12:45:30 -0700 Message-Id: <20240313194530.3150446-1-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- Changes in v2: - collected R-by tags from Michael and Pratyush - rebased against spi/for-next 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 c9d6d42a88f5..17b8baf749e6 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.34.1