Received: by 10.223.176.46 with SMTP id f43csp1181080wra; Fri, 19 Jan 2018 08:00:51 -0800 (PST) X-Google-Smtp-Source: ACJfBov+I6WVEiAmojdc4Gz1UO0/i0nFrCPcfMaSAWs9A1v+I2/Jh57zi2za5I85NCHP4ScDAev0 X-Received: by 10.101.83.195 with SMTP id z3mr29014472pgr.133.1516377651425; Fri, 19 Jan 2018 08:00:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516377651; cv=none; d=google.com; s=arc-20160816; b=07K0s76wOFYRXz8Sc0LaNLW7EtrQ5l37yMVfUX68p73i3a/rXYBuVRTnsY0Whggh2j s20z68YgkBDIKXHo/EQzZw5p0Mu1YmBkPrbIkJok8KLvNQ0yZlEQBkH5m3g972S56bmZ t8D9RP/2bKTz1PChNHzaHEgx8VeelqJe0m67IAsHsQtsLZ7KXqO3TYMHvjhFGIJU888H IS4VlhZamh+PhRdD4PipOmtYGefc4AB5PSIjC8i89nSdx5+6JOEjj1mWV9hcvjvJLhS1 KR6o6OBlKDuda/ZA+ZExTfY7bunTiMqoGUHyajaciDWzledhcFXlv4fW/auzhPPAzl88 vasA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=poC/QdJ4ndpIn8RqS/uTRNrtvZs0Lxp5pujmt6RbKv0=; b=XAdMpO08O5XFKv/qDWiUNxWCcz4QzC3Lt9sslYEopDMK319bqCEok+9ZP7TajHYZ3a ewjtgN+RWS7lHxbiBuVQn4iLfbkaM+fM5d1SeXogCEaQ3V2MofF3A4tbxggBTk/E979U GAM80oux0laib77xTgqKWo3RBK7SfhMi1owuVWtkX0mexuj4tliUHNYyKwFmckSa+YJD GA+6t8qUoLenjP659pBTmROgs3olzOk7z0f2LGCoeT5vsQcaGIpWWz9AwkYuWZ8+wDIy DbZAzabSogPhwsNLrZQqCxGiRD2PzeVay3zFIQWX70rD1xjFcFDf+WzqbyyVhbHGIRwx T+xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=cJ/+g3e/; dkim=pass header.i=@codeaurora.org header.s=default header.b=YSJJjttI; 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 i9-v6si914152pll.605.2018.01.19.08.00.06; Fri, 19 Jan 2018 08:00:51 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=cJ/+g3e/; dkim=pass header.i=@codeaurora.org header.s=default header.b=YSJJjttI; 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 S1756107AbeASP6k (ORCPT + 99 others); Fri, 19 Jan 2018 10:58:40 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:47316 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755871AbeASP6c (ORCPT ); Fri, 19 Jan 2018 10:58:32 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5446360A4E; Fri, 19 Jan 2018 15:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516377512; bh=ZpHIn8lx+dosyEUV9c0WilegnVR10t2FGryWGsOIhmg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cJ/+g3e/rRzAYaWZ0qEoKSSgX8fILfhlEGFHoVn4pJzJxbiKtbSYURVvjt4rATdXn SXE69oLVnmNLWa4KWi9sq2kR8YjOYPIXQa8BNSBbHJEqzAwUXI9JciHdw/shLza9wj +BFlGoceu+wJkjoWcdhybiTG+XqasrEwa9M6uyk0= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 5B0C960452; Fri, 19 Jan 2018 15:58:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516377511; bh=ZpHIn8lx+dosyEUV9c0WilegnVR10t2FGryWGsOIhmg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YSJJjttI+abUqX4cNq5ocWon4t8R49roJSy0nIAEL4FIHMAth3uhcPckruUwNAwKo G8ZHZnqc71h0z2xyj7d7T4BCGJK14F8CLHNsjuqmJK0EhxNo+VtoWZTOnzBIIlZ0FY jTQErUws5fbEAp0tBvZ1C5N0tZUyVCbrkH24YZAo= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 19 Jan 2018 21:28:31 +0530 From: poza@codeaurora.org To: Stefan Roese Cc: Bjorn Helgaas , Philippe Ombredanne , Thomas Gleixner , Greg Kroah-Hartman , Kate Stewart , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Dongdong Liu , Keith Busch , Wei Zhang , Sinan Kaya , Timur Tabi Subject: Re: [PATCH v6 7/7] PCI: Unify wait for link active into generic pci In-Reply-To: References: <1516360204-1586-1-git-send-email-poza@codeaurora.org> <1516360204-1586-8-git-send-email-poza@codeaurora.org> Message-ID: <60704cf1854c539f514e859a1f8adc63@codeaurora.org> X-Sender: poza@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-01-19 19:49, Stefan Roese wrote: > On 19.01.2018 12:10, Oza Pawandeep wrote: >> Clients such as pciehp, dpc are using pcie_wait_link_active, which >> waits >> till the link becomes active or inactive. >> >> Made generic function and moved it to drivers/pci/pci.c >> >> Signed-off-by: Oza Pawandeep >> >> diff --git a/drivers/pci/hotplug/pciehp_hpc.c >> b/drivers/pci/hotplug/pciehp_hpc.c >> index 7bab060..26afeff 100644 >> --- a/drivers/pci/hotplug/pciehp_hpc.c >> +++ b/drivers/pci/hotplug/pciehp_hpc.c >> @@ -245,25 +245,12 @@ bool pciehp_check_link_active(struct controller >> *ctrl) >> return ret; >> } >> >> -static void __pcie_wait_link_active(struct controller *ctrl, bool >> active) >> +static bool pcie_wait_link_active(struct controller *ctrl) >> { >> - int timeout = 1000; >> - >> - if (pciehp_check_link_active(ctrl) == active) >> - return; >> - while (timeout > 0) { >> - msleep(10); >> - timeout -= 10; >> - if (pciehp_check_link_active(ctrl) == active) >> - return; >> - } >> - ctrl_dbg(ctrl, "Data Link Layer Link Active not %s in 1000 msec\n", >> - active ? "set" : "cleared"); >> -} >> + struct pci_dev *pdev = ctrl_dev(ctrl); >> + bool active = true; >> >> -static void pcie_wait_link_active(struct controller *ctrl) >> -{ >> - __pcie_wait_link_active(ctrl, true); >> + return pci_wait_for_link(pdev, active); >> } >> >> static bool pci_bus_check_dev(struct pci_bus *bus, int devfn) >> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c >> index 4a7c686..0de83ea 100644 >> --- a/drivers/pci/pci.c >> +++ b/drivers/pci/pci.c >> @@ -2805,7 +2805,7 @@ static void pci_std_enable_acs(struct pci_dev >> *dev) >> pci_read_config_word(dev, pos + PCI_ACS_CTRL, &ctrl); >> >> /* Source Validation */ >> - ctrl |= (cap & PCI_ACS_SV); >> +// ctrl |= (cap & PCI_ACS_SV); > > Could it be, that you missed to fix / clean something up here? > > Thanks, > Stefan yes, will correct this and re-post. Regards, Oza.