Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2675249ybv; Sun, 9 Feb 2020 04:56:06 -0800 (PST) X-Google-Smtp-Source: APXvYqzHVRwAwbpAt84oWnSPd0een76ui6yjEH5asGDnxlqAiWX2QmcYMW8VyB950ReWHqO1w1bt X-Received: by 2002:a9d:7559:: with SMTP id b25mr6485465otl.189.1581252966739; Sun, 09 Feb 2020 04:56:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581252966; cv=none; d=google.com; s=arc-20160816; b=VEhBOcDlWNY0Tfx4aic4cCqrSa/8kQ4K0yLcFlQDOkuBOdWL5n/xT8TYfmHEO/m6zg qNy4YS27rf6Bynpq9ik3rPQPM0X3HKtmzWRVAAHZhDR+s1cFZ2eKYZNvY+FIYyIt0tjV Bs8epQrG3c90QDYiKim1kLaOK8hm8rwhQ4Jjw5pROiH7Hpk8DA9yxYeyEsLm6EoZwBSE J6i4XqFSfhSbwNKNKRqJENXCSqOeFyje9Egn49exibMIJuQ4PtZfoGvKoqgpAt2gZujQ J2l25fq42DHLHT6tb1FdaEQ4Hc2RHnVLMFjt9q4Fh663GoGviCQ5mrs0IrsOdMOcm+BT AvIA== 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=zlmTtWDMpyX4aL/2xZShJff5mIJmjKC/aFp/I58A9Qg=; b=ztkPUIbdFuWNsH61Vhxgt+vwkwzbw+uUtJW8u+OPwnzGx4HScGD6MoyAkKXwGYVO9l hkFzCIYD2gplZV/m6KAa3B2SFGf/opbEddbQ2Lv25XYmW99/o7z5tVM4WaSd7sEreW+2 GdikrpwNW8T8FwGiWFWftCd8+To43QNWFbz+eYkLFgFL9fPzgkvpre/a0q7I0qyux7mC xECLJyzdEmcBwTbygRY4sc5e3igECR0DkM+N0GK0rAU5zE48T4DQGryhm85GR+fqhw4S IS0naPCkfo6K6L6NggXKvemhqkPYK2Xk7oa0toNhKOZtLaFkPb90SsKbADTYlQdzkkhx EY+A== 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 l13si3265672otq.30.2020.02.09.04.55.54; Sun, 09 Feb 2020 04:56:06 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727663AbgBIMzq (ORCPT + 99 others); Sun, 9 Feb 2020 07:55:46 -0500 Received: from bmailout2.hostsharing.net ([83.223.78.240]:38087 "EHLO bmailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727514AbgBIMzq (ORCPT ); Sun, 9 Feb 2020 07:55:46 -0500 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 D916628004EA1; Sun, 9 Feb 2020 13:55:43 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id AD5FAECCD6; Sun, 9 Feb 2020 13:55:43 +0100 (CET) Date: Sun, 9 Feb 2020 13:55:43 +0100 From: Lukas Wunner To: Bjorn Helgaas Cc: Stuart Hayes , Austin Bolen , keith.busch@intel.com, Alexandru Gagniuc , "Rafael J . Wysocki" , Mika Westerberg , Andy Shevchenko , Sinan Kaya , Oza Pawandeep , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Enzo Matsumiya Subject: Re: [PATCH v2] PCI: pciehp: Make sure pciehp_isr clears interrupt events Message-ID: <20200209125543.k7u5y6omptbpmwo6@wunner.de> References: <20191120222043.53432-1-stuart.w.hayes@gmail.com> <20200129005151.GA247355@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200129005151.GA247355@google.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 Tue, Jan 28, 2020 at 06:51:51PM -0600, Bjorn Helgaas wrote: > On Wed, Nov 20, 2019 at 05:20:43PM -0500, Stuart Hayes wrote: > > - pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, events); > > + if (status) { > > + pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, status); > > + > > + /* > > + * If MSI per-vector masking is not supported by the port, > > + * all of the event bits must be zero before the port will > > + * send a new interrupt (see PCI Express Base Specification > > + * Revision 5.0 Version 1.0, section 6.7.3.4, "Software > > + * Notification of Hot-Plug Events"). So in that case, if > > + * event bit gets set between the read and the write of > > + * PCI_EXP_SLTSTA, we need to loop back and try again. > > + */ > > + if (!ctrl->pvm_capable) { > > I don't know what whether the MSI vector is masked or not at this > point I think MSIs are handled by handle_edge_irq(), which, unlike handle_level_irq(), does not mask the IRQ by default. We could call disable_irq_nosync() / enable_irq() to mask the IRQ and immediately unmask it after writing to the slot status register if the interrupt uses MSI / MSI-X (and not INTx), thereby forcing another interrupt if new bits have been set in the meantime. But I suspect this approach may not work if PVM is unsupported. > I see that Lukas took a look at this earlier; I'd really like to have > his reviewed-by, since he's the expert on this code. Hm, should we add an entry for pciehp to MAINTAINERS and list me as R: or M:? Thanks, Lukas