Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp3203373ybn; Fri, 27 Sep 2019 02:46:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9Gcpo/OujO1El21ZGxcVWsVpekilNo70B5+QK4MR0Nxy+/B7tX/UzrU35cH4MmOeRJvbW X-Received: by 2002:a17:906:fc2:: with SMTP id c2mr6874501ejk.261.1569577599925; Fri, 27 Sep 2019 02:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569577599; cv=none; d=google.com; s=arc-20160816; b=t8zmmBSt1hcvsGY7edyxv6ZG0nBTBsP48IKdHlHnm1P7O+JmwLHvzMdpx9niLZzGwe lIz6RgljbS1+fYj84BUvOcyQmoMgEOinOuhUgplA1b1YqazCbWGkpBxZR/es4nAuyjxM A4I/ePrhM6rTPl2DWSO5ko6TYPNKyXmCM3L9POsdj4COkCme3p5JL9yIZWHohiVomBxr 2X/EviGS73E68w/B1r3W+P4orfcE59/LFodv4FfQwHh8c1S00PrQb5WAhy0uQMahPOal pOIX7JccbyhvyiPyzHYffBG2I1uuQwjTvlt+w4RZDVBFkWZojZHJr5TnnHGVw9QCo0IT GvJw== 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=XiYSAtcPx5fGqbm0ITh1APYnTU1YBYfAVVdvhAkRtYs=; b=K/OVTiWMVEkJOEEWTtamyIqYdv1umZT2AgC8R58hwC/wBz1vokONIhnNqzuHSFj5VW rWbxUo+kGq+h5fPagBFeVrPSdKXZmd8auzBnvE9ETQBwvfIXOIs/TJTEUkmINKDRau3F XNKNV5oVmfCZDYszbp4N94i8FlY+qBJ1eIB0rEOm+iCmXRH6MerxKDQ+LdSsETKw5rr3 NiGtDFgT4tP1btkff02FiM2FRRaH+G5PRNvn3OcN0o+XATggnRYQCBzhDO7Y3GoMKWtR 9DQ9bBFeD2vyhaECiOp7h1/xefprNEwqdbA7o9LEvYATPeUV2+OPcmHN7aidY7dR7YqA LNcg== 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 y20si1174381edo.436.2019.09.27.02.46.14; Fri, 27 Sep 2019 02:46:39 -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 S1726251AbfI0Jp7 (ORCPT + 99 others); Fri, 27 Sep 2019 05:45:59 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:53461 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbfI0Jp6 (ORCPT ); Fri, 27 Sep 2019 05:45:58 -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 relay4-d.mail.gandi.net (Postfix) with ESMTPSA id DACC9E000D; Fri, 27 Sep 2019 09:45:55 +0000 (UTC) Date: Fri, 27 Sep 2019 11:45:55 +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 v3] PCI: aardvark: Don't rely on jiffies while holding spinlock Message-ID: <20190927114555.193a9d68@windsurf> In-Reply-To: <20190927085502.1758-1-repk@triplefau.lt> References: <20190927085502.1758-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 On Fri, 27 Sep 2019 10:55:02 +0200 Remi Pommarel wrote: > advk_pcie_wait_pio() can be called while holding a spinlock (from > pci_bus_read_config_dword()), then depends on jiffies in order to > timeout while polling on PIO state registers. In the case the PIO > transaction failed, the timeout will never happen and will also cause > the cpu to stall. > > This decrements a variable and wait instead of using jiffies. > > Signed-off-by: Remi Pommarel Acked-by: Thomas Petazzoni Thanks! Thomas -- Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com