From patchwork Tue Jan 9 21:00:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Dasu X-Patchwork-Id: 186567 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp404722dyi; Tue, 9 Jan 2024 13:02:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/KTxmDPDS6RYrMWnTQ4mPg55sCJmvVzOSKVcNqu8pnG7qPheVz9vCg3RjCNygg+1Rq1N0 X-Received: by 2002:a05:6808:16a7:b0:3bc:8e1a:a4a with SMTP id bb39-20020a05680816a700b003bc8e1a0a4amr6295oib.36.1704834134454; Tue, 09 Jan 2024 13:02:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704834134; cv=none; d=google.com; s=arc-20160816; b=d/WxHejth4hWTzZJbrPjCFbAaE+Hgn3droBtnesF5lMPsVt0tysksHOXQUS/oBsl/O yNTl3rLr5ltLVEjLm4NBigH1FBOBkYV6NZV1SInsRNBvwS3z+crFZqGmdc1u61SRKyq2 h9v2nifk0qI7XpPdggNhOwMn7NzvIMvVwCM0wXdRwvmTdG7YK1fYipu9V7bjWiM1CsD4 pWKaNeM7cpoQOi1TsHUUPQGSMaN4REi8Rwv9d/zCE3HsN3sqCyiXD9OEFfZpZg9W9CeK jJ2ITut50VgNvLqv75FAX/wN4LUlD1chbFLs2NRLfyaNykLNYxdB1/3eLHn0QKPE4bQR XEpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature; bh=w/4xaf4v5JOG45tUqAyrf9IghSEzvGt0xnPb60u+2zw=; fh=WvY1ZCH04v9Y47tGSr9L79yZw+5UtYqU1uBb5t5VrH8=; b=WnTplPByRby8Y5jyISlLN9b/VjO2R2Cq8mGLrroNxDo5W6r2vbhdDPZni6cFA4uGPt 6tOqmjBZWlVaxVwLx0ggJHo11jJaPNecKTi17b9oHFPSPsP3n8gs/SUl8ZNUcDlVZ4eu 4Gic/kwYA1W9BWMd5vWdURu1AKpmRhtTOYoJmpjK4BYnw/e0cY7beDCpYYIFzicQGQoR fS0dKesHrhuJi8Flairh6Z/yRnHMBdO4wxsb3ujBSipuEASOgoLslNtLxZ0uVk1osVrm MElk8M2veN59LOwLrg+9uQZlq9drU3XPur3+IejE8ygPpLY4s5egdv6rT5ksLJ85PQRL We1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=OIUXGAlv; spf=pass (google.com: domain of linux-kernel+bounces-21404-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21404-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a10-20020a0cca8a000000b0067f7b1f8f34si3117766qvk.242.2024.01.09.13.02.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 13:02:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21404-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=OIUXGAlv; spf=pass (google.com: domain of linux-kernel+bounces-21404-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21404-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2F49E1C245F4 for ; Tue, 9 Jan 2024 21:02:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D6F413DB8F; Tue, 9 Jan 2024 21:02:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="OIUXGAlv" Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E96F3D993 for ; Tue, 9 Jan 2024 21:01:54 +0000 (UTC) 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: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6d9b5c4f332so1729560b3a.3 for ; Tue, 09 Jan 2024 13:01:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1704834114; x=1705438914; darn=vger.kernel.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w/4xaf4v5JOG45tUqAyrf9IghSEzvGt0xnPb60u+2zw=; b=OIUXGAlvXkrrUdJExOOTsIk1sIIJtSX6gTTDBA2i+OWdytS0Y/U/sMt6E5ONJBOnYh kmQoWzcs6qqJUwOe8LWzKZgRBV/XyoTEmPAEMoqhh3sJkkSS/W7BIP6W7O7hn5Oix0hE zF75kJEfvY7REp90vyZqbdUuKotZjSnFHnVm8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704834114; x=1705438914; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w/4xaf4v5JOG45tUqAyrf9IghSEzvGt0xnPb60u+2zw=; b=tg/OnmrJrvYGJS7wxQRwy4y6RWhHo94WVz1n5aQ/dUim+0eJTH2TCzrkJ98y7bF6Ta kk8mQpEpVawWp3F6SG0U9W7oODuWAHbYTK0tWXNiH8ywzghB5eLCaC/rOk3nhZwl5hSX GdIdaR+h3nqzSvc2qwQ2+KN2KarVhfrOGxYp81wUdCAEDRJdqBRzuqK5Y4z2bIdzrUmc 7RrYDEv9SpQ+SONDNzdeU0YsuaTs2LstSD5Jnr9r6q5kxpYNsuhHPZ4ZxRZBE1IdyNZA MiZV+nfTVRilX1os30f1lxTW87e/qGQpSgSU99cwvMlkvlIVkfp7g0IDLnVddHEEjjAx pV1g== X-Gm-Message-State: AOJu0YzbbhqwiUVlFbPczz8yo0bxwyuTpg4a52Q9mxLmwYKzPVPf1WWt iVSjH1OnI+ehemc0amUx5T98cewfyNI3 X-Received: by 2002:a05:6a00:3cc7:b0:6d9:a2de:c798 with SMTP id ln7-20020a056a003cc700b006d9a2dec798mr104851pfb.30.1704834114220; Tue, 09 Jan 2024 13:01:54 -0800 (PST) Received: from mail.broadcom.net ([192.19.144.250]) by smtp.gmail.com with ESMTPSA id y15-20020a62ce0f000000b006ce71af841bsm2191277pfg.4.2024.01.09.13.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 13:01:53 -0800 (PST) From: Kamal Dasu To: Kamal Dasu , Broadcom internal kernel review list , Mark Brown , Boris Brezillon Cc: Kamal Dasu , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] spi: bcm-qspi: fix SFDP BFPT read by usig mspi read Date: Tue, 9 Jan 2024 16:00:32 -0500 Message-Id: <20240109210033.43249-1-kamal.dasu@broadcom.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787648157400303006 X-GMAIL-MSGID: 1787648157400303006 SFDP read shall use the mspi reads when using the bcm_qspi_exec_mem_op() call. This fixes SFDP parameter page read failures seen with parts that now use SFDP protocol to read the basic flash parameter table. Fixes: 5f195ee7d830 ("spi: bcm-qspi: Implement the spi_mem interface") Signed-off-by: Kamal Dasu Tested-by: Florian Fainelli Reviewed-by: Florian Fainelli --- drivers/spi/spi-bcm-qspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c index ef08fcac2f6d..0407b91183ca 100644 --- a/drivers/spi/spi-bcm-qspi.c +++ b/drivers/spi/spi-bcm-qspi.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include "spi-bcm-qspi.h" @@ -1221,7 +1221,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem, /* non-aligned and very short transfers are handled by MSPI */ if (!IS_ALIGNED((uintptr_t)addr, 4) || !IS_ALIGNED((uintptr_t)buf, 4) || - len < 4) + len < 4 || op->cmd.opcode == SPINOR_OP_RDSFDP) mspi_read = true; if (!has_bspi(qspi) || mspi_read)