From patchwork Mon Nov 21 14:40:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 23868 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1645533wrr; Mon, 21 Nov 2022 07:10:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf42WnZ7eZfWlDfdQ8EDL9rsTVcA49AIPsSnk9ERg6WB1p+BW0ZpCSNwD6CQAIAqaq1UL/Fk X-Received: by 2002:a17:907:8b93:b0:7b4:f258:6196 with SMTP id tb19-20020a1709078b9300b007b4f2586196mr2841678ejc.524.1669043436011; Mon, 21 Nov 2022 07:10:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669043436; cv=none; d=google.com; s=arc-20160816; b=qyzu4bG1SjVi+kgfvuIlYnaPt+q5+PAPdiMKt11tPppl6ulRRVlURcWPDswvyINZRY 7gD47Zsfwtt0IAjieFnzwEYKoKOY3jonNwHT9Z6gaYU3W7ZR6Y7luul9NlfAy+9F/DTY me33n8XCUWY//8vcyUfWvkO/4fPCrlLMxPi8pLj2R3UJwYtDH71TvQMpBXOIFxqZfokb fERUfeZRhlaowKS9svwpLg7KWHkNnLa6y+SKmjOA7bCVFV3On2Y2Afugx/3ZF+cTwDbA sr8lRLJuMiVp1ssEwU9RaccVbEOHHSMw5PFX5hFYlB0cLT2ezOcGBSQyTWOV3nNDFNAv EAnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=BsahiWAKXFVJNJh44POfSovZLxdrhfjFryH8JdnSUvg=; b=HWIIdFm4Kn0nqyBTsMmQRC/1DMbhpAReEf/yxZB9OLnqMSY1w63FsWEcp9ubtpsE2r 9wn3YprSeqUyYlpxjoQ70RuSm8+8CmR1HwgWwtdeOGqjbkQ0OZTIN1VgMc2cR4ph8qCL MQMKCalWatvx4yZRsFiBsjOlJGKpp6xo7+WbjHECh1Z4lieZq9xCjN42niBF/z7sCe0e hyRwLj54QElKZ61TftbhhY0pr7vjLxmOYDv31DXePVG5lFlSObMNv+9Q7wNIDjwBTGcG MwGLowmkxjAbd62OLhu3IDwZNXuuc4TtIPLb6tcC4gXy+/+9TQX1tdbfoonqcMMiGZOz hYbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=PR53tmTt; dkim=neutral (no key) header.i=@linutronix.de header.b=HQ5Yx+4U; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k22-20020aa7c056000000b004697dff9638si2797174edo.87.2022.11.21.07.10.09; Mon, 21 Nov 2022 07:10:35 -0800 (PST) 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=@linutronix.de header.s=2020 header.b=PR53tmTt; dkim=neutral (no key) header.i=@linutronix.de header.b=HQ5Yx+4U; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231950AbiKUOvZ (ORCPT + 99 others); Mon, 21 Nov 2022 09:51:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231324AbiKUOul (ORCPT ); Mon, 21 Nov 2022 09:50:41 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA6B0C1F49; Mon, 21 Nov 2022 06:42:48 -0800 (PST) Message-ID: <20221121140050.322564760@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669041608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=BsahiWAKXFVJNJh44POfSovZLxdrhfjFryH8JdnSUvg=; b=PR53tmTt10lyQW8LlIx/PyT+1Nwg6hlPDXIQcLRf5Q22DV1dMMXq8ggOlWrdIN2B0Gk+en BLEYhIeWc0u73XGOG0S5eSnH4U91VqDWy+tCRIFBLy3528SNFP2T+9AsdU4nx/8BzK0AIy 6JqgDVGRTua3bU+CAr4StsXEuRVfqCwSwNzq8EIyg89676MuCUb9RwNxryWEbZQ3OCNHtD v5U1IcmeCzeVkYJXmzJ2h8iUSNZet81amIAwvi3AwkII7DTKtN5bhX6VgpNsoDFvSvDg81 bphqeOprxQq9kras4E8qEN9rA3Nvm5s3du7g6IkbpjLXXyobrzsXzsPLfeH/YA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669041608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=BsahiWAKXFVJNJh44POfSovZLxdrhfjFryH8JdnSUvg=; b=HQ5Yx+4UF17bUmcln2P+uBe4p0mVVcmgNYPOgbUkeviPuXl5M6nQ/kBiImIbMI7aNTdljT rKTZG/Cs8/s2gUCw== From: Thomas Gleixner To: LKML Cc: Will Deacon , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Greg Kroah-Hartman , Jason Gunthorpe , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Ammar Faizi , Robin Murphy , Lorenzo Pieralisi , Nishanth Menon , Tero Kristo , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org, Vinod Koul , Sinan Kaya , Andy Gross , Bjorn Andersson , Mark Rutland , Shameerali Kolothum Thodi , Zenghui Yu , Shawn Guo , Sascha Hauer , Fabio Estevam Subject: [patch V2 32/40] genirq/msi: Provide MSI_FLAG_PARENT_PM_DEV References: <20221121135653.208611233@linutronix.de> MIME-Version: 1.0 Date: Mon, 21 Nov 2022 15:40:08 +0100 (CET) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750118889853340161?= X-GMAIL-MSGID: =?utf-8?q?1750118889853340161?= 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 --- include/linux/msi.h | 2 ++ kernel/irq/msi.c | 2 ++ 2 files changed, 4 insertions(+) --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -538,6 +538,8 @@ enum { MSI_FLAG_NOMASK_QUIRK = (1 << 7), /* Use dev->fwnode for MSI device domain creation */ MSI_FLAG_USE_DEV_FWNODE = (1 << 8), + /* Set parent->dev into domain->pm_dev on device domain creation */ + MSI_FLAG_PARENT_PM_DEV = (1 << 9), /* Mask for the generic functionality */ MSI_GENERIC_FLAGS_MASK = GENMASK(15, 0), --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -884,6 +884,8 @@ static struct irq_domain *__msi_create_i if (!domain->name && info->chip) domain->name = info->chip->name; 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;