From patchwork Mon Apr 28 03:53:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 4075141 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 50EA49F169 for ; Mon, 28 Apr 2014 05:08:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9499D20218 for ; Mon, 28 Apr 2014 05:08:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B4B202020E for ; Mon, 28 Apr 2014 05:08:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753257AbaD1FIP (ORCPT ); Mon, 28 Apr 2014 01:08:15 -0400 Received: from mail-by2lp0237.outbound.protection.outlook.com ([207.46.163.237]:16933 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753123AbaD1FIO (ORCPT ); Mon, 28 Apr 2014 01:08:14 -0400 Received: from BY2PR03CA030.namprd03.prod.outlook.com (10.242.234.151) by BY2PR03MB428.namprd03.prod.outlook.com (10.141.141.151) with Microsoft SMTP Server (TLS) id 15.0.921.12; Mon, 28 Apr 2014 04:52:07 +0000 Received: from BL2FFO11FD010.protection.gbl (2a01:111:f400:7c09::107) by BY2PR03CA030.outlook.office365.com (2a01:111:e400:2c2c::23) with Microsoft SMTP Server (TLS) id 15.0.929.12 via Frontend Transport; Mon, 28 Apr 2014 04:52:06 +0000 Received: from az84smr01.freescale.net (192.88.158.246) by BL2FFO11FD010.mail.protection.outlook.com (10.173.161.16) with Microsoft SMTP Server (TLS) id 15.0.929.8 via Frontend Transport; Mon, 28 Apr 2014 04:52:06 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s3S4pr3V009014; Sun, 27 Apr 2014 21:52:03 -0700 From: Huang Shijie To: CC: , , , , , , , Huang Shijie Subject: [PATCH v2 01/10] mtd: spi-nor: fix the wrong dummy value Date: Mon, 28 Apr 2014 11:53:38 +0800 Message-ID: <1398657227-20721-2-git-send-email-b32955@freescale.com> X-Mailer: git-send-email 1.7.2.rc3 In-Reply-To: <1398657227-20721-1-git-send-email-b32955@freescale.com> References: <1398657227-20721-1-git-send-email-b32955@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.246; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009001)(6009001)(428001)(189002)(199002)(92726001)(50466002)(48376002)(77096999)(87286001)(83072002)(99396002)(76176999)(77982001)(81542001)(74662001)(44976005)(36756003)(76482001)(46102001)(79102001)(87936001)(33646001)(74502001)(4396001)(62966002)(80022001)(19580405001)(85852003)(50226001)(6806004)(92566001)(77156001)(93916002)(47776003)(20776003)(19580395003)(81342001)(80976001)(31966008)(88136002)(83322001)(89996001)(42262001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB428; H:az84smr01.freescale.net; FPR:5C6E7458.4CF69709.6CC72B51.8CDAAA0A.201E2; MLV:sfv; PTR:gate-az5.freescale.com; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Forefront-PRVS: 01952C6E96 Received-SPF: None (: freescale.com does not designate permitted sender hosts) X-OriginatorOrg: freescale.com Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For the DDR Quad read, the dummy cycles maybe 3 or 6 which is less then 8. The dummy cycles is actually 8 for SPI fast/dual/quad read. This patch makes preparations for the DDR quad read, it fixes the wrong dummy value for both the spi-nor.c and m25p80.c. Signed-off-by: Huang Shijie Acked-by: Marek Vasut --- This ia actually v3. --- drivers/mtd/devices/m25p80.c | 5 ++++- drivers/mtd/spi-nor/spi-nor.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 1557d8f..3a1d9e0 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -128,9 +128,12 @@ static int m25p80_read(struct spi_nor *nor, loff_t from, size_t len, struct spi_device *spi = flash->spi; struct spi_transfer t[2]; struct spi_message m; - int dummy = nor->read_dummy; + unsigned int dummy = nor->read_dummy; int ret; + /* convert the dummy cycles to the number of bytes */ + dummy /= 8; + /* Wait till previous write/erase is done. */ ret = nor->wait_till_ready(nor); if (ret) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index f76f3fc..1a12f81 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -77,7 +77,7 @@ static inline int spi_nor_read_dummy_cycles(struct spi_nor *nor) case SPI_NOR_FAST: case SPI_NOR_DUAL: case SPI_NOR_QUAD: - return 1; + return 8; case SPI_NOR_NORMAL: return 0; }