Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp7199041imm; Tue, 28 Aug 2018 07:59:30 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbKHWeK4KOHYoyCK6fo8w8vD1QFcafj5f6l8AA2HvfGrC4n/tGhGx8O6Z81nwAM8DZ5l80v X-Received: by 2002:a63:6d4f:: with SMTP id i76-v6mr1905153pgc.215.1535468370182; Tue, 28 Aug 2018 07:59:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535468370; cv=none; d=google.com; s=arc-20160816; b=GCPcVkxOx7qDp+cQ0AsmA+/yGJ7m0tiJamd8VobMq6mRksTqRZR3IguPOST1wEBacz 0lDkkx0Mv0LHvYwcpmbX1FSJFSHiGh0BhfSGVFj7fJYzpDt2LkKQk002Pf9qwbEkxgYK fEvjgxAKGRlITZQ3i2sx7a4gLVhUHNoEgKUA6qTTTMgqLRgjwkA1uDuOBn6TDfgbq00Q RkKfZojXaXosnPUb0II4J9pRGyHZEhazSlHzagdt0SmV5rcJtkaYj0My9s5O1S2JM2Qj Nb2utQhL2ZQtN+Zox4J0jA1GetL4eDAz6VanjMLQGEWH4vLdRnuTayThln/VZ4q68j8T jr8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=rh0h0of7tkUJ1aEkMs/LGoliwIyMFGI19vn5up+ku6g=; b=vLMeUkhvzPZ2X85lXg1F73/R5S8wFKLorVzjgKSnLjtRZ105TxVXcNDGVvxDvVwD/U 22NakIepmn9IkxWgzch6e48cK7uR3uZA6avdb+1qoNU3NAoau2ig50So9Q93MpyUxBvs DWlEtjI8YE5S+yKCGIhAcrk6NgMLsV5LQVvEyu0Dk/4GNuyej52MG9E3pi/ydM/DafP9 oski46AExkPuzOEJCHyPqJXTVvlOEbRyVo5yKhvs+8n2oXCR/t2uRfkOdrulccPqqOQe g52CXQccp6Es98xwTr/r6MHXeGW+0sgsCLiaDsqDlqg+566EoB9PSlL36r0kr+CBc1hb vnZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v132-v6si1290867pgb.333.2018.08.28.07.59.14; Tue, 28 Aug 2018 07:59:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728566AbeH1Stz (ORCPT + 99 others); Tue, 28 Aug 2018 14:49:55 -0400 Received: from smtprz14.163.net ([106.3.154.247]:3578 "EHLO smtp.tom.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728373AbeH1Sty (ORCPT ); Tue, 28 Aug 2018 14:49:54 -0400 Received: from antispam1.tom.com (unknown [172.25.16.55]) by freemail01.tom.com (Postfix) with ESMTP id DD9E01C80E97 for ; Tue, 28 Aug 2018 22:33:07 +0800 (CST) Received: from antispam1.tom.com (antispam1.tom.com [127.0.0.1]) by antispam1.tom.com (Postfix) with ESMTP id 4D02E10013CE for ; Tue, 28 Aug 2018 22:33:06 +0800 (CST) X-Virus-Scanned: Debian amavisd-new at antispam1.tom.com Received: from antispam1.tom.com ([127.0.0.1]) by antispam1.tom.com (antispam1.tom.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RCfMejKKLN1b for ; Tue, 28 Aug 2018 22:33:05 +0800 (CST) Received: from localhost (unknown [110.184.152.116]) by antispam1.tom.com (Postfix) with ESMTPA id A483310012EE; Tue, 28 Aug 2018 22:33:04 +0800 (CST) From: Liu Xiang To: linux-mtd@lists.infradead.org Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, han.xu@nxp.com, marek.vasut@gmail.com, dwmw2@infradead.org, computersforpeace@gmail.com, boris.brezillon@bootlin.com, richard@nod.at, liuxiang_1999@126.com, Liu Xiang Subject: [PATCH v3] mtd: spi-nor: fsl-quadspi: fix read error for flash size larger than 16MB Date: Tue, 28 Aug 2018 22:32:57 +0800 Message-Id: <1535466777-3833-1-git-send-email-liu.xiang6@zte.com.cn> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the size of spi-nor flash is larger than 16MB, the read_opcode is set to SPINOR_OP_READ_1_1_4_4B, and fsl_qspi_get_seqid() will return -EINVAL when cmd is SPINOR_OP_READ_1_1_4_4B. This can cause read operation fail. Fixes: e46ecda764dc ("mtd: spi-nor: Add Freescale QuadSPI driver") Cc: Signed-off-by: Liu Xiang --- Changes in v3: move changelog position. drivers/mtd/spi-nor/fsl-quadspi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c index 7d9620c..64304a3 100644 --- a/drivers/mtd/spi-nor/fsl-quadspi.c +++ b/drivers/mtd/spi-nor/fsl-quadspi.c @@ -478,6 +478,7 @@ static int fsl_qspi_get_seqid(struct fsl_qspi *q, u8 cmd) { switch (cmd) { case SPINOR_OP_READ_1_1_4: + case SPINOR_OP_READ_1_1_4_4B: return SEQID_READ; case SPINOR_OP_WREN: return SEQID_WREN; -- 1.9.1