Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2646620ybc; Wed, 13 Nov 2019 18:51:53 -0800 (PST) X-Google-Smtp-Source: APXvYqxaFxd7MjyUXgIYuZRb4/rrwDJ0HWx1jUXi5oKg3JxZH9rSzRcPSwkSdUzHLUlMb1WFUTFe X-Received: by 2002:a17:906:e82:: with SMTP id p2mr6009775ejf.237.1573699912903; Wed, 13 Nov 2019 18:51:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573699912; cv=none; d=google.com; s=arc-20160816; b=F8eXEBJUHWJUPjoaKT+pWvPPa/2W2dwSTNQ/UhQVtkQg6hep0JHZFAn763xfHfhhQX GfBC+wTDvdTKbwgWah1Viquez4DyalDNC+TLnOj0eEZ+Se46b7d2sBtfQ6aePcKAj9aw ux+FW8TY3qaqqGCXjjGt6QpvmH6puz3Jk//ggIdQrA910sBoapuf9QzZtsMlp3rffDls QWwCYD+abqJcCha/5CD4YqGpy6E26SmnMYZG2L2jWQB/GBX6uRXrSyhTI4OidHN3JRB+ R5FHDOL9pB5ZkFK/pxcojDhgAXCcMqUuMjixa/UnIqdb8D7kdOoA8wzRPqixiA2aIM5e 3BfQ== 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=QkpureVxkzANWmeKJrZibN4UDBi00orhw3rpIeC+GxU=; b=jLobitsoEZtsaZhR1bAmU5joHYiDQfySNq1HfkmCl/H9tHHYfmBNFJIjWQrNbpOTT5 vfqDe48HtAA1+WuF1ojiCJrwVZhgQ8QZIHy0v8UFBPwaoFuMQyuV2HNam2I8OZnmhM2N 45Uyhhhotw0ZYW2B78+PC+5fdDjQsFeYEd9qw/BDYLpLNtaPsU5Mdy5sscdnc4CD9sd+ /wTQyoz9uaK4yOGDWyAXh6j1b16XG0deZ1hF1mKYvkqcrlsMUdQUF5cLIGj+RYBf7TnM Fi3XU/a20IsZp4ULshGmv0A3sPabFWwL2KPCyk28lakCgJQf4XG0EMRKt2UaEXwBLE95 qHCw== 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 t17si2524497ejg.44.2019.11.13.18.51.15; Wed, 13 Nov 2019 18:51:52 -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 S1726590AbfKNCuZ (ORCPT + 99 others); Wed, 13 Nov 2019 21:50:25 -0500 Received: from bmailout1.hostsharing.net ([83.223.95.100]:37461 "EHLO bmailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726516AbfKNCuZ (ORCPT ); Wed, 13 Nov 2019 21:50:25 -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 bmailout1.hostsharing.net (Postfix) with ESMTPS id 0771B3000452D; Thu, 14 Nov 2019 03:50:23 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id D0FD4A3DC9; Thu, 14 Nov 2019 03:50:22 +0100 (CET) Date: Thu, 14 Nov 2019 03:50:22 +0100 From: Lukas Wunner To: Stuart Hayes Cc: Bjorn Helgaas , Austin Bolen , keith.busch@intel.com, Alexandru Gagniuc , "Rafael J . Wysocki" , Mika Westerberg , Andy Shevchenko , "Gustavo A . R . Silva" , Sinan Kaya , Oza Pawandeep , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI: pciehp: Make sure pciehp_isr clears interrupt events Message-ID: <20191114025022.wz3gchr7w67fjtzn@wunner.de> References: <20191112215938.1145-1-stuart.w.hayes@gmail.com> <20191113045939.hhmzfbx46vkgmsvn@wunner.de> <0712ed46-e4ba-46d0-05b5-81b258829f38@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0712ed46-e4ba-46d0-05b5-81b258829f38@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 Wed, Nov 13, 2019 at 03:58:51PM -0600, Stuart Hayes wrote: > The hotplug port I'm seeing the issue with is an AMD "Starship/Matisse GPP > Bridge" (1022/1483), which uses an MSI interrupt (PCI-MSI chip). [...] > And because individual event enable bits in the slot control register aren't > cleared on each interrupt, I interpret this to mean that an interrupt message > will be sent every time that the event status bits in the slot status register > transition from all zeros to at least one event status bit being 1. Once one > of those event status bits is 1, the logical AND of the three conditions above > will not transition from FALSE to TRUE again until all of the (enabled) event > status bits in the slot status register all go to zero, which is what my patch > is intended to ensure. Understood now, thanks. I'd suggest adding a flag "unsigned int pvm_capable;" to struct controller below "u32 slot_cap" (in the "capabilities and quirks" section), setting that flag in pcie_init() from dev->msi_cap + PCI_MSI_FLAGS (& PCI_MSI_FLAGS_MASKBIT) and amending pciehp_isr() to check for that flag and re-read / re-write the Slot Status register until it's all zeroes. That would make the reason for the modifications to pciehp_isr() explicit. Please try to make the modifications to pciehp_isr() as small and simple as possible. Maybe it's worthwhile to put them in a separate static function which is called from pciehp_isr(), I don't know. Please mention the PCI vendor / device IDs in the commit message and provide a reference to the PCIe Base Spec section you've quoted above. Thanks, Lukas