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: 12752833 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 EA49EC433F5 for ; Sun, 20 Feb 2022 19:37:40 +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=GH36FIIPL9TLK8HPCLBCSFGY7FiiNOVKfcFhzqZ+D7o=; b=pPguuWge9v2G4C xgt4xli8/rptxT3XWuIgUXIOx3BY47m1FHNrMFNhhNn2mu3e2ALkd920VY4m6lSossx1eXYefDRAD oTfubXf+AsVCD4GlYb6A7czEBfLvD883YD7DlQaBRCt3+dasGkbFxx/XyPMW/hR3nfESmWHcOHw17 6bKiCdxcN9EScn5rQFgvjKxWI6+qMgFEnLsu/fEQJbXgyOGK6ZyILWZ0+bt4UYMAxxmXiKZ4qLwcv qkHizFcNLc7gxFhvZJKrHcK6YN0KvMzLT54h+SwsAJ44/crCG9++dYe49CkBqkDmy5CworKEb2Z2g WVxR5WfgLps3C6mknrRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nLrzn-002Bx4-99; Sun, 20 Feb 2022 19:35:47 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nLryC-002BCN-U5 for linux-arm-kernel@lists.infradead.org; Sun, 20 Feb 2022 19:34:10 +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 dfw.source.kernel.org (Postfix) with ESMTPS id 782BE60EEC; Sun, 20 Feb 2022 19:34:08 +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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220220_113409_046611_0DF3DF09 X-CRM114-Status: GOOD ( 11.23 ) 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. 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 |