From patchwork Sat Jan 27 16:17:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13534138 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 4126FC47DDF for ; Sat, 27 Jan 2024 16:22:02 +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=YcHVLWfwixV8mxW8P//6sWAVjctDcmBRijzxaRjlS4s=; b=5E/Z1/L6ZTNkxs f4U0cmnVUURSN10yF+ex6L20YASSw9biGbOtYwlHDw9eFE3Irn0kYYR3sVYxwo9l0s0+AdoWb7BuP wyjd59/Wl1QRd6HDrR+ONlnmhgyPjHv2atfM0aCP58rTVJ9HoHU83SsTy2plv8+yxYNFgkArBzrcO PSxIXb/XzDF6/qEVkaOmPHPbNGrEaFv3PFeNGaQ71r2oRSVpT+hW7PXS/Kqp2AREOEot5eL7JeWqa 3dZ5/WJayx//50Kn8NaUAbpUn87b7487KgEmgwsnHv0Q3WN92K/HaHltj1grosZpta/fM1OTrnvpJ X37vktfSDeL5o9YU+LcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTlRI-00000007mHS-1Yd8; Sat, 27 Jan 2024 16:21:52 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTlP2-00000007kkQ-1Urj for linux-arm-kernel@lists.infradead.org; Sat, 27 Jan 2024 16:19:37 +0000 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-290d59df3f0so1097938a91.2 for ; Sat, 27 Jan 2024 08:19:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1706372371; x=1706977171; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pa75apFvoQqeTQYHEjcSyJSyGrlM+GD5Ss5R8F0skYA=; b=SvxaAW01mU5uaXhhSXf/d+aK8BAX5z3Ti/MX8vBfPeiKRBPYISp5fYxnHWEmgnBG0q gnWxLOu57DnvpAdreCk4orL6sEwg/NxqFZbxK1WcG0FfRwYSWy89/imNHSc0m8IPCmAG 6xpLmJfKRrag4L4tH1AiWBqa/VWij3tswj/f3MCs7M0xldu8pmk9dILFDnKNsk7tRZ4i 55y6ZL7G9DMu+cXupDhMLJ9eqrfTpcC1mXRvtP3V1CI+PyoIutHbhoy5WSojAXijaHEm hVnipfy61PU8hWgL3igN+FzKJViM+vJod5ubCo7P1ZY/ufXUUKLGl8ub7yoJL/vyKWbU C4HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706372371; x=1706977171; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pa75apFvoQqeTQYHEjcSyJSyGrlM+GD5Ss5R8F0skYA=; b=wLf8bUOjSLdARhvK7mdaSyAn14DrSJYt9e9WYoi0rg/43uUNisRp5uJ0X3P/EeqrxK 35+GGAuxGLOtBkD6BjIxPb6JqZ3uROG/i4YEGi500DJZCFfSZxdUznnXjTonU84Ma+Yp cbbioWgMJQQ9DByhW0hhofAZ+Q75fvt+F6g9Hw7DUq9u5OUnPwdtoH1ASLyXLxkdI8Oq n+tgQg0r8Tq0fuL6EpCcktWbVEkkUyvfhDo5+LgBuK4DyYLlfOgoUoAch0HFO7XtyjCh FS5MbS+rEZqEew6H8z6AuiWwQS0vpWmTFqqm/U0ZmriGsCDHUPGyTQZTbxSPtzTU3HWS LW0A== X-Gm-Message-State: AOJu0YwY+9bGX+8Yqk3jWh6nOqzZ40JuXd3L2ZSkZlsgdzmvrG3l9gQ2 sOt74ulCrKj9HKrU2lDmrKWkqNNnNAGzGRaXH0icTKv0MMs2zS6rNe5mUKFgh/8= X-Google-Smtp-Source: AGHT+IE/rJ2r2skLkyRBRQ7dQ1nBUrmMrx5hJrAYD8oWBMwqSdt16t4NKyP2y8H/3zZRRkEi017a7A== X-Received: by 2002:a17:90a:72c6:b0:28e:8b5f:6406 with SMTP id l6-20020a17090a72c600b0028e8b5f6406mr1198317pjk.87.1706372371612; Sat, 27 Jan 2024 08:19:31 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([171.76.86.17]) by smtp.gmail.com with ESMTPSA id d11-20020a17090ac24b00b00290f8c708d0sm5091620pjx.57.2024.01.27.08.19.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 08:19:31 -0800 (PST) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Frank Rowand , Conor Dooley Cc: Marc Zyngier , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Atish Patra , Andrew Jones , Sunil V L , Saravana Kannan , Anup Patel , linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel Subject: [PATCH v12 13/25] genirq/msi: Provide MSI_FLAG_PARENT_PM_DEV Date: Sat, 27 Jan 2024 21:47:41 +0530 Message-Id: <20240127161753.114685-14-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240127161753.114685-1-apatel@ventanamicro.com> References: <20240127161753.114685-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240127_081932_753463_BF2379F4 X-CRM114-Status: GOOD ( 15.53 ) 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: Thomas Gleixner Some platform-MSI implementations require that power management is redirected to the underlying interrupt chip device. To make this work with per device MSI domains provide a new feature flag and let the core code handle the setup of dev->pm_dev when set during device MSI domain creation. Signed-off-by: Thomas Gleixner Signed-off-by: Anup Patel --- include/linux/msi.h | 2 ++ kernel/irq/msi.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/msi.h b/include/linux/msi.h index ac73f678da7d..b21581ca8e9a 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -554,6 +554,8 @@ enum { MSI_FLAG_FREE_MSI_DESCS = (1 << 6), /* Use dev->fwnode for MSI device domain creation */ MSI_FLAG_USE_DEV_FWNODE = (1 << 7), + /* Set parent->dev into domain->pm_dev on device domain creation */ + MSI_FLAG_PARENT_PM_DEV = (1 << 8), /* Mask for the generic functionality */ MSI_GENERIC_FLAGS_MASK = GENMASK(15, 0), diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c index 07e9daaf0657..f90952ebc494 100644 --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -845,8 +845,11 @@ static struct irq_domain *__msi_create_irq_domain(struct fwnode_handle *fwnode, domain = irq_domain_create_hierarchy(parent, flags | IRQ_DOMAIN_FLAG_MSI, 0, fwnode, &msi_domain_ops, info); - if (domain) + if (domain) { irq_domain_update_bus_token(domain, info->bus_token); + if (info->flags & MSI_FLAG_PARENT_PM_DEV) + domain->pm_dev = parent->pm_dev; + } return domain; }