From patchwork Sun Feb 20 19:33:35 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: 12752844 X-Patchwork-Delegate: bhelgaas@google.com 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5907C433F5 for ; Sun, 20 Feb 2022 19:34:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244637AbiBTTec (ORCPT ); Sun, 20 Feb 2022 14:34:32 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244644AbiBTTeb (ORCPT ); Sun, 20 Feb 2022 14:34:31 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 684AC522F0 for ; Sun, 20 Feb 2022 11:34:10 -0800 (PST) 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 203B1B80DBE for ; Sun, 20 Feb 2022 19:34:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09320C340F0; Sun, 20 Feb 2022 19:34:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645385647; bh=USBvD9DLVLa0KR+5ZLhHC1ELluxCbJ4w9lcGPdn0AU8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QJvjTbUR00QN1rQNyJHhLAo9fTawvaevOB6eBhO1uMOONaAONNo8DAGi1Kxva1wiO N5V3Q2QirT9sCQ6xB2jRSnLf8Tga1FNMm/vcBznJhpeLHKIDD+qFCy4hDnLIlXkkIu 999t9G85C7vL9q+YSxyepGI/qD3iWk9XN+YcUskgcn4Xhn9O9pWsF1iSfITZEiDxSK 5W7yvh/SUdIQU/xL6C/qDDPP6lfDKO2e6zO5KHt0Fk8GOfm1q0yyjERRzarO/jsZnI eJ2bdIK95sMkE5Ctsu7gu+Bbuqf/adW9Kk7z2bzobs4MfBsw/IMWVsiUyTieXUJXCC YG7SnxlP9XFvw== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Lorenzo Pieralisi , Bjorn Helgaas Cc: =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Marc Zyngier , pali@kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Gregory CLEMENT , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH 07/18] PCI: pciehp: Enable Command Completed Interrupt only if supported Date: Sun, 20 Feb 2022 20:33:35 +0100 Message-Id: <20220220193346.23789-8-kabel@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220220193346.23789-1-kabel@kernel.org> References: <20220220193346.23789-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Pali Rohár The No Command Completed Support bit in the Slot Capabilities register indicates whether Command Completed Interrupt Enable is unsupported. Enable this interrupt only in the case it is supported. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún --- 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 373bb396fe22..838eb6cc3ec7 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -817,7 +817,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 |