From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F369C388F3 for ; Mon, 30 Sep 2019 14:50:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1802B21920 for ; Mon, 30 Sep 2019 14:50:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731800AbfI3OuC (ORCPT ); Mon, 30 Sep 2019 10:50:02 -0400 Received: from foss.arm.com ([217.140.110.172]:56078 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731459AbfI3OuC (ORCPT ); Mon, 30 Sep 2019 10:50:02 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6C2F628; Mon, 30 Sep 2019 07:50:01 -0700 (PDT) Received: from localhost (unknown [10.37.6.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D7DC63F706; Mon, 30 Sep 2019 07:50:00 -0700 (PDT) Date: Mon, 30 Sep 2019 15:49:59 +0100 From: Andrew Murray To: Thomas Petazzoni Cc: Remi Pommarel , 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: <20190930144958.GA42880@e119886-lin.cambridge.arm.com> References: <20190927085502.1758-1-repk@triplefau.lt> <20190927114555.193a9d68@windsurf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190927114555.193a9d68@windsurf> User-Agent: Mutt/1.10.1+81 (426a6c1) (2018-08-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 27, 2019 at 11:45:55AM +0200, Thomas Petazzoni wrote: > 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 > Reviewed-by: Andrew Murray > Thanks! > > Thomas > -- > Thomas Petazzoni, CTO, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com