From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 908B1C433FE for ; Fri, 11 Dec 2020 15:26:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 45B9622D72 for ; Fri, 11 Dec 2020 15:26:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406465AbgLKPAA (ORCPT ); Fri, 11 Dec 2020 10:00:00 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:35590 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405385AbgLKO71 (ORCPT ); Fri, 11 Dec 2020 09:59:27 -0500 Date: Fri, 11 Dec 2020 14:58:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1607698722; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k8ncxYu+LcgOgQlBTC2mTy2zun3cadnzshLvN5xtE/A=; b=mHBr6qINZse/W5rKy+nZPgiX/GMhPDYTujgRND2IXhjp5j5YAp3M0sH/os8Qhikxg1wqhR p57uXkAqlBx5cvxLGvjZCYR4hR+D6/7TmwBEkH6tlMnBFsVjcnatGcoYVt7Jq1J7QZsOQ2 qXwnaaGjfKKczpho+VvCGlFmAOJ4YiT0oDRgTiIsvDbA75qDam+cdfO0LmzNBPdBkXc/zB YdvfldEVjX2wuyMaGKWWqRS+UN2uZTUYk0UCqjthnZvccKetqgl/yppVBk3wGTXrZHpxqg lw/87+agKdXHrWtY44Xfml5kAEQ88tBkxgrEP2SfizhjFk/hFWCu6Qdfae6naQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1607698722; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k8ncxYu+LcgOgQlBTC2mTy2zun3cadnzshLvN5xtE/A=; b=JB4geLCYVBpdBao76KQHcYCzXCadGLJjDHLWVMkkUyMDQgXLNs2z/FISPT7jekDRERKxfd rnqWTO46CQtwvhAA== From: "irqchip-bot for Marc Zyngier" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/gic-v3-its: Flag device allocation as proxied if behind a PCI bridge Cc: Marc Zyngier , John Garry , tglx@linutronix.de In-Reply-To: <20201129135208.680293-4-maz@kernel.org> References: <20201129135208.680293-4-maz@kernel.org> MIME-Version: 1.0 Message-ID: <160769872245.3364.12465233915684170533.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam: Yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: 34dd263fce3114147f21698f8e55e05b9e8185bd Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/34dd263fce3114147f21698f8e55e05b9e8185bd Author: Marc Zyngier AuthorDate: Sun, 29 Nov 2020 13:52:08 Committer: Marc Zyngier CommitterDate: Fri, 11 Dec 2020 14:47:50 irqchip/gic-v3-its: Flag device allocation as proxied if behind a PCI bridge An aliasing PCI bridge is another case where we should flag the corresponding allocation as "proxied", as MSIs are coming with the bridge's RID, and not the originating device's. Signed-off-by: Marc Zyngier Tested-by: John Garry Link: https://lore.kernel.org/r/20201129135208.680293-4-maz@kernel.org --- drivers/irqchip/irq-gic-v3-its-pci-msi.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its-pci-msi.c b/drivers/irqchip/irq-gic-v3-its-pci-msi.c index 87711e0..ad2810c 100644 --- a/drivers/irqchip/irq-gic-v3-its-pci-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-pci-msi.c @@ -67,11 +67,16 @@ static int its_pci_msi_prepare(struct irq_domain *domain, struct device *dev, /* * If pdev is downstream of any aliasing bridges, take an upper * bound of how many other vectors could map to the same DevID. + * Also tell the ITS that the signalling will come from a proxy + * device, and that special allocation rules apply. */ pci_for_each_dma_alias(pdev, its_get_pci_alias, &alias_dev); - if (alias_dev != pdev && alias_dev->subordinate) - pci_walk_bus(alias_dev->subordinate, its_pci_msi_vec_count, - &alias_count); + if (alias_dev != pdev) { + if (alias_dev->subordinate) + pci_walk_bus(alias_dev->subordinate, + its_pci_msi_vec_count, &alias_count); + info->flags |= MSI_ALLOC_FLAGS_PROXY_DEVICE; + } /* ITS specific DeviceID, as the core ITS ignores dev. */ info->scratchpad[0].ul = pci_msi_domain_get_msi_rid(domain, pdev);