Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1484715rwb; Fri, 12 Aug 2022 01:29:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ENtBCjZwWOMeDHceKKgT/kZXRhyC+3GgdiswlFmxyJCG0prCmfzrAliMHOFlM5y/GQeD4 X-Received: by 2002:a05:6402:13c1:b0:43b:e330:9bbf with SMTP id a1-20020a05640213c100b0043be3309bbfmr2584428edx.417.1660292975258; Fri, 12 Aug 2022 01:29:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1660292975; cv=pass; d=google.com; s=arc-20160816; b=Soo32AzLBQpl3juHs2FYUMZKFbhaYwgpOuJB8Ydiq36SaRPu0cNkgQ02TRzTodn4Ql yA8ko/fOg5Qc8COZFjx7DuM6JCPVvxArSydjQ7fJw+aIo3VpfN+8MUcKm80pHKj4/9o3 lCjtmO54nGdtW4/JHk8ZMvjpciz7/CFd4CW/jRl80aKgZoqYuyorIROimnBKwLRZokDe vEl7fUbsOUsq9784U0dhTvLi5LGn7jRxL0woAnBBxPXBk5WNwRQWC9Wm5kKw7Hpv1jo+ CgQqHyu2dFllEomEwK1b3cx+k+sr09OkvsS59GYJ9flcl95GO3T0SKKayw/CJzWxzxkP Lv8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=yOnV7Cs3Yw7a8zUFT+xUGraX941EPUc1fBlp2Ts2Q9Q=; b=gUTtn/TIZY0AETG0GqvuXORIV7JojpQ0ekzj2v0V0yOhaZr7DcZk5he7u5xi3fdLoZ jvve0IUmYTZGfgkWwnmv4D5OHGVw8fPT+VOUQ/Hg1VPXtsKBA6A21i4cVy7tdBc2sclQ J43VYHXp3hyxCEXAFZOPGzLsdMMwctKcHm4nN8ymSBV4c5ZEkTdJ/kjj1QSYPfXkiSC6 VsCeUVm1mip3ppNdWfFmbWOm0Vi6WqIit6L9VZGzMg+gPXKRkU+2MRjGyaQmjqDYfZD0 1q2HOaZ9jMnkqV//3sd6H3wOnKbh/H6PQ6ZWM2OSDNMixCFVNNEVJLWVjL9CX5all2d5 Lh2g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=IZrzvAZc; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gi3-20020a1709070c8300b0073319834e99si974206ejc.455.2022.08.12.01.29.09; Fri, 12 Aug 2022 01:29:35 -0700 (PDT) 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=@nxp.com header.s=selector2 header.b=IZrzvAZc; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235743AbiHLIOC (ORCPT + 99 others); Fri, 12 Aug 2022 04:14:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbiHLIOA (ORCPT ); Fri, 12 Aug 2022 04:14:00 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60042.outbound.protection.outlook.com [40.107.6.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BB6CA8328; Fri, 12 Aug 2022 01:13:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Aqi1pYDlbks0AFo9sN8uHmrRZQQnZrGabHhkhFLQGv6oOskgZhql0547KNzUWv2UgzFHBBq9zx5yavhKthW4s86lbn4QJmE+wZQ+cCxLpc1YUUJgKbe1U0peFHN+pBdwAiX9YI2TkAJVZklg6pRC5fvoJbNC1Dib9cO6W0koXp9V7AlBABDfu/lfUt672Wbf8xA2P6f4cXGmNQDkFV54hqklV8/55w7aFOg+1UQm+/ZjWBfI8DXZ5AnY/4wESnRP8uSOEFvt7qNyex7TZXZ3/0jdFJVUpPc539mWCPedQzOWEqV6840AGQSow1J8KsCn3pt01o5VOk/2xOFL5am6Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yOnV7Cs3Yw7a8zUFT+xUGraX941EPUc1fBlp2Ts2Q9Q=; b=BjSF3FFkGILA3YEa7eolv9UokcS9Ub4Kps+pmneCToc9KhNzdraL+QxHB80ylFfyS/TJcGdWL0CI8+Iqhn7DBHIBhQdjlF/AjHxyevqO3//kJ6y+1wTjwASGvJQbqXzQ25CJ55rg1pzhni1PczjMDTIiW7t4F+yhMFxLfZ3dTjEsZ6Ks+W9bs6m4Lr/ShpjVT0wwla4D3mEktgT8tmRx1VNnZjBNzrhG18lE6HjsH/l2ZNh5WLR5SiLUNd8FwL0ehDsv6q1ooxk9tNialVEFpi3UibMGj6+smVHLcSS7uCZgcL+X0cgOa6pjGeuTjxWjfH3UjlDgiwX1cIR8whaD/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yOnV7Cs3Yw7a8zUFT+xUGraX941EPUc1fBlp2Ts2Q9Q=; b=IZrzvAZcYa62fLBR2MlU7gNOspap7EqpkKoZ2I+eA6ucBSWN7mMTcYihjtd5gck80ywJ568eXOSKxFaHVqFJM0fOXUEoo/UB7bBW106JXh6K5XfmkpogJP9z0fAjBWV/mHzLo01EGFh2xxI07+C90INxsYG5vkee1TCKFPeVSSM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by DB8PR04MB5657.eurprd04.prod.outlook.com (2603:10a6:10:a6::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Fri, 12 Aug 2022 08:13:55 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::2549:869e:d80b:3a1b]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::2549:869e:d80b:3a1b%6]) with mapi id 15.20.5504.022; Fri, 12 Aug 2022 08:13:55 +0000 Message-ID: <9349e633a64a2275857b2c08731e40721e5af82b.camel@nxp.com> Subject: Re: [PATCH v3 2/3] drivers: bus: simple-pm-bus: Use clocks From: Liu Ying To: Geert Uytterhoeven Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux ARM , Linux Kernel Mailing List , Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , NXP Linux Team , Saravana Kannan , Greg KH , Krzysztof Kozlowski , Rob Herring Date: Fri, 12 Aug 2022 16:13:41 +0800 In-Reply-To: References: <20220804061133.4110734-1-victor.liu@nxp.com> <20220804061133.4110734-3-victor.liu@nxp.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SI2PR01CA0019.apcprd01.prod.exchangelabs.com (2603:1096:4:192::12) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f8730cd7-5344-4b40-bb0d-08da7c3a9993 X-MS-TrafficTypeDiagnostic: DB8PR04MB5657:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F5oNpfipDiYrdKVXNa/bt9bISHBKyDPum60L8GFu+HH342YhiV3VXmIUpoHo9trGjj6YzZ1hCtHVG6fAcQGlGN9PMUUleX5lQF6/QYQaweyZBO9IgCHsYYIxOe4SB3V/m1usRQTPRCSo3yYal5dNoSt3yiAvmuLXn+3UDMNTsC7dajPsgTn5EfaGU8njeTcECBm/XRwiW/OriMh3JUDh3/KTFZmXNdwbupbaL+hynjCrCJgmT9YPOATTXKRBtf91ffttaTi6Qi7oApBG14TsqMrEC8UBN71dXxXUxbYN0nsx2sTaHrMK2+j08VV1FKAILUsOr6/liA7oq4O1dJeMc8TQ3K8rKn80NpF4JNOBRD6OgDMYeLU1Lvig7E3urAXt3s84HYZWL0GO8Hwnw4vFmczSGbhdIsyt6edxjyFd08rY0WKoBMxJMT4l+QAVyy+vco7P1FE8AxJwCDxTfL9W3vifxuM3oyZzOwvYtizdtlFKhnfAITKQ0QbC8MJCZT1pZmzsuKgX0/hsjhE70Gq0MmREaP6cwDn3z9iRjeb6FbfCobngTDkQJeYtQnSd4V7Zg3oNJRgIrw8iySq6AM9G5TK8+QcaS9ggf80Mk1k43uJg52AYjalzDClMjcoXkPsoIV1DqeNLV8gUrxsoXIExA0AQFTuLP/hRCa3yw/1fCLZb+HBWqgspruzcSyLQTPBpQdlmP8nNF2SjloWHhSOOSYdQgv0J2qXXdG7wDQZ5IauN7p4Gh49yhOgpZsx+JUU2wvmznblpNNXUMHYr1X/3EQ4mfPrGrSozCpa9NoIDovwVAQvDpIf3iIEQCuVfmNLb9fhEVSwjAWWcxJZ/qXa+TQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(376002)(136003)(39860400002)(366004)(346002)(396003)(66556008)(4326008)(8676002)(83380400001)(41300700001)(6666004)(6916009)(66946007)(2906002)(316002)(2616005)(54906003)(36756003)(186003)(38350700002)(38100700002)(66476007)(26005)(6512007)(86362001)(8936002)(52116002)(478600001)(6506007)(5660300002)(6486002)(53546011)(7416002)(99106002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dWFxdGx0QVlHcUNJN0p6d3lhRng0ZWRSSHVVd1gyNXdTRmxyeXRuV0JreTRn?= =?utf-8?B?SlNjamREeHlVUVdSVUZiTlFhRGpiQ2ZaMHI2NHdQRnlnWnFXYjljZ3FWanR0?= =?utf-8?B?L2xXRnlLUzVpaUNTRXRHdTRqMGRrMmxUWVhiTTRFTWVRNXZWaWpjeUpYNTZq?= =?utf-8?B?R1ZmUlBvMEw5MWgxdHAvdWJ2MnJ6alhBV1VEZW4ybXduZ2o2Q1VmZVA2a2ZE?= =?utf-8?B?KzUvNDFwZENqbU81YTRnV1lOV3F2MW1hNVFxUFhGVXVFYUdRSUNRUlNDSnNt?= =?utf-8?B?QVpzRURzMEpKMU90Tlo0SVdRMVpzQzlGWU8rNGZEcmJsZmtnTzNuTGMzOGFD?= =?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Org: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8730cd7-5344-4b40-bb0d-08da7c3a9993 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2022 08:13:55.5232 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9lHCi0YufJSSMBTihJEck3+hg8cYrhl9PVLznVA04qb9VHVCg+wA3PZI8KPi48fAo74+7chwhHHmiFGTgdc6rA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB5657 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Thu, 2022-08-11 at 14:34 +0200, Geert Uytterhoeven wrote: > Hi Liu, Hi Geert, > > On Thu, Aug 4, 2022 at 8:10 AM Liu Ying wrote: > > Simple Power-Managed bus controller may need functional clock(s) > > to be enabled before child devices connected to the bus can be > > accessed. Get the clock(s) as a bulk and enable/disable the > > clock(s) when the bus is being power managed. > > > > One example is that Freescale i.MX8qxp pixel link MSI bus > > controller > > needs MSI clock and AHB clock to be enabled before accessing child > > devices. > > > > Signed-off-by: Liu Ying > > Thanks for your patch! Thanks for the review. > > > --- a/drivers/bus/simple-pm-bus.c > > +++ b/drivers/bus/simple-pm-bus.c > > @@ -8,11 +8,17 @@ > > * for more details. > > */ > > > > +#include > > #include > > #include > > #include > > #include > > > > +struct simple_pm_bus { > > + struct clk_bulk_data *clks; > > + int num_clks; > > +}; > > + > > static const struct of_device_id simple_pm_bus_child_matches[] = { > > { .compatible = "simple-mfd", }, > > {} > > @@ -24,6 +30,7 @@ static int simple_pm_bus_probe(struct > > platform_device *pdev) > > const struct of_dev_auxdata *lookup = > > dev_get_platdata(dev); > > struct device_node *np = dev->of_node; > > const struct of_device_id *match; > > + struct simple_pm_bus *bus; > > > > /* > > * Allow user to use driver_override to bind this driver to > > a > > @@ -49,6 +56,16 @@ static int simple_pm_bus_probe(struct > > platform_device *pdev) > > return -ENODEV; > > } > > > > + bus = devm_kzalloc(&pdev->dev, sizeof(*bus), GFP_KERNEL); > > + if (!bus) > > + return -ENOMEM; > > + > > + bus->num_clks = devm_clk_bulk_get_all(&pdev->dev, &bus- > > > clks); > > > > + if (bus->num_clks < 0) > > + return dev_err_probe(&pdev->dev, bus->num_clks, > > "failed to get clocks\n"); > > + > > + dev_set_drvdata(&pdev->dev, bus); > > + > > dev_dbg(&pdev->dev, "%s\n", __func__); > > > > pm_runtime_enable(&pdev->dev); > > While I agree this patch has merits on its own[*], I am wondering > if you really need it for your use case. > > In "[PATCH v3 3/3] dt-bindings: bus: Add Freescale i.MX8qxp pixel > link MSI bus binding", I see your bus has both "clocks" and > "power-domains" properties. Perhaps your PM Domain can be a clock > domain, too (i.e. setting GENPD_FLAG_PM_CLK and providing > generic_pm_domain.{at,de}tach_dev() callbacks), thus handing clock > handling over to Runtime PM? It looks like most(if not all) PM domains can be clock domains with GENPD_FLAG_PM_CLK and generic_pm_domain.{at,de}tach_dev() callbacks set. So, technically, my PM domain(scu-pd.c) can be a clock domain with all those set and a special check for "simple-pm-bus" in the {at,de}tach_dev callbacks. But, I'm not sure if it is appropriate to do that. How do we determine clocks should be managed by PM domains or device drivers? Technically, both would work... > > [*] The simple-pm-bus DT bindings state: > > clocks: true > # Functional clocks > # Required if power-domains is absent, optional otherwise > > power-domains: > # Required if clocks is absent, optional otherwise > minItems: 1 > > While "power-domains" (+ "clocks" in case of a clock domain) is > handled through Runtime PM, the current driver indeed does not handle > "clocks" in the absence of the "power-domains" property. It looks Right. > like all existing users that use "clocks" rely on the PM Domain being > a clock domain. "renesas,bsc" seems to be one of the users. > > With your patch, the clocks might be controlled twice: once > explicitly, > through clk_bulk_*(), and a second time implicitly, through Runtime > PM. > While this works fine to do clock enable counters, it looks > suboptimal > to me. This could be avoided by making the new explicit clock code > depend on the absence of the "power-domains" property, but that would > break users that have both a PM Domain which is not a clock domain, > and clocks. So we may have no other option. Hmm, I'm not sure if there are really users that have both a PM domain which is not a clock domain and clocks, given that a PM domain can sort of always be a clock domain by setting that GENPD flag and those callbacks. So, what do you suggest? Keep the patch as-is? Or, maybe, make my PM domain additionally be a clock domain? Regards, Liu Ying