Message ID | 20181125172853.20491-21-jagan@amarulasolutions.com |
---|---|
State | Accepted |
Delegated to: | Jagannadha Sutradharudu Teki |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="T0UL2Omr"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 432yKy5hbVz9s29 for <incoming@patchwork.ozlabs.org>; Mon, 26 Nov 2018 04:52:06 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 78E76C22027; Sun, 25 Nov 2018 17:44:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=KHOP_BIG_TO_CC, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SINGLE_HEADER_3K, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id AA61BC2224A; Sun, 25 Nov 2018 17:38:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1F733C22012; Sun, 25 Nov 2018 17:36:16 +0000 (UTC) Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by lists.denx.de (Postfix) with ESMTPS id 772B0C2200E for <u-boot@lists.denx.de>; Sun, 25 Nov 2018 17:36:15 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id 64so5406447pfr.9 for <u-boot@lists.denx.de>; Sun, 25 Nov 2018 09:36:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IgaR4FUCQnO0Df8jzFpeiy0ayqG5b2rwTivOAhw7crw=; b=T0UL2OmruLlS29oeampUkw5pZXIoqTizrcU4y8cl7Eeokb1PHLQVOOO50J7nbXzA9X EbQRDGBEsa9m/AFMLnF2pYiJsmgmeHOQQvt7YGss4Id3qzcs//UjprJUcwpC6bZH/TGK 1MVmm/c5pZdywOXlYvnqPaNEjj2GqUcox+fN8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IgaR4FUCQnO0Df8jzFpeiy0ayqG5b2rwTivOAhw7crw=; b=WFJH7TYbMmns+52/+NuPwOb6SE8TjnnpFZlzPWda4J3f8ps5tm/EURC2PKtCuNpv7E oymf/Nj3qK2BsZfc0foptATGH7MvvxWl32HYtu35PDqltzLHMI/R0ooXUcVwPI83a7V0 S5TxnrI36GigNjAYphtGzz4piZAKVsV2kcKaBsd/Bdp7JLN/Ge5yKdlKUGRcGhxNHVA5 dkKMIeer5KnqbqMLa0wqc9UwL6G07cIuL6Tx9qSVC9n4Y5pm4VMiHhTReHhiQKXLOCwO RfihKGQqOtEGJXhawLDM6fo15K/Dz5LSnUQ2Jg/g6BGWHFNMcbDSg4RE5LHfQ12KtBAf skPw== X-Gm-Message-State: AA+aEWb3rIXErBCQs+jKvizXR420Y81fac59K2hJt/S+RtnprJ9Ud9xV ULmvJh94fIOces5A3MmKd0ECLA== X-Google-Smtp-Source: AFSGD/Xyhp+4BzzqDyEtQspyGfK+aFWxLhBiYlaHMXsINZ8dGWe3OdWM/KZo3NtyNxycHjZrjYz8ow== X-Received: by 2002:a65:4784:: with SMTP id e4mr21024049pgs.12.1543167374085; Sun, 25 Nov 2018 09:36:14 -0800 (PST) Received: from localhost.localdomain ([115.97.190.86]) by smtp.gmail.com with ESMTPSA id k15sm16620785pfb.147.2018.11.25.09.35.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Nov 2018 09:36:13 -0800 (PST) From: Jagan Teki <jagan@amarulasolutions.com> To: Adam Ford <aford173@gmail.com>, Vitaly Andrianov <vitalya@ti.com>, Stefano Babic <sbabic@denx.de>, Peter Howard <phoward@gme.net.au>, Tom Rini <trini@konsulko.com>, Walter Schweizer <swwa@users.sourceforge.net>, Valentin Longchamp <valentin.longchamp@keymile.com>, Phil Sutter <phil@nwl.cc>, Stefan Roese <sr@denx.de>, Simon Glass <sjg@chromium.org>, Tuomas Tynkkynen <tuomas@tuxera.com>, Sam Protsenko <semen.protsenko@linaro.org>, Dirk Eibach <dirk.eibach@gdsys.cc>, Mario Six <mario.six@gdsys.cc>, Simon Guinot <simon.guinot@sequanux.org>, Konstantin Porotchkin <kostap@marvell.com>, Jason Cooper <u-boot@lakedaemon.net>, =?utf-8?q?Marek_Beh=C3=BAn?= <marek.behun@nic.cz>, Lokesh Vutla <lokeshvutla@ti.com>, "Andrew F . Davis" <afd@ti.com>, Uri Mashiach <uri.mashiach@compulab.co.il>, Heiko Schocher <hs@denx.de>, TsiChung Liew <Tsi-Chung.Liew@nxp.com>, Joe Hershberger <joe.hershberger@ni.com>, Angelo Dureghello <angelo@sysam.it>, Vladimir Zapolskiy <vz@mleia.com>, Albert ARIBAUD <albert.aribaud@3adev.fr>, Marek Vasut <marex@denx.de>, Fabio Estevam <fabio.estevam@nxp.com>, Nikita Kiryanov <nikita@compulab.co.il>, Lukasz Majewski <lukma@denx.de>, Markus Niebel <Markus.Niebel@tq-group.com>, Troy Kisky <troy.kisky@boundarydevices.com>, Akshay Bhat <akshaybhat@timesys.com>, Ken Lin <Ken.Lin@advantech.com.tw>, Peng Fan <peng.fan@nxp.com>, Magnus Lilja <lilja.magnus@gmail.com>, Christian Gmeiner <christian.gmeiner@gmail.com>, =?utf-8?q?Eric_B=C3=A9nard?= <eric@eukrea.com>, Ian Ray <ian.ray@ge.com>, Otavio Salvador <otavio@ossystems.com.br>, Andreas Geisreiter <ageisreiter@dh-electronics.de>, Ludwig Zenz <lzenz@dh-electronics.de>, Dmitry Lifshitz <lifshitz@compulab.co.il>, Roger Meier <r.meier@siemens.com>, Gilles Gameiro <gilles@gigadevices.com>, Lothar Felten <lothar.felten@gmail.com>, Tapani Utriainen <linuxfae@technexion.com>, Steve Sakoman <sakoman@gmail.com>, =?utf-8?q?Pali_Roh=C3=A1r?= <pali.rohar@gmail.com>, Marcin Niestroj <m.niestroj@grinn-global.com>, Nishanth Menon <nm@ti.com>, Lars Poeschel <poeschel@lemonage.de>, Enric Balletbo i Serra <eballetbo@gmail.com>, Yegor Yefremov <yegorslists@googlemail.com>, Ash Charles <ash@gumstix.com>, Grazvydas Ignotas <notasas@gmail.com>, Igor Grinberg <grinberg@compulab.co.il>, "Derald D . Woods" <woods.technical@gmail.com>, Hannes Schmelzer <hannes.schmelzer@br-automation.com>, Eugen Hristev <eugen.hristev@microchip.com>, Ludovic Desroches <ludovic.desroches@microchip.com>, Stelian Pop <stelian@popies.net>, Mateusz Kulikowski <mateusz.kulikowski@gmail.com>, Ilko Iliev <iliev@ronetix.at>, Daniel Gorsulowski <daniel.gorsulowski@esd.eu>, Ben Whitten <ben.whitten@lairdtech.com>, =?utf-8?q?Andreas_Bie=C3=9Fm?= =?utf-8?q?ann?= <andreas@biessmann.org>, Erik van Luijk <evanluijk@interact.nl>, Gregory CLEMENT <gregory.clement@free-electrons.com>, Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>, Sumit Garg <sumit.garg@nxp.com>, York Sun <york.sun@nxp.com>, Yinbo Zhu <yinbo.zhu@nxp.com>, Priyanka Jain <priyanka.jain@nxp.com>, Mingkai Hu <Mingkai.Hu@nxp.com>, Alison Wang <alison.wang@nxp.com>, Ashish Kumar <Ashish.Kumar@nxp.com>, Udit Agarwal <udit.agarwal@nxp.com>, Vinitha Pillai-B57223 <vinitha.pillai@nxp.com>, Feng Li <feng.li_2@nxp.com>, Qiang Zhao <qiang.zhao@nxp.com>, Naveen Burmi <naveen.burmi@nxp.com>, Shengzhou Liu <Shengzhou.Liu@nxp.com>, Ruchika Gupta <ruchika.gupta@nxp.com>, Poonam Aggrwal <poonam.aggrwal@nxp.com>, Timur Tabi <timur@tabi.org>, Xiaobo Xie <xiaobo.xie@nxp.com>, Po Liu <po.liu@nxp.com> Date: Sun, 25 Nov 2018 22:58:41 +0530 Message-Id: <20181125172853.20491-21-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181125172853.20491-1-jagan@amarulasolutions.com> References: <20181125172853.20491-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 25 Nov 2018 17:37:55 +0000 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 20/32] spi: mpc8xxx: Use get_timer X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <http://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> |
Series |
spi: DM_SPI migration timeout, remainder(2)
|
expand
|
diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index e09e91c8e9..63e1a150f8 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -112,9 +112,9 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, /* Handle data in 32-bit chunks */ while (num_blks--) { - int tm; u32 tmpdout = 0; uchar xfer_bitlen = (bitlen >= 32 ? 32 : bitlen); + ulong start; clrbits_be32(&spi->mode, SPI_MODE_EN); @@ -148,7 +148,8 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, * or time out (1 second = 1000 ms) * The NE event must be read and cleared first */ - for (tm = 0; tm < SPI_TIMEOUT; ++tm) { + start = get_timer(0); + do { u32 event = in_be32(&spi->event); bool have_ne = event & SPI_EV_NE; bool have_nf = event & SPI_EV_NF; @@ -173,9 +174,11 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, */ if (have_nf) break; - } - if (tm >= SPI_TIMEOUT) + mdelay(1); + } while (get_timer(start) < SPI_TIMEOUT); + + if (get_timer(start) >= SPI_TIMEOUT) debug("*** %s: Time out during SPI transfer\n", __func__);