Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp2211508img; Wed, 27 Feb 2019 12:24:04 -0800 (PST) X-Google-Smtp-Source: AHgI3IZXGMOKv5MFCsug6T4HyVPBjxkUMruQRVRAp2rrT+6f0FBA+HvkvegXUoCJfj0xf0Fc0Zp5 X-Received: by 2002:aa7:92da:: with SMTP id k26mr3583227pfa.216.1551299044774; Wed, 27 Feb 2019 12:24:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551299044; cv=none; d=google.com; s=arc-20160816; b=K6pr8q6vAJ4DxhkDV5sNcY382cDHFbdnzf9/sNhiK5BKYfs42Iyh4zbs9gGwkqfKkZ z1wPF6+FVSSmZkc8t0Q+oMvFUFTgqaj8gqGHOtWHttZJu3xcQlcCFO8R4Ske86Ig9QE9 RqBY6nz6GDPbiRURDMO5OsuZ+Ozzdbaies9RupH2/8Yi11j1fzY2i0q4aMz7sUi+1SVN PnoA3KG0PBq2UrV3UzKGJnyPNW4hGtJpHEu/14VwDQ8RSJf2KxC2/wdSn+DzeWRxwtXg FJZ0H0FuiZHKWqJaCpuj9q/I0WxPQXMlj/duKoVTu8oTo/dxO2iNRljBBTGhJw6XUFm6 dMEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:to:from:cc:dkim-signature; bh=JDf1lciv5RrwA87uts+6Hu5RZnsSBeIvh4NODDPitPI=; b=g0aqJ82Cf6upmvqDWUsM+ITxLuZTmiA6FBTPP+gAdUAULA4Uekk5+cXe0EBQjpqjTB Qclc5WMVagC2Rv18XAgPmskqCIN81JaW/Aq7dq3rWuAOHyQ7LDQQc64DeipZCpiwOhiN sqISmof4tsRjn1WloxGqqV7nNaYraIddLx+fJ/HWUXmid0SBZ4bv5gDoZWY/E2oSCSUs dQW5WSnXMLM4P3u7EJ28lrjGNDkXpSpLJfFaJPiqiQaVUagn5qvdf3XnUVkure/exGNy Aa0qPKigWHpL6sTJep4MuUaMRGOjMih/CgGznCurGKd1BAecFYHB7CR09lDUiMAzzzJS qRwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@dellteam.com header.s=smtpout header.b="I/ENQWiz"; 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 go2si16435416plb.270.2019.02.27.12.23.49; Wed, 27 Feb 2019 12:24:04 -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=fail header.i=@dellteam.com header.s=smtpout header.b="I/ENQWiz"; 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 S1730186AbfB0UWK (ORCPT + 99 others); Wed, 27 Feb 2019 15:22:10 -0500 Received: from esa1.dell-outbound.iphmx.com ([68.232.153.90]:47264 "EHLO esa1.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727240AbfB0UWK (ORCPT ); Wed, 27 Feb 2019 15:22:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dellteam.com; i=@dellteam.com; q=dns/txt; s=smtpout; t=1551298910; x=1582834910; h=cc:from:to:subject:date:message-id:references: content-transfer-encoding:mime-version; bh=FLxNDByFidAGh+qAvy5vd61CQ7gHdJj8hcDuZlNNBXg=; b=I/ENQWizbRlXtxZVTcQJInSBFjXdj0eo4j7PX88J698RGJeJhE03nT9v +j92mR00LxzJKbXMSoSD8Sk7MbDGkJ86adNyl568VIVic01sRiQfI4Eb6 cZazFq6q33aeqnSyw5jApG6sOyDAu1RjQA9Jxv6xuc/BdUkJr7zyVIcAz 8=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EOAAAm8XZchieV50NkGgEBAQEBAgE?= =?us-ascii?q?BAQEHAgEBAQGBVAIBAQEBCwGCWYEUMYx3jHyYNIFnCwEBLIRAhBAiNwYNAQM?= =?us-ascii?q?BAQIBAQIBAQIQAQEBCgkLCCkvgjoigm8BAQEDARIoPQIFCwIBCBgeEFcCBAE?= =?us-ascii?q?aGoJ+gWsIoCM9Am2BAYkHAQEBgh6KKoxIghaDdS6BJoNEF4VhAowSl1gJBZJ?= =?us-ascii?q?dIZMcil2SFwIEAgQFAhSBXYF5cIM9gicOCROOC0GBWY9/AYEeAQE?= X-IPAS-Result: =?us-ascii?q?A2EOAAAm8XZchieV50NkGgEBAQEBAgEBAQEHAgEBAQGBV?= =?us-ascii?q?AIBAQEBCwGCWYEUMYx3jHyYNIFnCwEBLIRAhBAiNwYNAQMBAQIBAQIBAQIQA?= =?us-ascii?q?QEBCgkLCCkvgjoigm8BAQEDARIoPQIFCwIBCBgeEFcCBAEaGoJ+gWsIoCM9A?= =?us-ascii?q?m2BAYkHAQEBgh6KKoxIghaDdS6BJoNEF4VhAowSl1gJBZJdIZMcil2SFwIEA?= =?us-ascii?q?gQFAhSBXYF5cIM9gicOCROOC0GBWY9/AYEeAQE?= Received: from mx0a-00154901.pphosted.com ([67.231.149.39]) by esa1.dell-outbound.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Feb 2019 14:21:43 -0600 Received: from pps.filterd (m0142693.ppops.net [127.0.0.1]) by mx0a-00154901.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1RKDP1j066679; Wed, 27 Feb 2019 15:22:01 -0500 Received: from esa2.dell-outbound2.iphmx.com (esa2.dell-outbound2.iphmx.com [68.232.153.202]) by mx0a-00154901.pphosted.com with ESMTP id 2qwsvh34cq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 27 Feb 2019 15:22:01 -0500 Cc: , , , , , , , , , , Received: from ausc60pc101.us.dell.com ([143.166.85.206]) by esa2.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA256; 28 Feb 2019 02:21:35 +0600 X-LoopCount0: from 10.166.134.83 X-IronPort-AV: E=Sophos;i="5.58,420,1544508000"; d="scan'208";a="1367840416" From: To: , Subject: Re: [PATCH v2] PCI: pciehp: Report degraded links via link bandwidth notification Thread-Topic: [PATCH v2] PCI: pciehp: Report degraded links via link bandwidth notification Thread-Index: AQHUjlm7N2lQKXAHOEmL/Rp7Y7d0Qw== Date: Wed, 27 Feb 2019 20:21:58 +0000 Message-ID: References: <20181129230454.GF178809@google.com> <20181207182021.16344-1-mr.nuke.me@gmail.com> <20190225022857.awuspuxb4bedirjp@wunner.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [143.166.11.235] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-27_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902270134 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/24/19 8:29 PM, Lukas Wunner wrote:=0A= > On Fri, Dec 07, 2018 at 12:20:00PM -0600, Alexandru Gagniuc wrote:=0A= > =0A= > =0A= >> Q: Why is this unconditionally compiled in?=0A= >> A: The symmetrical check in pci probe() is also always compiled in.=0A= > =0A= > Hm, it looks like the convention is to provide a separate Kconfig entry= =0A= > for each port service.=0A= =0A= Does the convention still make sense in light of the symmetry reason?=0A= =0A= >> Q: Why call module_init() instead of adding a call in pcie_init_services= () ?=0A= >> A: A call in pcie_init_services() also requires a prototype in portdrv.h= , a=0A= >> non-static implementation in bw_notification.c. Using module_init() is= =0A= >> functionally equivalent, and takes less code.=0A= > =0A= > Commit c29de84149ab ("PCI: portdrv: Initialize service drivers directly")= =0A= > moved away from module_init() on purpose, apparently to fix a race=0A= > condition.=0A= =0A= *GROWL*=0A= =0A= =0A= > What if the link is retrained at the same speed/width? Intuitively=0A= > I'd compare the speed in the Link Status Register to what is cached=0A= > in the cur_bus_speed member of struct pci_bus and print a message=0A= > only if the speed has changed. (Don't we need to cache the width as=0A= > well?)=0A= =0A= There are two mechanisms to bring a degraded link back to full BW.=0A= 1. Secondary bus reset, which results in the device being tore down =0A= along with our cached speed value.=0A= 2. Set the PCI_EXP_LNKCTL_LD (Link Disable) bit and clear it. We do =0A= that as part of the pciehp teardown path. We'd lose our cached value =0A= just like in the first case.=0A= =0A= >> +static irqreturn_t pcie_bw_notification_irq(int irq, void *context)=0A= >> [...]=0A= > =0A= > You need to hold pci_bus_sem [...]=0A= > This may sleep, so request the IRQ with request_threaded_irq() [...]=0A= =0A= Good catch! Thanks!=0A= All other issues you pointed out should be resolved in next version.=0A= =0A= Alex=0A=