Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5100709imm; Tue, 16 Oct 2018 05:18:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV61aIZ45oxJrVRiGJUWYOC4mKHAy/grKkiK+IrfahztcHvCG6LzqEJbLDnMZ1YQNwJsjyqR4 X-Received: by 2002:a63:70e:: with SMTP id 14-v6mr19856052pgh.70.1539692327931; Tue, 16 Oct 2018 05:18:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539692327; cv=none; d=google.com; s=arc-20160816; b=Me4NfIxQFkq4/P2igCC87M3SHkFNmB/tlpLRxYA8DrTVw/34/5F8X6ZBTn2xJvsb08 cUIK+PBwlx80AARITXZDHZIhEC+SsZ8mm0PmYxiYz62yj7p7b6zUj/Mmkw42CfP5Z5vo yj4poCYao72bffgx8sPQMH0opUa+EdoSfy38wt4BkTllI6/44b767T1RPmcaRX3swQjG eWsiUZF6JM8dgkBzfCo58E52nHvcPOA6JcVGV2AKfHYLudjrb1+uRnRh4qgZnVOtyM28 AJcRbk4991mkSgc1TcoSvaG0SN9Pi8yET3jWYUi3v3CwEIB+1u6tlQtlmYgwT5b0tduy E2oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=5P9DJddGU18mA46iJ7goqWsEx8sVNUr+qt3ijDDyKKk=; b=0NnqauAklrS6mr0ZxjHiLQ+7QsonGghr4NYI3seSOqhRE0xbvwMj+AV/nzaKyS6puS PNfNFVZYD0nB0ykKe6sMh4bAlMsgjzVuHEmjvaoNyJzD+SXXbSzxfkg5MvuUiSiG4Ftz rGdgiUHZmGt0k3y6iq5gS4lQFCYNv1n9NMWBq6oKsRauZjwxOAYXvagS4ZSnEciGYE2D h2s68qQDjHU8VwwIY8C7FNDwhn69qmO+bdnh0SwTiNLpW/qpsjccHq1SLhNhLpSagDPR jDInX8JS24r7VDf1y8pvvYy/V3r/GUnVZPIuH18Y6aMPurcokG3nP3U9bfcGrPrW1c9g HeYw== 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 p17-v6si13924354pgj.416.2018.10.16.05.18.32; Tue, 16 Oct 2018 05:18:47 -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 S1727164AbeJPUIU (ORCPT + 99 others); Tue, 16 Oct 2018 16:08:20 -0400 Received: from mail.bootlin.com ([62.4.15.54]:44704 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727032AbeJPUIT (ORCPT ); Tue, 16 Oct 2018 16:08:19 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id C26BE20794; Tue, 16 Oct 2018 14:18:03 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-7-245.w90-88.abo.wanadoo.fr [90.88.129.245]) by mail.bootlin.com (Postfix) with ESMTPSA id 632A6206A1; Tue, 16 Oct 2018 14:17:53 +0200 (CEST) Date: Tue, 16 Oct 2018 14:17:54 +0200 From: Boris Brezillon To: Yogesh Narayan Gaur Cc: Tudor Ambarus , "marek.vasut@gmail.com" , "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "richard@nod.at" , "linux-kernel@vger.kernel.org" , "nicolas.ferre@microchip.com" , "cyrille.pitchen@microchip.com" , "linux-mtd@lists.infradead.org" , "linux-arm-kernel@lists.infradead.org" , "Cristian.Birsan@microchip.com" Subject: Re: [PATCH v3 1/2] mtd: spi-nor: add support to non-uniform SFDP SPI NOR flash memories Message-ID: <20181016141754.38dfcf90@bbrezillon> In-Reply-To: <20181016140411.3f06e449@bbrezillon> References: <20180911154007.17195-1-tudor.ambarus@microchip.com> <20180911154007.17195-2-tudor.ambarus@microchip.com> <20181016140411.3f06e449@bbrezillon> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 16 Oct 2018 14:04:11 +0200 Boris Brezillon wrote: > On Tue, 16 Oct 2018 09:51:47 +0000 > Yogesh Narayan Gaur wrote: > > > Hi Tudor, > > > > This patch is breaking the 1-4-4 Read protocol for the spansion flash "s25fl512s". > > > > Without this patch read request command for Quad mode, 4-byte enable, is coming as 0xEC i.e. SPINOR_OP_READ_1_4_4_4B. > > But after applying this patch, read request command for Quad mode is coming as 0x6C i.e. SPINOR_OP_READ_1_1_4_4B. > > > > This flash also supports non-uniform erase. > > Can you please check and provide some suggestion? > > Are you sure the regression comes from this patch? I suspect your bug > comes from 41fe242979e4 ("mtd: spi-nor: fsl-quadspi: fix read error for > flash size larger than 16MB"). I guess you're testing with an fsl-qspi controller, right? Can you try with this patch? --->8--- diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c index 1ff3430f82c8..c47fe70c9f98 100644 --- a/drivers/mtd/spi-nor/fsl-quadspi.c +++ b/drivers/mtd/spi-nor/fsl-quadspi.c @@ -477,9 +477,6 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q) 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; case SPINOR_OP_WRDI: @@ -490,8 +487,6 @@ static int fsl_qspi_get_seqid(struct fsl_qspi *q, u8 cmd) return SEQID_SE; case SPINOR_OP_CHIP_ERASE: return SEQID_CHIP_ERASE; - case SPINOR_OP_PP: - return SEQID_PP; case SPINOR_OP_RDID: return SEQID_RDID; case SPINOR_OP_WRSR: @@ -503,7 +498,11 @@ static int fsl_qspi_get_seqid(struct fsl_qspi *q, u8 cmd) case SPINOR_OP_BRWR: return SEQID_BRWR; default: - if (cmd == q->nor[0].erase_opcode) + if (cmd == q->nor[0].read_opcode) + return SEQID_READ; + else if (cmd == q->nor[0].program_opcode) + return SEQID_PP; + else if (cmd == q->nor[0].erase_opcode) return SEQID_SE; dev_err(q->dev, "Unsupported cmd 0x%.2x\n", cmd); break;