Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp3146222ybn; Fri, 27 Sep 2019 01:42:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpwIueKi8oOrYv3hHVjfFGlppfDYQHZQOXpYTLc5S8sBnZpOaRqmIsJ2E4rK39t0LR6rh0 X-Received: by 2002:a17:906:5fc4:: with SMTP id k4mr6880632ejv.300.1569573743890; Fri, 27 Sep 2019 01:42:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569573743; cv=none; d=google.com; s=arc-20160816; b=VrmkvJCuxktKOMR4jTxldNcXQ6GOGiUHS1wvaCsljyz34iqMEeoWvKjciRgzEcsCk0 Eb+lIMSyFPJ+cxgRsBeSpV27rQeyiY/uH7JHQVCWFSRSdjZD2ha4L/sx51vyH8UTy1ow /EEFKWxlM6ieWXuURaLlb4t66TD3AwZZzEF3vOgPqTgCwr5th9TVUoQSM5kNr+ljDzrd JoW4mhQRV3jF2vEd51VuYsaXfZE9nof7qYSdMWLojtCZ1FO3Iu2zc2Ru5u/wE6t5qtoj sB6WXaszZEgNlopmPyy8/mniewbO6ewq2hn3B+uSKfWItfxVXx2apt4KYbb/AjOJpBWx eBag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ZnBVDkeHvTsqDQAgJQMzlDa5Xv6ZM0OygDaLekmIECQ=; b=syE4jK8EDp8kovyei1UO8ea7AQvGxDisIbRVh5OY2Drcknrcby1EmwezlEy6+OqBo9 scw67HM5YKWwZ2TmsFpus0OCeMQqLg0F6SCkuEgwFU/RMZJjxg/d01evcSp3wTK41xB7 p4M0IXvV9+pu7oZlqfUXXPGfwimPCgjhVSf+pzeuJh7tkRiPAiHGrQs3ucFo1cAk1cUJ mBN4KiXW87j2G/FdJ/AXu4q9YXiW62+uQaWA4ExGRfmanH+qTQ3rNcfs9D+Rk0KJF9vO 9zutLhsgFQOLKbZoyeDLrTfu1Gh4rHSYqHSiEALShl4/1n7RPcXTGsdd2v3fxWPpZGSR JJAA== 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 z33si1210592edz.314.2019.09.27.01.41.58; Fri, 27 Sep 2019 01:42:23 -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 S1726027AbfI0Ili (ORCPT + 99 others); Fri, 27 Sep 2019 04:41:38 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:37327 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbfI0Ilh (ORCPT ); Fri, 27 Sep 2019 04:41:37 -0400 X-Originating-IP: 65.39.69.237 Received: from localhost (unknown [65.39.69.237]) (Authenticated sender: repk@triplefau.lt) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id B7CF2FF80F; Fri, 27 Sep 2019 08:41:34 +0000 (UTC) Date: Fri, 27 Sep 2019 10:50:00 +0200 From: Remi Pommarel To: Thomas Petazzoni Cc: Lorenzo Pieralisi , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] PCI: aardvark: Don't rely on jiffies while holding spinlock Message-ID: <20190927084959.GC1208@voidbox.localdomain> References: <20190927083142.8571-1-repk@triplefau.lt> <20190927103420.48bb9335@windsurf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190927103420.48bb9335@windsurf> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, On Fri, Sep 27, 2019 at 10:34:20AM +0200, Thomas Petazzoni wrote: > Hello Remi, > > Thanks for the new iteration! > > On Fri, 27 Sep 2019 10:31:42 +0200 > Remi Pommarel wrote: > > > diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c > > index fc0fe4d4de49..ee05ccb2b686 100644 > > --- a/drivers/pci/controller/pci-aardvark.c > > +++ b/drivers/pci/controller/pci-aardvark.c > > @@ -175,7 +175,8 @@ > > (PCIE_CONF_BUS(bus) | PCIE_CONF_DEV(PCI_SLOT(devfn)) | \ > > PCIE_CONF_FUNC(PCI_FUNC(devfn)) | PCIE_CONF_REG(where)) > > > > -#define PIO_TIMEOUT_MS 1 > > +#define PIO_RETRY_CNT 10 > > +#define PIO_RETRY_DELAY 2 /* 2 us*/ > > So this changes the timeout from 1ms to just 20us, a division by 50 > from the previous timeout value. From my measurements, it could > sometime take up to 6us from a single PIO read operation to complete, > which is getting close to the 20us timeout. > > Shouldn't PIO_RETRY_CNT be kept at 500, so that we keep using a 1ms > timeout ? Damn. You right of course, sorry about that. Thanks -- Remi