From patchwork Tue Sep 27 14:19:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12990697 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB0AAC6FA82 for ; Tue, 27 Sep 2022 14:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rypwWUd/oBicYx8Hz/hI+hSeIZtBVzkxoRqMffIc9fg=; b=wfUHhv2lFbZ8nV 8GU8DGWyXiCVN7HXQu5S5frdOGf8XK+SJ9iCmcb5JsczsSS2woQv8qdYaKdN3ABO6C/hJ6MUkVHxa OK/zNGraXZCSRW90urQFijysyhkmxc0DxuycJLo1C+t74T7IGowHHTvt2kyTLZJ4MBVS6Yuzpkx+T ghcU8UuO9mhGaWF8XvNxUHkAf0NbymuDQFp94a0fgQ/uHARumz/wkXGet7zsauZtP5MvpUktPpRJy k9S73/XxGuZJ057Mr3avUKt94/b//cDgjSVSK7b6mwrVfVRRYqKLUobn1OF3wMKMoqm6csSkOMtTG Irezc6ZiVYychi4gP20w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1odBR5-00BB57-1I; Tue, 27 Sep 2022 14:19:47 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1odBQt-00BB01-T7 for linux-arm-kernel@lists.infradead.org; Tue, 27 Sep 2022 14:19:37 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 55209B81C15; Tue, 27 Sep 2022 14:19:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BD79C43141; Tue, 27 Sep 2022 14:19:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664288373; bh=OrKVJXEi8szo1hPh5xE6W+Cneq3FaibL95qCVvytrFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YpJLk43vHbkknbA/vtQbI3ZuQm6v/TldSs1KjQZlrFo25LJ63yd1wMNBr4hBFSYKy FoXeWNidnQwlea00LyNoSnOxiMgyLUSaQlOIXBMSZQ1DYNcsmHPgt1ecMyQTDVE7wO G1G3w0Jm/PQ6c8gVZqF7NHRGwV9rDjx22+Ctfvo8ypJiuh93IGgsuBVMdTXUKmrcOQ Ojzcf6FbewhvBf3rVYm2AW1HmllUFku9Kcf4hDF3dr649hb66UExASF64g+Dh+kAav gPztCPPhmmnbOBpN9cL01jXo0hxXxcvsP0tHWPEnHNfBSF7TWQWU8+0SIMkeJMQJ6h gvDgYiJ1UcKAw== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Lorenzo Pieralisi Cc: Bjorn Helgaas , Gregory CLEMENT , pali@kernel.org, =?utf-8?q?K?= =?utf-8?q?rzysztof_Wilczy=C5=84ski?= , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?utf-8?q?Marek_Beh=C3=BAn?= , Lukas Wunner Subject: [PATCH v2 01/10] PCI: pciehp: Enable Command Completed Interrupt only if supported Date: Tue, 27 Sep 2022 16:19:17 +0200 Message-Id: <20220927141926.8895-2-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220927141926.8895-1-kabel@kernel.org> References: <20220927141926.8895-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220927_071936_104431_8C30F475 X-CRM114-Status: GOOD ( 14.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Pali Rohár The No Command Completed Support bit in the Slot Capabilities register indicates whether Command Completed Interrupt Enable is unsupported. We already check whether No Command Completed Support bit is set in pcie_wait_cmd(), and do not wait in this case. Let's not enable this Command Completed Interrupt at all if NCCS is set, so that when users dump configuration space from userspace, the dump does not confuse them by saying that Command Completed Interrupt is not supported, but it is enabled. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Reviewed-by: Lukas Wunner --- drivers/pci/hotplug/pciehp_hpc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 040ae076ec0e..10e9670eea0b 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -811,7 +811,9 @@ static void pcie_enable_notification(struct controller *ctrl) else cmd |= PCI_EXP_SLTCTL_PDCE; if (!pciehp_poll_mode) - cmd |= PCI_EXP_SLTCTL_HPIE | PCI_EXP_SLTCTL_CCIE; + cmd |= PCI_EXP_SLTCTL_HPIE; + if (!pciehp_poll_mode && !NO_CMD_CMPL(ctrl)) + cmd |= PCI_EXP_SLTCTL_CCIE; mask = (PCI_EXP_SLTCTL_PDCE | PCI_EXP_SLTCTL_ABPE | PCI_EXP_SLTCTL_PFDE |