Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp94031img; Sun, 17 Mar 2019 21:34:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGQInIRBnWWiejUYfQYYhXaVaEReYmKFnuth+1nC+/WK+D3crgIgxXqtcDb5oQr0ud1Vqs X-Received: by 2002:aa7:91d7:: with SMTP id z23mr17381619pfa.137.1552883683077; Sun, 17 Mar 2019 21:34:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552883683; cv=none; d=google.com; s=arc-20160816; b=xmqxwDQs7PKHecsxgJ1Fkd1AWkWHgVvZ7mE1+uD9Qgd640qNZNuiJZnX80I6Pe/vq1 FZ48smP5l/aR4yYDLxiDG4ZMag/U+fYSmjfDc5BG+OaxTbKVzPr+NwNYKuWwfHjzxLaB si5FvFiAXMi0BoYrwlkFZpInwI0GCivcVWXf7YY+QryWQl1EyWtHXrUAsnxTEFV/wAGU ezA65r1HcE7nS91LAYdyma9uz70x+NsEtAs5xs+Mg4bKpVcwRH96nCJdzhJSD+d4Hmhd 9urj+OctYmItaxg1+k54GZtfBKTKhbq8MCWoE3VM2zJFih1tP8JL1fl3IXEjA2Dq0Wao LIMg== 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=g7lBXJJQ5va85qeDa9/RFTifYgjOQp6hFFdBF6VskoM=; b=t/aAXW14gt53uj/b7d+LpZdUfnKHdXlXHaNQYMJhVNJbxsrXx+TizH3+c7b46GNq+z 6nWb/2jMbIF9AND26W45Fc6e01HfQb2dq+ADTkUetT/mQorad1G00Ql27Szttc8OSCBN IInBrX+BBZKsUtA20gwJJmrjX9dLJCV8gx6HnVuwGe8wIReIzUWBLQO1MotpdspS/rdp /1eqCKJFCTxN0jYy4umHCXjXxvSvhwOf4Dp8jvHinZ9BARhgITmlKK+vz8idU/ZtHsXQ J/7DVZ9zBSgKJOaSnl9zEZax/abH59kOIn2dBpylvjjOVP2JCtuRtGklSad3pO8NKyRd v18Q== 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 d195si8499730pga.309.2019.03.17.21.34.16; Sun, 17 Mar 2019 21:34:43 -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 S1726878AbfCREdR (ORCPT + 99 others); Mon, 18 Mar 2019 00:33:17 -0400 Received: from bmailout2.hostsharing.net ([83.223.90.240]:48209 "EHLO bmailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725915AbfCREdQ (ORCPT ); Mon, 18 Mar 2019 00:33:16 -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 bmailout2.hostsharing.net (Postfix) with ESMTPS id A643A2800B3F5; Mon, 18 Mar 2019 05:33:14 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 5B1DC11431F; Mon, 18 Mar 2019 05:33:14 +0100 (CET) Date: Mon, 18 Mar 2019 05:33:14 +0100 From: Lukas Wunner To: Alex G Cc: Linus Torvalds , Bjorn Helgaas , linux-pci@vger.kernel.org, Linux List Kernel Mailing , Lorenzo Pieralisi Subject: Re: [GIT PULL] PCI changes for v5.1 Message-ID: <20190318043314.noyj6t4sh26spuzt@wunner.de> References: <20190308173154.GC214730@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Sun, Mar 17, 2019 at 07:22:17PM -0500, Alex G wrote: > On 3/17/19 4:18 PM, Linus Torvalds wrote: > > On Fri, Mar 8, 2019 at 9:31 AM Bjorn Helgaas wrote: > > > > > > - Report PCIe links that become degraded at run-time (Alexandru Gagniuc) > > > > Gaah. Only now as I'm about to do the rc1 release am I looking at new > > runtime warnings, and noticing that this causes > > > > 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 > > > > because you can't have a NULL handler for a level-triggered interrupt > > (you need something to shut the interrupt off so that it doesn't keep > > screaming!). > > Thanks for the catch. I did not see the error on my test machines. I'll take > a look tomorrow, and update through Bjorn. Seems like an easy fix. My apologies for not spotting this during review. This can't be fixed by setting the IRQF_ONESHOT flag because the IRQ is always shared with pciehp, dpc and other port services, which do not set the flag, so you'd get a flags mismatch error in __setup_irq(). The solution is thus to acknowledge the interrupt in pcie_bw_notification_handler() and move the portion which may sleep to a separate function which is used as IRQ thread. In other words, move the down_read() / up_read() portion to a separate function and return IRQ_WAKE_THREAD instead of IRQ_HANDLED. The reason why it didn't show up on your test machines is likely that they're using MSI on all PCIe ports, whereas Linus' machines appear to possess at least one PCIe port which uses legacy INTx interrupts. (MSI sets IRQCHIP_ONESHOT_SAFE for the irq_chip.) Thanks, Lukas