Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2870579imu; Thu, 29 Nov 2018 11:32:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/WFOWF+fWEYJ864GWJ9NuegHmVQXwYrFR2EqZBZ/1zMta/DlCb+yoQZ13Am9nhasIotnptW X-Received: by 2002:a63:7c13:: with SMTP id x19mr2294394pgc.45.1543519957750; Thu, 29 Nov 2018 11:32:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543519957; cv=none; d=google.com; s=arc-20160816; b=cnv4TAJhkHPmYag3yxp2zoDyUIOCI39zPja2Yhlt54bmEYhI7HNuoPQ9FIjG3Qzx2s xIQQTeIzvr0ZZgIlHLqsM7pk+Pc7WcJbFZBgSWcgOTtwlukLgN1vDS6gHmlk3FMVNbrU 0bpOinh6w/fKc+RBkTB/KlPIVgb00zht2lOy4N3aCK5lk2ocw0R6JOzOGgRXTHaeZh8e WEz+dzTXZa4x9KMJEXtyUscXRgkoiq2MI93HW4+lvheloaFbdhXbxax2cZ+Pw41OSlzz WNHG1IfXtgj+/9qExP0Y1T/BLe7nmy4wkxohHSefJ3R3V0webAyqSMB55EfqtXiZwzr6 Li7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=iKwy6wsVL3zZiEeFKWko6YMx3ApLDmnrh/7INTLL+OI=; b=lb3AvAnV+wtYjb0j3yCSwg+rdUObK2CvBg5Ox3JzwchvQdVPguhA84CvopNxGixffp nQ49r1DwWHzp2Sy/0zyfAYarO9DBFelSpfhcSmHoJlT4vvazdDJfxxT0m9Qr5ioLZA8Q ujYAl/yHVBeVZfCkKBQRPaDrtICu1TV/sc2zFRFgXE6TbZB9SDQlmzrLjob14a34ag/M 0ACSVY99HEQUMOVGdfZLxZPSAVbm0tN8cI/iYKSvzxscqjltWv5wkXJS53aUSwt4fj97 rxGZ+JMNneSbKb31miX1YlOwGAzJZGBdG7DW4rrCI46M3qLnUzh5X+PVPFGLN5HcLlK3 UoKA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7-v6si2909926plp.130.2018.11.29.11.32.22; Thu, 29 Nov 2018 11:32:37 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726470AbeK3Ggs (ORCPT + 99 others); Fri, 30 Nov 2018 01:36:48 -0500 Received: from mga04.intel.com ([192.55.52.120]:27056 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725788AbeK3Ggs (ORCPT ); Fri, 30 Nov 2018 01:36:48 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Nov 2018 11:30:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,295,1539673200"; d="scan'208";a="116604676" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga004.fm.intel.com with SMTP; 29 Nov 2018 11:30:13 -0800 Received: by lahna (sSMTP sendmail emulation); Thu, 29 Nov 2018 21:30:12 +0200 Date: Thu, 29 Nov 2018 21:30:12 +0200 From: Mika Westerberg To: Alex_Gagniuc@dellteam.com Cc: mr.nuke.me@gmail.com, bhelgaas@google.com, Austin.Bolen@dell.com, keith.busch@intel.com, Shyam.Iyer@dell.com, lukas@wunner.de, okaya@codeaurora.org, rafael.j.wysocki@intel.com, poza@codeaurora.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI: pciehp: Report degraded links via link bandwidth notification Message-ID: <20181129193012.GE3078@lahna.fi.intel.com> References: <20181129000829.14751-1-mr.nuke.me@gmail.com> <20181129160625.GC3078@lahna.fi.intel.com> <9f76adf7315842cb82375eeaad0a0563@ausx13mps321.AMER.DELL.COM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9f76adf7315842cb82375eeaad0a0563@ausx13mps321.AMER.DELL.COM> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 29, 2018 at 07:00:58PM +0000, Alex_Gagniuc@Dellteam.com wrote: > >> + if (link_status & PCI_EXP_LNKSTA_LBMS) { > >> + if (pdev->subordinate && pdev->subordinate->self) > >> + endpoint = pdev->subordinate->self; > > > > Hmm, I thought pdev->subordinate->self == pdev, no? > > That makes no sense, but I think you're right. I'm trying to get to the > other end of the PCIe link. Is there a simple way to do that? (other > than convoluted logic that all leads to the same mistake) AFAIK you should be able to find the other end by looking at the pdev->subordinate->devices list. Not sure if there is a simpler way, though.