Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1704056imm; Sat, 18 Aug 2018 02:40:39 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxsycrpUwVysaBfrm9JSXZ6QahCFgk2rbMgwNOWvCjMKCSjjs5cdf89+jZACcnzDIAeTbKq X-Received: by 2002:a17:902:5981:: with SMTP id p1-v6mr3551815pli.333.1534585239921; Sat, 18 Aug 2018 02:40:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534585239; cv=none; d=google.com; s=arc-20160816; b=Q4t5r7Q5QabI/H7ESy5gLdGg+6mqdHgk9kL1HvWHyNq2h7sJ+/c9hcruArv0fEoX1/ 2CP+zVPYBg8s+1jLvjbq60rZdHeoH52p/RBxFb/UDjayWR9Cmmz7wYXaqSyjNH1//CjA T50CxQYIGBSuVfZpXMIa9Z+7w/N3M+JOqao15MQZmb7X/xSgH9Of0dMhIBAcOZrnAlpK QnbuWZZK3u4wstR+SqSgKK+5g5bwins/5f0YpKxCe9aCgDHElutIspcsHeOmsVpnyPH/ oMEAZEZJG4QvRsHOJdJNLwTDqGaB94lEFfdZYb2QNXql005MTz50zPfMOaikR9X7K4Ml 303w== 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=Y2DhkGF5d7gWoXn/mLqh8/nXRZH4oBs+F77ET2aIQBc=; b=uXcthwY09l35QGDOI/+M3HJzc5TC+J5QY4LekgblsHTlG+05/N+C5/O9QkstHjys9W P01Jhq/bUAKtSNQ346POLBUD2tM+Opfg5YazQRoJ1bb3au39ZnHt5B0olLfqymyb5tZv rUC5Y0y1rstBftW7YGJT+0xZl9u3FNZknTaB2vLOtMXJwUSlsFMuIddtVOXFxPgtMXG3 4ZDX+0+NvAClpPVTdY1u5hOhr/LJcqjBd+5ov7th9FSyNrLPF7KB8RHCbuajtCXuZqzD wJUbZOtACRLj1s5MJ65bYC9b3njuhCeJY7a8c/HsKufeRvB8CsX05W+PIqungMndSQan sFUg== 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 t1-v6si4429145pfb.208.2018.08.18.02.40.22; Sat, 18 Aug 2018 02:40:39 -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 S1726480AbeHRMqO (ORCPT + 99 others); Sat, 18 Aug 2018 08:46:14 -0400 Received: from smtprz15.163.net ([106.3.154.248]:21697 "EHLO smtp.tom.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726095AbeHRMqN (ORCPT ); Sat, 18 Aug 2018 08:46:13 -0400 Received: from antispam2.tom.com (unknown [172.25.16.56]) by freemail02.tom.com (Postfix) with ESMTP id 6744DB00D44 for ; Sat, 18 Aug 2018 17:14:31 +0800 (CST) Received: from antispam2.tom.com (antispam2.tom.com [127.0.0.1]) by antispam2.tom.com (Postfix) with ESMTP id 8D5AB81397 for ; Sat, 18 Aug 2018 17:14:30 +0800 (CST) X-Virus-Scanned: Debian amavisd-new at antispam2.tom.com Received: from antispam2.tom.com ([127.0.0.1]) by antispam2.tom.com (antispam2.tom.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DfKv496tZyKl for ; Sat, 18 Aug 2018 17:14:29 +0800 (CST) Received: from localhost (unknown [222.209.17.135]) by antispam2.tom.com (Postfix) with ESMTPA id 18EDD81258; Sat, 18 Aug 2018 17:14:29 +0800 (CST) From: Liu Xiang To: linux-mtd@lists.infradead.org Cc: linux-kernel@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] mtd: spi-nor: fsl-quadspi: fix read error for flash size larger than 16MB Date: Sat, 18 Aug 2018 17:14:23 +0800 Message-Id: <1534583663-2842-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. Signed-off-by: Liu Xiang --- 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