Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1656857img; Tue, 19 Mar 2019 12:26:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbH5xyZ9Tq/e/EeCfLM1OgJoyIu7Mr2HrDSkrPByjWWGJH+aqWHyKtUGt0VACicwfwOy7V X-Received: by 2002:a63:6bc6:: with SMTP id g189mr3847034pgc.427.1553023613907; Tue, 19 Mar 2019 12:26:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553023613; cv=none; d=google.com; s=arc-20160816; b=X/oqtXMkCuG813lvja2ZQMsaikG4E3CvNZYg3e/Dm4i/5fbbDnG8DGByq2CyTXKtuI TdptdR58sFLzgMWcWOGPzHS2krQga3gqTiVGqOrmEUkmTjD2KFjzcRI+xPUUFT0hROpl atqkoVed294QA6B6TdDkYGZDGG8AsE997p9EBZTQjrQwJpg2Em9YuBcW8JiPsaxKhEYG 7nMxkO3Z9hFqEpObm4aSc9BKvW3p+NV7m/hMUom7JYB5hF1foaqxd/TY+2GjF0UnWCkj PrqDJR3l/S9xO5YtiXeAWg0Ws1GO3IwglythHVMSQ7e3TLPijRq3c5pQEwwixwzwLhsd 6k0g== 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; bh=0d/x6ZSEwCRpNt1Z9jcewN718ZbT3cLgVUNaoRP/fDc=; b=GVQhdJNt1qEpStnkL91Ryyjo7efuFs7IbK5lyaTxTw/YXIk5tx07gVBmITMtCwTnpO F9uNLE26OXLNspRCa7ViNa6Nbdha2T0ndQ+dVGwClAkgSN/6mP0Ez3tBwbiD6y97F05y EUiamN0vMmeHaYwzx9SYZg2Q7JWbPtJdQJeRR6uB4p8MOXWw+4BuDQL33rZpCaiIFz5w vW7z6fJYCjlq260cYjkDE/2qzaa0MW47jbzSUgdvUJXLFbiP8T2RdddDzr2IrrD91isU DMhLMHWIiT4ZIUGVOCF/vsMbePQFWjxDloZkIgLVp+CWH1ubAtFg3ujKamS14OVWFHCP 497g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c3si11633507pgq.510.2019.03.19.12.26.38; Tue, 19 Mar 2019 12:26:53 -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; 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 S1727304AbfCSTZx (ORCPT + 99 others); Tue, 19 Mar 2019 15:25:53 -0400 Received: from bmailout1.hostsharing.net ([83.223.95.100]:39347 "EHLO bmailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727066AbfCSTZx (ORCPT ); Tue, 19 Mar 2019 15:25:53 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 08F2030000CDA; Tue, 19 Mar 2019 20:25:51 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id CE4B3250510; Tue, 19 Mar 2019 20:25:50 +0100 (CET) Date: Tue, 19 Mar 2019 20:25:50 +0100 From: Lukas Wunner To: Alexandru Gagniuc Cc: bhelgaas@google.com, austin_bolen@dell.com, alex_gagniuc@dellteam.com, keith.busch@intel.com, Shyam_Iyer@Dell.com, okaya@kernel.org, torvalds@linux-foundation.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI/LINK: bw_notification: Do not leave interrupt handler NULL Message-ID: <20190319192550.5lxfm3h2jnaip3on@wunner.de> References: <20190319011214.7847-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190319011214.7847-1-mr.nuke.me@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 18, 2019 at 08:12:04PM -0500, Alexandru Gagniuc wrote: > A threaded IRQ with a NULL handler does not work with level-triggered > interrupts. request_threaded_irq() will return an error: > > genirq: Threaded irq requested with handler=NULL and !ONESHOT for irq 16 > pcie_bw_notification: probe of 0000:00:1b.0:pcie010 failed with error -22 > > For level interrupts we need to silence the interrupt before exiting > the IRQ handler, so just clear the PCI_EXP_LNKSTA_LBMS bit there. > > Reported-by: Linus Torvalds > Signed-off-by: Alexandru Gagniuc I've tested this on my Ivy Bridge MacBook Pro which uses INTx on root and downstream ports and I'm not seeing probe errors, so: Tested-by: Lukas Wunner > @@ -67,8 +77,8 @@ static irqreturn_t pcie_bw_notification_handler(int irq, void *context) > __pcie_print_link_status(dev, false); > up_read(&pci_bus_sem); > > + pcie_capability_read_word(port, PCI_EXP_LNKSTA, &link_status); > pcie_update_link_speed(port->subordinate, link_status); > - pcie_capability_write_word(port, PCI_EXP_LNKSTA, events); > return IRQ_HANDLED; > } I'd suggest leaving the call to pcie_update_link_speed() in pcie_bw_notification_irq() to avoid the duplicate read of the Link Status register. With that addressed, Reviewed-by: Lukas Wunner Thanks, Lukas