From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755279AbcBBX22 (ORCPT ); Tue, 2 Feb 2016 18:28:28 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:58860 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754186AbcBBX2Z (ORCPT ); Tue, 2 Feb 2016 18:28:25 -0500 From: Arnd Bergmann To: Bjorn Helgaas Cc: Joao Pinto , Vineet.Gupta1@synopsys.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, CARLOS.PALMINHA@synopsys.com, Alexey.Brodkin@synopsys.com, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org Subject: Re: [PATCH v7 2/2] add new platform driver for PCI RC Date: Wed, 03 Feb 2016 00:27:46 +0100 Message-ID: <727234287.1RWoeYxhOH@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20160202231449.GA18009@localhost> References: <8223655.W63T0XOVm1@wuerfel> <20160202231449.GA18009@localhost> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:QWkb4jnITADq0gagYb4jv3wlJuFRtUnCOUpgEMfbGlw4B+L9avZ 8RWGPkNOLy2HWJCo7b18eusjgaztESJiZuqj+b01QOPS2zYdNDih8YZsZ93OYA+OkkOkQpV 6RGFLgiJu4viEMPmYPoXu0jfuiBeiGElROJnf0Sek2ww6rEJpCtx07ipvxxy3pzLT1Nf8Ev SjiDNvEhslIPxwj1VUnzQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:sAoKlmwChdY=:fa16r0ePpoBoqiF+iH4RgM DyBZwaDCEWWk907Hamw0H/7KtlZdUQhhuU3BXcB3d3gO4XRHiio4t+pjZ1OGFkLQCxikpCKWl 02DhBQZk+9bXi/hLU02yUaauSZDKECbZAQN9gVXpLOXKopUy3AdZUgHBrtb/6txTIQEKEsRE+ Hn0MgPSZGbxK1/YGyQ9CuEfAHTTpA9/UmHHH5Yp2+OCifChMxotf8QE8qti0fT9SW5Rg5x439 ResMuK6818/bq6W1j2WGfz7wuBiSSuzljXcTrPxhxrFijaCtpN9u5d3ojf9GHJmBHO3tIL/vU 18yZ7XaPHbV1FNeSzzNlhgKhugtg00kjkqsedHGt0avSt5Re/Zg4HEG9eyjir/LDzgGvYtQY5 SJlkDwN5+aKaAxRIOiOsafqXBuza/pm99L6xORFfJbl+gP79xWH/liLX1+EqH4TtCN1McGUmR arqy93/Juq4K/Kne4p8NNdWVZi/k1eklh0OtS5S3UV1KoTt7I/iv5ReqQEWNSKBec5oa9fnd0 dNY4nxuLRLybxoJ2qeQ8QT1H+9o60PtD4G0PpeyqyLtWIAzHuWLb7+OxpeCafBlgV+CCYg5xr zxW/6mYoFgA48fBk68/DaTAA2jQOmZ+WYFW7mcTDgla10gTfpek/leUdFNQwrYWJtwPHwe/1x vlp8XGJUgMxvhsoZDlzVUYO7PCAI4Ch2rG/MASGy6gTbdh+qPEKHgb85cDHFm/4swfQX5dFM9 Z8+QR1Zf5X+bFWLh Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 02 February 2016 17:14:49 Bjorn Helgaas wrote: > On Tue, Feb 02, 2016 at 09:25:25PM +0100, Arnd Bergmann wrote: > > On Monday 01 February 2016 18:07:45 Joao Pinto wrote: > > > +static void synopsys_pcie_establish_link(struct pcie_port *pp) > > > +{ > > > + int retries = 0; > > > + > > > + /* check if the link is up or not */ > > > + for (retries = 0; retries < 10; retries++) { > > > + if (dw_pcie_link_up(pp)) { > > > + dev_info(pp->dev, "Link up\n"); > > > + return; > > > + } > > > + mdelay(100); > > > + } > > > +} > > > > That mdelay() needs to be an msleep(). You should never waste > > a whole second worth of CPU time in a driver. > > There are six other copies of this code, and two of them (exynos and > spear) have the same problem. Good point. Maybe move one (correct) copy into the main driver file and have it called by the other drivers? IIRC there were some problems in drivers that did a similar function from the config space accessors where you cannot call msleep(), but this driver is not one of them. Arnd