Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp3140572ybn; Fri, 27 Sep 2019 01:35:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyu8rvLOJoVi/sphBWnUfZJCEO0v+YpvseE2GDfjP9OP2a5I2YYao91lTaiVln4U83vRJb X-Received: by 2002:a17:906:4b07:: with SMTP id y7mr6724711eju.126.1569573301272; Fri, 27 Sep 2019 01:35:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569573301; cv=none; d=google.com; s=arc-20160816; b=HjpXwSWLJOajATdc6UZrvoq45ZOpAfeWBmSq/fL9LYJPx6ZW+mmmxpr3MggsF7GNo3 P3q72Y0ZYTFhfKsEOo3EujkLeStmdi+hIgyYHanLhCuM3jBgA8YE7MRXElu0SKgxBaOl SJD/kvmUmeuskRlo3TpcsFteQr2Q5OVA9P6xCkReYXjh97AnTbVzNMF3Ad/sPgDOUkKS SWvrL7I7E3M6KKKK1K2LXr6A5PQQaiBj4opuDn9LDETDV32X+BtwEtmGfqdJMQH3spiC ElFKAL4IwiV/S0uvRvBRv8TggVNlyBfTENigEz65SlQ/56xPEBTwjwXsuHrd8x8YZikk RtsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=kGBn2AWBSX3OUHBxKYoeuYJWbuqB6vwd7CEBv3KygPk=; b=OD7FmqH6vXNYq8bMi6xPQHlqFWa60vNufF1RgAe7duCwprBf6laiyWZo7i1PLs+y9h HYmP2FGphyxdV8RswFT79CmGj39D6VhAzKvgi7RYPJfq0fMbzlSMEQQ2GS5kCS+bw9zL koPv6xXqIJb6dZ4s22nMlvgfRdTj8js8j9fjM+TM8rmvcmRvCjvqOO3O+c7CPdMKD7Me tlMDsRUV8KmnqkjhcxMsEvg9T60KeQ+nK80JVNeEF7ruoZfLadrzzhYp5/fGt+xstKA1 WG4Og7UA3A1Yh5WjSR7WfL3z4syNwQuMAefyCIbdGQOBfubGxcfmiD3dMl+0RWyT/cmo CD2w== 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 v3si1042572edc.404.2019.09.27.01.34.36; Fri, 27 Sep 2019 01:35:01 -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 S1726284AbfI0IeY (ORCPT + 99 others); Fri, 27 Sep 2019 04:34:24 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:47353 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725911AbfI0IeX (ORCPT ); Fri, 27 Sep 2019 04:34:23 -0400 X-Originating-IP: 86.250.200.211 Received: from windsurf (lfbn-1-17395-211.w86-250.abo.wanadoo.fr [86.250.200.211]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 9C4DA24000C; Fri, 27 Sep 2019 08:34:21 +0000 (UTC) Date: Fri, 27 Sep 2019 10:34:20 +0200 From: Thomas Petazzoni To: Remi Pommarel 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: <20190927103420.48bb9335@windsurf> In-Reply-To: <20190927083142.8571-1-repk@triplefau.lt> References: <20190927083142.8571-1-repk@triplefau.lt> Organization: Bootlin X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ? Thomas -- Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com