Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp862944ybl; Fri, 24 Jan 2020 10:55:32 -0800 (PST) X-Google-Smtp-Source: APXvYqzeF5NmyVsNODg6rcMO17J2ewdvDR0fZRmFNC9433SjJawS5nYtdrcj5deLREQiBwh+6sDb X-Received: by 2002:a05:6830:2361:: with SMTP id r1mr3603171oth.88.1579892132078; Fri, 24 Jan 2020 10:55:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579892132; cv=none; d=google.com; s=arc-20160816; b=C0kklfXXxOMyT2Qlg7PvQno1wMh7MwhaFvgPmMhKzmZby1wUq+KVumcCgHDfSTCT09 CtIszDJxOgIPJg1TyozlX49psuckTS/levoyUmXIdDxv+u4Fc5jdRx5EWisltaWVwchJ eR8+eVWiku9P13lffQlilzTzccoVE/ZRgY9lJHFKd7xqUV4GGQp5qEkdLoMkDeU1791t HM/fmSiYQfd/alixHXiOhoTjESAhgsCuzccnVpjTxB7JOThTa1hvZ715y3APqjsTZYLQ mR4/aKiixvOoGV2TK6vY6FHlMiPz1aKapiYe2CqMNQJmho3f/ZXAIeN5rH6fzDZAgR1h SXuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uJn9C43CaSkhWba7ORJdLwCr7k+bnqMRPiHufkPBia0=; b=IbsbndyQMcu9wZux6IM0gScU1hqNBY3ZMTi7aqptzD3PYVOFbIuAIOzypVrFDzJyyG zJP6fySHQ0MNSMhl7wGsUlGUkT3qOjgoY9InNIxwYgjNeim52mlyk2ah0uoWrfKaZ7Ik kpOO+rpZ5hR2XsRxdYMlgiwsZ0VNhnqOnH2XGG4uS9kUoWMo4FZomhrZNY2vi31A2cHD dvPbH+v9l7bIVzE7bxw7meCfK87f8cjv1f87fR5mrRPJ17CIEziUsNkfECH8I6cE2xav HS9Xaf58mSMG+in3NDRC29jsA+n/0VUInSlDj0U8EptY9gmtV/jGyKyL/DeYwpmT3Zaw K+8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f5AYV8i8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q131si164618oig.203.2020.01.24.10.55.20; Fri, 24 Jan 2020 10:55:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f5AYV8i8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404127AbgAXL35 (ORCPT + 99 others); Fri, 24 Jan 2020 06:29:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:47058 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404113AbgAXL3w (ORCPT ); Fri, 24 Jan 2020 06:29:52 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 096D820704; Fri, 24 Jan 2020 11:29:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579865391; bh=DfmKTsA14Lz/UZZvlOnpT5dIOIhTL3C6AddBbWu8GnY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f5AYV8i8a34JE2HsaJfxzJIKouzbvGERQpxdBhlCi+N7kG1T7pF9lC/yaFXmWTrpd JxnuDOC4jcdBD2N5m7e2HqiMq2SFZ+BzS5BneAYz82Mc+a7pRyGDtZRuxgyINE4EjV mo38yqiUw6k93g7dSzP3j2ybvW4fBWtUGxP2SXZg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lili Deng , Dexuan Cui , Marc Zyngier , Sasha Levin Subject: [PATCH 4.19 533/639] irqdomain: Add the missing assignment of domain->fwnode for named fwnode Date: Fri, 24 Jan 2020 10:31:43 +0100 Message-Id: <20200124093155.736363173@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dexuan Cui [ Upstream commit 711419e504ebd68c8f03656616829c8ad7829389 ] Recently device pass-through stops working for Linux VM running on Hyper-V. git-bisect shows the regression is caused by the recent commit 467a3bb97432 ("PCI: hv: Allocate a named fwnode ..."), but the root cause is that the commit d59f6617eef0 forgets to set the domain->fwnode for IRQCHIP_FWNODE_NAMED*, and as a result: 1. The domain->fwnode remains to be NULL. 2. irq_find_matching_fwspec() returns NULL since "h->fwnode == fwnode" is false, and pci_set_bus_msi_domain() sets the Hyper-V PCI root bus's msi_domain to NULL. 3. When the device is added onto the root bus, the device's dev->msi_domain is set to NULL in pci_set_msi_domain(). 4. When a device driver tries to enable MSI-X, pci_msi_setup_msi_irqs() calls arch_setup_msi_irqs(), which uses the native MSI chip (i.e. arch/x86/kernel/apic/msi.c: pci_msi_controller) to set up the irqs, but actually pci_msi_setup_msi_irqs() is supposed to call msi_domain_alloc_irqs() with the hbus->irq_domain, which is created in hv_pcie_init_irq_domain() and is associated with the Hyper-V chip hv_msi_irq_chip. Consequently, the irq line is not properly set up, and the device driver can not receive any interrupt. Fixes: d59f6617eef0 ("genirq: Allow fwnode to carry name information only") Fixes: 467a3bb97432 ("PCI: hv: Allocate a named fwnode instead of an address-based one") Reported-by: Lili Deng Signed-off-by: Dexuan Cui Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/PU1P153MB01694D9AF625AC335C600C5FBFBE0@PU1P153MB0169.APCP153.PROD.OUTLOOK.COM Signed-off-by: Sasha Levin --- kernel/irq/irqdomain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 0b90be3607249..6e8520a81dd86 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -148,6 +148,7 @@ struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size, switch (fwid->type) { case IRQCHIP_FWNODE_NAMED: case IRQCHIP_FWNODE_NAMED_ID: + domain->fwnode = fwnode; domain->name = kstrdup(fwid->name, GFP_KERNEL); if (!domain->name) { kfree(domain); -- 2.20.1