Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3976094ybx; Sat, 9 Nov 2019 06:50:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzr7DI37R/s30Dyh4pRe/XOtrwFkQvLOmt5ZfA62l34ERQToDM9libEQzp+5o+C7nJxPED9 X-Received: by 2002:a50:90a8:: with SMTP id c37mr16397859eda.153.1573311042324; Sat, 09 Nov 2019 06:50:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573311042; cv=none; d=google.com; s=arc-20160816; b=RRpzOjf1RFaf6xbEnE27vcJMd5qv/6bRhjPhjlT2Mc8RLxpOkwMdwmt9NuIhak1nZ2 yn/Zj52XJ5jNDzOz8PwnqfRvT/gsXkkxoaquADFF4Mjft21x+OTxGrHIlFdlpF/Qt7Dp l6AJsc6MQAV4skQuffuoNTcGzsveQ7Snqxdpn2kCc0QwRwm9mqmUEaueRA3Bk7QthbOy /fj3Lj3aqwTVaQEuE19IrIove/61QocSVC7s75cAOQX8RA4AP4H4owtOdJIoT7FVfKj7 VxRr4T3oZE7oN5EF/ulCleDbb5ALrytJHjjG5ZUUKgNJmNaqfHAV8lfzDNi661I8ElfW ldhA== 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=1Ni5NAl26CdwUxx/BIu4feeuuN2pirvLHUxzZv1wjZ8=; b=kz5GvUf1ShUgrEUX2HNsbDbybYhSXSjdtMxumSx2HPpjzA8hTIxUq8hOkJNo28Tn3C 5IC3M/YZR3JvLqM3eZWS3dRldPL2BN3AKDjNnFg9tWomaHeAdrNObN8PlFocgIo4XDem zFkIcwVPsvIPKJE6o32du0FstPFtEvN3/2Y+GZ8hJacUCoFPFrICcPE9h5ERoEtkrQrw eW2Xltb39An4pVoZUwXv6J/68ud6js9oQ5u/H15N8YJD4X14hbPzLXnQmfq3aTiIBsfB atFT9tJZmD9I6yYE1VrxTr+phqnu6GFgxUfvOoxM6Hdi82uKgykdAnR3ggI+THIcjfKx aB/A== 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 oj22si6107813ejb.230.2019.11.09.06.50.04; Sat, 09 Nov 2019 06:50:42 -0800 (PST) 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 S1726467AbfKIOtW (ORCPT + 99 others); Sat, 9 Nov 2019 09:49:22 -0500 Received: from bmailout3.hostsharing.net ([176.9.242.62]:56149 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726282AbfKIOtW (ORCPT ); Sat, 9 Nov 2019 09:49:22 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id D6E31101C01C0; Sat, 9 Nov 2019 15:49:19 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 937602F7319; Sat, 9 Nov 2019 15:49:19 +0100 (CET) Date: Sat, 9 Nov 2019 15:49:19 +0100 From: Lukas Wunner To: Mika Westerberg Cc: Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown , Keith Busch , Alex Williamson , Alexandru Gagniuc , Kai-Heng Feng , Paul Menzel , Nicholas Johnson , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/2] PCI: Add missing link delays required by the PCIe spec Message-ID: <20191109144919.a2whrvyih4k4fu42@wunner.de> References: <20191107121847.24781-1-mika.westerberg@linux.intel.com> <20191107121847.24781-3-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191107121847.24781-3-mika.westerberg@linux.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 07, 2019 at 03:18:47PM +0300, Mika Westerberg wrote: > +static int pci_bus_max_d3cold_delay(const struct pci_bus *bus) > +{ > + const struct pci_dev *pdev; > + int min_delay = 100; > + int max_delay = 0; > + > + list_for_each_entry(pdev, &bus->devices, bus_list) { > + if (pdev->d3cold_delay < min_delay) > + min_delay = pdev->d3cold_delay; > + if (pdev->d3cold_delay > max_delay) > + max_delay = pdev->d3cold_delay; > + } You need to hold pci_bus_sem when accessing the devices list. > + if (!dev->subordinate || list_empty(&dev->subordinate->devices)) > + return; Same here. > + child = list_first_entry(&dev->subordinate->devices, struct pci_dev, > + bus_list); And again. Thanks, Lukas