Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3722842pxb; Mon, 24 Jan 2022 16:20:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzh10rVUHbeJYKshw+DATA4kiFwPnFwMxWSqrsw4tiXBpsZ5eWJJKWz5UN8bdbBdHqldk8l X-Received: by 2002:a05:6a00:1693:b0:44c:64a3:d318 with SMTP id k19-20020a056a00169300b0044c64a3d318mr16101682pfc.81.1643069936411; Mon, 24 Jan 2022 16:18:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643069936; cv=none; d=google.com; s=arc-20160816; b=hGZrbG0fDvGj2LTeKUKrqaZhDGN6cVZ+ocYpjoPMvcM5JwJhXeBUgVkYpMRmvkLEdU ffsgBBnW6IS7rC42xtNnJyyUqVEkWmYMLgKchfOVzPW1QcRBHwe/zCwfHaLjVK7IJuiB NCyXESc4xjdWiPGEtXO300ssZh/MOyGnybUqhXRKEu28GM/Z+Wmwh10jPXXnQzrI8MRA mG/1bi2Mxx2K/GYGZD2UhUALjtRCBoF27ialAwwujIUhULxFiSe+MJ25ERhVf15amNr/ XbyrN2vI+VgyTdb00QS5ngUulgG6c6B6wSNQM5e0UzsZra9Eaia48xbqgk0vMunpKGzz vwjQ== 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=G/x7VuqRgdroWyaE2JxRL/5Ey+Vf0/1ywPMhCGdlOk4=; b=ZoEVcoqVHZIQ9r2DaaUACvDGkmqNmQPUVTolIkAnGD7jco9L19aeQsNAskDr8PpzdS dQRsk8VWwrAFDHrD6k7GDmGYJtjovlNAyhmvyaGlkAZrussdK0dU5R9hL5An+QvVazDq TBjuKRCcBwtYOCTI/y5V+yg9qv3nXDR5JYXF7OnvUTiNC3DBWRMKrADdZVz+mkZtjwlE PmWHHEMeAaQ1AiT0xPaZ2udNGEiARXcRHdsvDrBPXQmG1TskoB4klUObw+YuTl/10s88 M5nOaZ9Yk+2KGvldErbUPb/vHsCZQaw/YL2uLIBflJLDlX2vktqlLpibodLCvpanTBqr KJPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZyX7FGeb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si16318952plh.227.2022.01.24.16.18.44; Mon, 24 Jan 2022 16:18:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZyX7FGeb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2373444AbiAYANv (ORCPT + 99 others); Mon, 24 Jan 2022 19:13:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1585459AbiAXX2Q (ORCPT ); Mon, 24 Jan 2022 18:28:16 -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 B3CFDC06137B; Mon, 24 Jan 2022 13:33:22 -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 6FF85B81057; Mon, 24 Jan 2022 21:33:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F5EEC340E4; Mon, 24 Jan 2022 21:33:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060000; bh=83ctBQqKYvJoAd9wQ3c3uQz73mSpKbIn7Mp3jAIt8wo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZyX7FGeb8gKIl3u2pKw+5xa87vKm4QbyXrg1rvffkkKZ9WGWC8I84p9PfE6/F0xun rKkADoQGi3qGr0+aeGO3EsyzcGO4bQ7rWMT4TP49ka5BuQs/zqYC4espxdLiUSjCw3 UIJr+D3na7gb9jibxkQnBYkRLYJCSPk1LHoC4LXw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= , Lorenzo Pieralisi , Sasha Levin Subject: [PATCH 5.16 0806/1039] PCI: mvebu: Fix support for PCI_EXP_RTSTA on emulated bridge Date: Mon, 24 Jan 2022 19:43:15 +0100 Message-Id: <20220124184152.404506156@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pali Rohár [ Upstream commit 838ff44a398ff47fe9b924961d91aee325821220 ] PME Status bit in Root Status Register (PCIE_RC_RTSTA_OFF) is read-only and can be cleared only by writing 0b to the Interrupt Cause RW0C register (PCIE_INT_CAUSE_OFF). Link: https://lore.kernel.org/r/20211125124605.25915-15-pali@kernel.org Fixes: 1f08673eef12 ("PCI: mvebu: Convert to PCI emulated bridge config space") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Signed-off-by: Sasha Levin --- drivers/pci/controller/pci-mvebu.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c index 0052e83c95de9..618c34e8879ec 100644 --- a/drivers/pci/controller/pci-mvebu.c +++ b/drivers/pci/controller/pci-mvebu.c @@ -51,6 +51,8 @@ PCIE_CONF_FUNC(PCI_FUNC(devfn)) | PCIE_CONF_REG(where) | \ PCIE_CONF_ADDR_EN) #define PCIE_CONF_DATA_OFF 0x18fc +#define PCIE_INT_CAUSE_OFF 0x1900 +#define PCIE_INT_PM_PME BIT(28) #define PCIE_MASK_OFF 0x1910 #define PCIE_MASK_ENABLE_INTS 0x0f000000 #define PCIE_CTRL_OFF 0x1a00 @@ -604,7 +606,14 @@ mvebu_pci_bridge_emul_pcie_conf_write(struct pci_bridge_emul *bridge, break; case PCI_EXP_RTSTA: - mvebu_writel(port, new, PCIE_RC_RTSTA); + /* + * PME Status bit in Root Status Register (PCIE_RC_RTSTA) + * is read-only and can be cleared only by writing 0b to the + * Interrupt Cause RW0C register (PCIE_INT_CAUSE_OFF). So + * clear PME via Interrupt Cause. + */ + if (new & PCI_EXP_RTSTA_PME) + mvebu_writel(port, ~PCIE_INT_PM_PME, PCIE_INT_CAUSE_OFF); break; } } -- 2.34.1