Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753983AbbF3PFV (ORCPT ); Tue, 30 Jun 2015 11:05:21 -0400 Received: from mail-ie0-f182.google.com ([209.85.223.182]:35085 "EHLO mail-ie0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752797AbbF3PFP (ORCPT ); Tue, 30 Jun 2015 11:05:15 -0400 MIME-Version: 1.0 In-Reply-To: <1435663042-25425-1-git-send-email-mike.looijmans@topic.nl> References: <1435663042-25425-1-git-send-email-mike.looijmans@topic.nl> Date: Tue, 30 Jun 2015 20:35:15 +0530 Message-ID: Subject: Re: [PATCH] mtd: spi-nor: Only set Micron quad-read mode when controller in 4-lane TX mode From: Shubhrajyoti Datta To: Mike Looijmans Cc: linux-mtd@lists.infradead.org, git@xilinx.com, Linux Kernel Mailing List , beanhuo@micron.com, David Woodhouse , computersforpeace@gmail.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2178 Lines: 49 On Tue, Jun 30, 2015 at 4:47 PM, Mike Looijmans wrote: > Micron QUAD mode expects command, address and data on 4 lanes instead of just > one for command (extended SPI mode). This requires the controller to be in a > special mode, so check first if the controller could be in that mode. If a > controller does not have the SPI_TX_QUAD mode set, this setting has no chance > of being valid at all, so don't try to enable it then, and just keep using > the extended SPI mode. > > Tested on a Zynq 7000 with a n25q256a flash chip, this failed to function > because of the introduction of: > "driver:mtd:spi-nor: Add quad I/O support for Micron spi nor" > This commit sets QUAD mode for most Micron chips without asking the controller > whether it's possible to do so, and without telling the controller that a > different mode is required, so it couldn't work. > > Signed-off-by: Mike Looijmans > --- > drivers/mtd/spi-nor/spi-nor.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c > index e8f6131..10ba94f 100644 > --- a/drivers/mtd/spi-nor/spi-nor.c > +++ b/drivers/mtd/spi-nor/spi-nor.c > @@ -1398,6 +1398,8 @@ static int set_quad_mode(struct spi_nor *nor, struct flash_info *info) > } > return status; > case CFI_MFR_ST: > + if (!(nor->spi->mode & SPI_TX_QUAD)) > + return 0; Should we return 0 ? > status = micron_quad_enable(nor); > if (status) { > dev_err(nor->dev, "Micron quad-read not enabled\n"); > -- > 1.9.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/