Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6258719iob; Tue, 10 May 2022 14:11:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1F9zoQEiLqXzaEeLA0xTbH2uW91a/+tko6dAlsZp9XZCfYEu9bMv6EtXH7wNBjfLZH9CO X-Received: by 2002:a17:902:f68d:b0:15e:bd3c:43da with SMTP id l13-20020a170902f68d00b0015ebd3c43damr22027182plg.164.1652217076956; Tue, 10 May 2022 14:11:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652217076; cv=none; d=google.com; s=arc-20160816; b=zwHxRbgA7tqnTPYFGEBVT0kJXtk7lB9CGxxR0yQC1LseX7DpHnG2o1ZzAMzS0n9mKa 6iq1OG3o3Ojr1j7NeLHT1buukhp7qpheOKVOm8zEIWZDh9UzHCmhm/IicfNsdtzSkNJ8 fiDteDjqINTblxESgAykrf+3UanwXs99HTvMg0jKKcxpisGk5Cs822/876Y4O2q5Ha/I VacgfztjbUVNLfQYULZVsOtCKqDUFAndw6J9aEN98OLJnZnYgZ1pGnQ3VqVjoGS7vwt5 vBgTmgHfhKT5najETn8ptPunEZR6kZz9ek6fNVO0ixAOGuyLYZt5sModPqSdd55uJ9PP V20w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=e2NRd625vgOrvfX1AwnguEkXhNljwzzSy9dg3EdEg7o=; b=eS/6WUVPYHnwfhyIfAaBL2s/1QELIdivZK5XM34JzciH8sIIOYoD5e7ymjIQcMf//E O1rXiTUxGLxXlYzBwY9zqfo+QQdFADpPxc12BFMifP+wX3uY/5DW/D38PKOhAp0ZkSbh cYsrfujbbVkddgryO0hFvImRpx+8xExf/OMATuCdqhYt6OfPW38jg3Y3UGJai0ABxEUf UUrO1OZAy0h0rMjoGIgqUQnIveilhZYCWiyl9ezrnE5DZ1ZAYtTkt9qSG2Aui7fA/S78 sPa73g/ZdJrALJH0UJRyPZkwvjajPxgQaiCIsFKGHAHIJQlY5Jajts/mKNUAzkOm1W2E Q51Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=N9FdNBXa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w7-20020a634747000000b003db034cfa69si442395pgk.489.2022.05.10.14.11.00; Tue, 10 May 2022 14:11:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=N9FdNBXa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344662AbiEJOfm (ORCPT + 99 others); Tue, 10 May 2022 10:35:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245550AbiEJOIe (ORCPT ); Tue, 10 May 2022 10:08:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3812F2E73B4; Tue, 10 May 2022 06:42:39 -0700 (PDT) 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 C8FE0617E4; Tue, 10 May 2022 13:42:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF0A2C385C6; Tue, 10 May 2022 13:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652190158; bh=sZ7rrt6H3SEz8xe8MVqWCtwsQWhqszzZV5Hksn0L4yo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N9FdNBXaW9l9ZQbf8LLzR+hS9i43yytFLbCqPvi1bBAy1nUG18rNDF0tCy87FDPur BdL5JrWM307LivJYNKdREflYsjMYGWHUn+NYDLI0Jtg/uN5cc5h4NZPGhVQXg9c+NW hMlMhq2N6iPAYTVplaiYe0GZc4ImeITOzO2y9+mk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, pali@kernel.org, =?UTF-8?q?Marek=20Beh=FAn?= , Lorenzo Pieralisi Subject: [PATCH 5.17 134/140] PCI: aardvark: Add support for PME interrupts Date: Tue, 10 May 2022 15:08:44 +0200 Message-Id: <20220510130745.422812081@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220510130741.600270947@linuxfoundation.org> References: <20220510130741.600270947@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pali Roh?r commit 0fc75d87454195885bd1a81fc7e6ce92572b6109 upstream. Currently enabling PCI_EXP_RTSTA_PME bit in PCI_EXP_RTCTL register does nothing. This is because PCIe PME driver expects to receive PCIe interrupt defined in PCI_EXP_FLAGS_IRQ register, but aardvark hardware does not trigger PCIe INTx/MSI interrupt for PME event, rather it triggers custom aardvark interrupt which this driver is not processing yet. Fix this issue by handling PME interrupt in advk_pcie_handle_int() and chaining it to PCIe interrupt 0 with generic_handle_domain_irq() (since aardvark sets PCI_EXP_FLAGS_IRQ to zero). With this change PCIe PME driver finally starts receiving PME interrupt. Link: https://lore.kernel.org/r/20220110015018.26359-17-kabel@kernel.org Signed-off-by: Pali Roh?r Signed-off-by: Marek Beh?n Signed-off-by: Lorenzo Pieralisi Signed-off-by: Marek Beh?n Signed-off-by: Greg Kroah-Hartman --- drivers/pci/controller/pci-aardvark.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c @@ -1478,6 +1478,18 @@ static void advk_pcie_handle_int(struct isr1_mask = advk_readl(pcie, PCIE_ISR1_MASK_REG); isr1_status = isr1_val & ((~isr1_mask) & PCIE_ISR1_ALL_MASK); + /* Process PME interrupt */ + if (isr0_status & PCIE_MSG_PM_PME_MASK) { + /* + * Do not clear PME interrupt bit in ISR0, it is cleared by IRQ + * receiver by writing to the PCI_EXP_RTSTA register of emulated + * root bridge. Aardvark HW returns zero for PCI_EXP_FLAGS_IRQ, + * so use PCIe interrupt 0. + */ + if (generic_handle_domain_irq(pcie->irq_domain, 0) == -EINVAL) + dev_err_ratelimited(&pcie->pdev->dev, "unhandled PME IRQ\n"); + } + /* Process ERR interrupt */ if (isr0_status & PCIE_ISR0_ERR_MASK) { advk_writel(pcie, PCIE_ISR0_ERR_MASK, PCIE_ISR0_REG);