Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6496436yba; Wed, 1 May 2019 13:33:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKwEZpcildssCBxielkUbgLWj0YsOF074savxQRKeyAlNzTgJ3Q260l4hccuL6ncO6zNT0 X-Received: by 2002:a62:1a8b:: with SMTP id a133mr29062596pfa.87.1556742782357; Wed, 01 May 2019 13:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556742782; cv=none; d=google.com; s=arc-20160816; b=HluWrmFM1+gBrOl5CGCWls8Ur5Y/dP5bIalbkn8Jmu3E30ADwEsxzuN6MbbXWPmSg8 yzZf4IosyYjelNLZSH1bPr0oT3hCeRca/Z7OMmvJOJ8mSfxAQr8hlCFjQH9fAlY5xXK7 53XtJ/EYPu/OdkRWejy77fF8Am34XUL1iP81S44dD+hbtXew4XzrQRKlqUaWZ8i8N7qA v8DzIcAR/Wbav+Xubsq8DZU5Rk3tOunvwhCzL8iGpY4C5ZWuPCTD1ok9mDG/d9nl7gVZ y10JTf21p2bPhlkOl3H8EdcNx3qpBg7v++R2o883dmklKgX6GmydkibqytjN0yV88SX+ Ntkw== 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:dkim-signature; bh=oW4uVRCaKhTeyeZbL41gxKkQGJYI491PRBtwi1JUPkA=; b=JB0dj62TKRJRFO1DvuXYnryxaEoEApqIpU3WEApi1YpUCAuFOMs7guvKps1TXwpYLo gqGzKYHv6+BKGsKKFpFcmes+QAqVmw14vjLqb3d16+q4byOHRKpe/J0+6N3197uGZeEZ NjM9wtoMxfwR1kqopeuxKRjpF4jo9zCExa7JRoaRjChcgEhlMD+rUSPhnRFogSCDO003 dckiTlj26uTN3H372my9XMwOLg1ugus+eUbF7PO5fYNOIZmNb92rPXKPMIdk7uculDxp 7SDwfFJs9DpebN1BcS2n4xizJ7ydXX6c1YH5mYyktwxWxSnVcDBhJNnf7WmmGBMYEy4c F7Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="xn0EE/TM"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si42019586pgh.499.2019.05.01.13.32.46; Wed, 01 May 2019 13:33:02 -0700 (PDT) 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=@kernel.org header.s=default header.b="xn0EE/TM"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726249AbfEAUaC (ORCPT + 99 others); Wed, 1 May 2019 16:30:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:40884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbfEAUaC (ORCPT ); Wed, 1 May 2019 16:30:02 -0400 Received: from localhost (odyssey.drury.edu [64.22.249.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4761920656; Wed, 1 May 2019 20:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556742601; bh=FFlQNDcccWY3yLhO/2pA8tJnKdcjTJ2P5Agp451sZmE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xn0EE/TMU2NjvjhfJSPEdZ1eCtgKVWC7tcAkjCJ0+tUDrVdRj43iGaRqYIHzFE7vl c/ySR1MYAKu9T6+dTYe/xCB4140GW8LGyKue+dgtNyMGfKUWw4J8PvzzwEkNfSerBz roeYfRd8MQ5ZYEBmM2c4r+aaSpyHh11pF+oQUSBw= Date: Wed, 1 May 2019 15:30:00 -0500 From: Bjorn Helgaas To: Alex Williamson Cc: mr.nuke.me@gmail.com, linux-pci@vger.kernel.org, austin_bolen@dell.com, alex_gagniuc@dellteam.com, keith.busch@intel.com, Shyam_Iyer@Dell.com, lukas@wunner.de, okaya@kernel.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI/LINK: Account for BW notification in vector calculation Message-ID: <20190501203000.GA47079@google.com> References: <155597243666.19387.1205950870601742062.stgit@gimli.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <155597243666.19387.1205950870601742062.stgit@gimli.home> 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 Mon, Apr 22, 2019 at 04:43:30PM -0600, Alex Williamson wrote: > On systems that don't support any PCIe services other than bandwidth > notification, pcie_message_numbers() can return zero vectors, causing > the vector reallocation in pcie_port_enable_irq_vec() to retry with > zero, which fails, resulting in fallback to INTx (which might be > broken) for the bandwidth notification service. This can resolve > spurious interrupt faults due to this service on some systems. > > Fixes: e8303bb7a75c ("PCI/LINK: Report degraded links via link bandwidth notification") > Signed-off-by: Alex Williamson Applied for (hopefully) v5.1, thanks! > drivers/pci/pcie/portdrv_core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c > index 7d04f9d087a6..1b330129089f 100644 > --- a/drivers/pci/pcie/portdrv_core.c > +++ b/drivers/pci/pcie/portdrv_core.c > @@ -55,7 +55,8 @@ static int pcie_message_numbers(struct pci_dev *dev, int mask, > * 7.8.2, 7.10.10, 7.31.2. > */ > > - if (mask & (PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_HP)) { > + if (mask & (PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_HP | > + PCIE_PORT_SERVICE_BWNOTIF)) { > pcie_capability_read_word(dev, PCI_EXP_FLAGS, ®16); > *pme = (reg16 & PCI_EXP_FLAGS_IRQ) >> 9; > nvec = *pme + 1; >