Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp7096244imm; Tue, 28 Aug 2018 06:24:07 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZLkEjPaeilFyc0HkrxFP8GpwzELNo8TxAInDEhHYn/Ui903rmIqzfPBgkHKryUUQMLqNUC X-Received: by 2002:a63:2f45:: with SMTP id v66-v6mr1545205pgv.91.1535462647438; Tue, 28 Aug 2018 06:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535462647; cv=none; d=google.com; s=arc-20160816; b=ksRpsLo8UyKvnpu8Yth/ymkzlpcpAoi5icDGMKlwXz2dsv1KmxAH4pKtXQG+XREbjz 3JMyjh0pWzwRJc0XtiGczRcXjS6o84fxniENbncuDjCmcMjuI4lJn9qKMwMhqyX/aiVJ uRFwLoDLxeJnX1JNORumCZudAg+g+FW/HedawFyYJCWyI+iuDGDTNMCOm6fMOoAlrzce zGHac3Rl6jonVR2c/Rum1TdrubzH+XKa0HDxxECntfwn355da083TuU90UTPCVwlnuy2 eUyrgfLJlf9g20sdFXueasWst3Jka8jkNU8n3iZYsulUSJWI2uhkd77YNiOeNAadxK1o vZzQ== 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=r05MjqiPGVAGcKJLf4Q1BmRBBYmkJ3VZo2r4ke8Clgw=; b=rr0Sr0PuoOPYbBeEtzUDrAk1I24xS7TXZKury7Vu4z6VYoyRaI1CAwjbLX+Q1fynPn pORlqJiPOcDUkk1qpM50IsYLaao6gUmSo4C3/xPnqngXHKBFBrhEsc+/1Hy713s/MK8h BiuaiWAUI+hwuW7GvrbD4ZMmuUL9dqR81P5adGOD9lzpM7XXWE4AJbn8vM5ZQBNMFCOe qYZGbWo6gRBe3LkhYhGNWUCp4m+DwqPXo5wsBARm/GigJz/dXRREk/LY3t8V3Rpg4fGu bnZz9wD6CNfT85LQt5ZrRQ/kuHiPgj3BLYRG3XaMXO2bTKZnMAy1nHx4KyMb53WwsHfv EASQ== 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 t21-v6si1033401plj.261.2018.08.28.06.23.51; Tue, 28 Aug 2018 06:24:07 -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 S1728164AbeH1RNR (ORCPT + 99 others); Tue, 28 Aug 2018 13:13:17 -0400 Received: from smtprz15.163.net ([106.3.154.248]:63521 "EHLO smtp.tom.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728142AbeH1RNR (ORCPT ); Tue, 28 Aug 2018 13:13:17 -0400 Received: from antispam1.tom.com (unknown [172.25.16.55]) by freemail01.tom.com (Postfix) with ESMTP id 861901C80E2C for ; Tue, 28 Aug 2018 21:21:22 +0800 (CST) Received: from antispam1.tom.com (antispam1.tom.com [127.0.0.1]) by antispam1.tom.com (Postfix) with ESMTP id 842AD1001349 for ; Tue, 28 Aug 2018 21:21:22 +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 CM8JIxksNRtJ for ; Tue, 28 Aug 2018 21:21:21 +0800 (CST) Received: from localhost (unknown [110.184.152.116]) by antispam1.tom.com (Postfix) with ESMTPA id DF82F10012D0; Tue, 28 Aug 2018 21:21:20 +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 v2] mtd: spi-nor: fsl-quadspi: fix read error for flash size larger than 16MB Date: Tue, 28 Aug 2018 21:21:16 +0800 Message-Id: <1535462476-3540-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. --- v2: add Fixes tag and CC stable suggested by Boris. --- Fixes: e46ecda764dc ("mtd: spi-nor: Add Freescale QuadSPI driver") Cc: 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