Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp259412ybg; Tue, 9 Jun 2020 23:22:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXC8BQpJeQN+l7KzhYEc6M8vPE12CKS8w9K5kSOtlj5JuZC1ZOtWfvrCchk/YG6+2j2vo/ X-Received: by 2002:a17:906:af6b:: with SMTP id os11mr910663ejb.291.1591770173559; Tue, 09 Jun 2020 23:22:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591770173; cv=none; d=google.com; s=arc-20160816; b=S61MGXglNmhC4SiMFIz7kW+HzraS5PTH443jVXr/XSyqvAmEj4NOSTmG+Kd+EOUTd2 OfUjZTNviF2tw/KAviBqsirJ8IEnpKCer1/8tFEH3fxAkkc2a35qz5Tc2XQRtoRHwiwT maTz8nofTRlR/KY3SBQlY3ejP73MZ6LEnMRknHcJwnq+L/urak0CTaDsoUVMq+Xq/1l7 e6pvi7y6gjFOdzK+0C1gUgSaXXy972ntd0FatwwfBd054yfaIcUc0pyb6yorRFlPhyTh rFw65JejX2sTP94va/H0IzRdS3LTYZukPQgmWI9YmgH9nP6+ttZMNUcsvtHQ/fMSgq4G Q0hA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=YPylwQEO0t+PqNir+L23lZzFGPaGJkuOiRYc85JeHJM=; b=aZzrWAVtHUI5oL0hL1/eXdZGS2sS1/k/wLed31eXgb/jenmjU9kj1Ohq/2RlLBf4SZ 34+alZTSen/qAMooBZ5CKnXhvKLVEmetsBPPK8tUrPv6/DxTbFt+9oiYBhcIYc/Lb/fc A3xKxLTQ+4ThFtPrH3r8UP/zLWuNsJz/ipxsDVEbyDn+dZ+Eto5yBLUtmp9AWrV+EZ0W reYELCO5ccIdc9bzTzyg3vG2+Gee7Qgh/f8Ve+B+auEUE6iDG8fevFiEAIXMIaA3S5hc fwb7ye5l86vjFP7XkhqNlpwc8p72rSUE9ffwPd0ashNGXdZ0Scg5dkQBBgVUza3kG2wg pDFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l10si13082415edi.562.2020.06.09.23.22.30; Tue, 09 Jun 2020 23:22:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726272AbgFJGSL (ORCPT + 99 others); Wed, 10 Jun 2020 02:18:11 -0400 Received: from mx3.molgen.mpg.de ([141.14.17.11]:42201 "EHLO mx1.molgen.mpg.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726035AbgFJGSL (ORCPT ); Wed, 10 Jun 2020 02:18:11 -0400 Received: from [192.168.178.35] (unknown [88.130.155.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 04AE620646DCF; Wed, 10 Jun 2020 08:18:08 +0200 (CEST) Subject: Re: close() on some Intel CNP-LP PCI devices takes up to 2.7 s To: Mika Westerberg Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, LKML , Mario Limonciello , it+linux-pci@molgen.mpg.de, amd-gfx@lists.freedesktop.org References: <20200609154416.GU247495@lahna.fi.intel.com> From: Paul Menzel Message-ID: <3854150d-f193-d34e-557e-41090e4f39b5@molgen.mpg.de> Date: Wed, 10 Jun 2020 08:18:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200609154416.GU247495@lahna.fi.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Mika, Am 09.06.20 um 17:44 schrieb Mika Westerberg: > On Tue, Jun 09, 2020 at 05:39:21PM +0200, Paul Menzel wrote: >> On the Intel Cannon Point-LP laptop Dell Precision 3540 with a dedicated AMD >> graphics card (both graphics devices can be used) with Debian Sid/unstable >> with Linux 5.6.14, running lspci takes quite some time, and the screen even >> flickers a short moment before the result is displayed. >> >> Tracing lspci with strace, shows that the close() function of the three >> devices takes from >> >> • 00:1d.0 PCI bridge: Intel Corporation Cannon Point-LP PCI Express Root >> Port #9 >> >> • 04:00.0 System peripheral: Intel Corporation JHL6340 Thunderbolt 3 NHI >> (C step) [Alpine Ridge 2C 2016] (rev 02) >> >> • 3b:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Lexa >> XT [Radeon PRO WX 3100] >> >> takes from 270 ms to 2.5 s. >> >>> 11:43:21.714391 openat(AT_FDCWD, "/sys/bus/pci/devices/0000:04:00.0/config", O_RDONLY) = 3 >>> 11:43:21.714448 pread64(3, "\206\200\331\25\6\4\20\0\2\0\200\10 \0\0\0\0\0\0\352\0\0\4\352\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0(\20\272\10\0\0\0\0\ >>> 200\0\0\0\0\0\0\0\377\1\0\0", 64, 0) = 64 >>> 11:43:24.487818 close(3) = 0 >> >>> 11:43:24.489508 openat(AT_FDCWD, "/sys/bus/pci/devices/0000:00:1d.0/config", O_RDONLY) = 3 >>> 11:43:24.489598 pread64(3, "\206\200\260\235\7\4\20\0\360\0\4\6\20\0\201\0\0\0\0\0\0\0\0\0\0;;\00000\0 \354 \354\1\300\21\320\0\0\0\0\0\0\0\0\0\0\0\0 >>> @\0\0\0\0\0\0\0\377\1\22\0", 64, 0) = 64 >>> 11:43:24.966661 close(3) = 0 >> >>> 11:43:24.988544 openat(AT_FDCWD, "/sys/bus/pci/devices/0000:3b:00.0/config", O_RDONLY) = 3 >>> 11:43:24.988584 pread64(3, "\2\20\205i\7\4\20\0\0\0\200\3\20\0\0\0\f\0\0\300\0\0\0\0\f\0\0\320\0\0\0\0\0010\0\0\0\0 \354\0\0\0\0(\20\272\10\0\0$\354H\0\0\0\0\0\0\0\377\1\0\0", 64, 0) = 64 >>> 11:43:25.252745 close(3) >> >> Unfortunately, I forgot to collect the tree output, but hopefully the >> attached Linux messages and strace of lspci output will be enough for the >> start. >> >> Please tell me, if you want me to create a bug report in the Linux bug >> tracker. > > Can you try this commit? > > https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?h=pci/pm&id=ec411e02b7a2e785a4ed9ed283207cd14f48699d > > It should be in the mainline already as well. > > Note we still need to obey the delays required by the PCIe spec so 100ms > after the link is trained but this one should at least get it down from > 1100ms. Thank you for replying so quickly. Hopefully, I’ll be able to test the commit tomorrow. One question though. The commit talks about resuming from suspend. I understand that training happens there. In my case the system is already running. So I wonder, why link(?) training would still happening. Kind regards, Paul