Message ID | 20230125083248.1305270-1-victor.liu@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp163443wrn; Wed, 25 Jan 2023 00:32:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXtHfvCpI3ZWyV0w8zHOylQ1gwfcvdrAm9OPmEHQ1hQfFYvLIu04jZVlK9M/b4gCzRGRpusa X-Received: by 2002:a17:903:1210:b0:195:e86b:948b with SMTP id l16-20020a170903121000b00195e86b948bmr24765558plh.50.1674635551253; Wed, 25 Jan 2023 00:32:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674635551; cv=pass; d=google.com; s=arc-20160816; b=B3rtrnIVff2lrJq4bkAoaZpYyhRlPfW21fA2bqUaHsdz3FdI4v13OA41RvASFHCT3V d6mvEc60Ggk9jQyAdWHhLFG6MI0keLXC8vjm+dTiP/NrUHNvvZpPdeGGdOOaMpFxMjpH qZ+O8Kqe1u0BYOI3v/2I7y2s7hEA+IcFY2utpFxaRPXlRdM0ddrN4BFSYvK962m/x3XH W+LeIqQ4TvgWyQfw0tgiLNK97WrqqktW84c7XfUlPowHJx7ecCU7aer/d7D2wF/kg7E8 ee5FPiEWcMlBKURrCmg3zxogZTM6K/8/sE1fwWZLYn3OrWg6fNg02NZmAmPhnxrqgsj3 XJKA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=YoxCTsVdZFHDRxqGyEYXLG9qHPT2PJVSDWgO1l1hkYE=; b=w2KWIKS+kEIpEdK8rqi9gs4pCIqeb80kvwRZWKZjCjCAMJAu3n3reSJp+8G7UfiXeR wAURo/4Z5qwjT1g/Otqb0gow7M5nu4M0HBq+ZrY7jfcFvvOxVhIYcu6IqKWRdQfB5Q2y WpweDqH0W3Hhn6JxnV1KTlYNNwwMQ+h29JWREDK4zdQRaqfRESQP5nBBqSXvUb20y7Ia CPxFK+HfYUtSdC0Dd6DNyqcT25xE0GfUJNSQLx+zDyj9GeXnoUCadC+b7NBhc5Pkq/a0 SjcViguPjCbLsuK6+xtOr952X+EmHhluaNyc3jgaKUMH5imFdt32jTo4l/7blKJAPl4E d8/g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=MPmLZjUN; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i16-20020a170902c95000b001928641c19fsi2485229pla.286.2023.01.25.00.32.18; Wed, 25 Jan 2023 00:32:31 -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=@nxp.com header.s=selector2 header.b=MPmLZjUN; 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 S235150AbjAYIb5 (ORCPT <rfc822;rust.linux@gmail.com> + 99 others); Wed, 25 Jan 2023 03:31:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235137AbjAYIbz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 25 Jan 2023 03:31:55 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on062f.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0d::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43DF71632B for <linux-kernel@vger.kernel.org>; Wed, 25 Jan 2023 00:31:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qgk/CzBwWEefrgyuiA2OBKWWFYBulgTmzCOVcJVy/oATfKr+OWX9SiG1lmQI037L/R/7P90e5DpTRucNmGMyP5yM5ztuoi7LbaSk0xLvijCRQt4Q6QtCtQGUbkYn6r/vD82DizhLo11PTnPK43A1z5R5097T7RrtrjdIqTgbQsGUUJrC0EIuxMAxh+GRhPD1RfvXqK7VPKxD22uHV9gIhETkt5B7p+mrO/3a5CpnxZOOnMK2ToaaxE9Xhhig+SBBos3ryj+S5+n9eiPY6AZkvjh7powkpb0bOX/qWRidBJwBSA9KXIaKxxpXa+2gCR6FSJLvvi8vZqQ6+vUhEj/nEQ== 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=YoxCTsVdZFHDRxqGyEYXLG9qHPT2PJVSDWgO1l1hkYE=; b=DqO0AsMREWvpQA7np873Mtipaq4IrRrK9K/0D5dxrZChhuP8L96iXPEgx14vMuUdFGlMsmOdtw00KdhmEUG03XyZfpqgzy9YDXqyU/Qy69+d0WgeIvwjK61BAufi94gntyC6HFLDz7dZNs0ai6AZAOqJIzAqTPdbdzvS3WxZbHmjhXzhof+nJLgUMLBet9pFtEwnmNwzGPjBZTG5ZeHQydwDMg8kdk8NTmF/DRHt00IqZ60C25RCPXO00WQkH6JN3nwKiSycoFDJpJhEC6S0CBJzTEuIfSLwIKKnVRnql0bxup/PQQjiuSbn2/7uvMvzfDjOaobEb2GShyUE6X8Nag== 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=YoxCTsVdZFHDRxqGyEYXLG9qHPT2PJVSDWgO1l1hkYE=; b=MPmLZjUNG2kuHG+nXr4j629KhEmXKpgFVyh2L/DN5TWvcdxGvYl4sCI2BtVfH7orzTFYxWKI0iMFf8Nf0svbiqvh/Kr2sTtmvGM46Hx9Sc8fz1sffCeuMLzZpyp2kjvjDHGGTwN64A2kKMcccuX1ad2QnVCBFTrWYyxOVGMgusI= 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 PAXPR04MB9301.eurprd04.prod.outlook.com (2603:10a6:102:2b9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Wed, 25 Jan 2023 08:31:33 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::5725:92ec:f43e:f5fc]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::5725:92ec:f43e:f5fc%7]) with mapi id 15.20.6002.028; Wed, 25 Jan 2023 08:31:33 +0000 From: Liu Ying <victor.liu@nxp.com> To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, geert+renesas@glider.be, linux-imx@nxp.com, Rob Herring <robh@kernel.org>, Lee Jones <lee@kernel.org> Subject: [PATCH] driver: bus: simple-pm-bus: Add Freescale i.MX8qm/qxp CSR compatible strings Date: Wed, 25 Jan 2023 16:32:48 +0800 Message-Id: <20230125083248.1305270-1-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0235.apcprd06.prod.outlook.com (2603:1096:4:ac::19) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|PAXPR04MB9301:EE_ X-MS-Office365-Filtering-Correlation-Id: ec166100-4173-48ca-6ff9-08dafeae90d3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: erbkF/zyPRQh2fxVphJakKOXSNIb2u0VZtHZiIPC9XbTdoa4O6+WzoZxOHiLvQqkh+pM1xV0NTIE82zoThqMxC1C7x2o8JgIBrc5Fq0L420d/uKrKKC4Ka4vHV2AAK+9x6TMHtGHMdhoZp/FnXpN/PW95Y+zhCAfoQHKZwm0wauCrJ92l6s+xw75u0Vr6b5HUan9Cp647jrdMTUF31Zbn92I97ijQWiqkaYnYtSBHdXxyZ0qZ0tGYNIwPT0uksryZ0KcxTZSArG5xffdU3XrSus0iwJ2CN4qtbrYaRabnNFfXJMhCHe14te/tAiPX6cWFGnAx8OS5d9m3lzpdbSgL1DMVLwJ8rOHUozDhVuSXUbhUDUBc91FrVhPCjuXIPq6L5LptG5WnxrO3aBqCs1qxNL9Lb+J1mlzF/M9iFYHb9luDk4E22pqKLE4oRVG1+NKFNiFcOHuxMU20bXLUe2p98pyk33vF+3iiaLsv3KVsEUQ216QUkHg3TKtdTA+qVibcu1+YO2Lb5FzvnjLSlWOq1LVAMDplyjVo6Ypq2b0H6K0jOxdT6sZOnOg4kwVaWFAKXZ+baawVDLoFAw+M/9DHFNSd/eMk8In7bUD2Ab51L1f2Q8h3qPWKqSZso4XQMG8xgl5KNCmvzu2rQqDILtbP8RQltnIogt3HjR6NGJe8noBv3oWWig+1MkjMQUEnLU9ZogR6fxi35YKKi1v65K3stT1rlQie7hsW4IYicpyJy8= 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:(13230025)(4636009)(376002)(39860400002)(136003)(346002)(366004)(396003)(451199018)(38350700002)(38100700002)(83380400001)(54906003)(6916009)(66556008)(2616005)(478600001)(8676002)(186003)(66476007)(6486002)(36756003)(1076003)(66946007)(52116002)(966005)(2906002)(86362001)(41300700001)(26005)(5660300002)(316002)(6506007)(6666004)(6512007)(4326008)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /zn7ByK5GzjH6qYQVbxqmZg1TumVQ/nIqhGQpbSCuosaBiccYKA+7uSUkfBsmraup0fgtclaGgOL4iLQHNVmgMv1SUbIC32LsDu81ecmhrlrsUKXsfjy08sMHxmGVq7mU3OfhzCy1RYP1lICZHXAsM8MfZfQ0/vF4ekTZeu2GAQKujJ+/oMmETRU7UHTJfTua5e8a/ndww1h1PSfnG0fxXlXld3wX3RrqTvJvgtC6WI5v+u/EBb2L45OdV5O7HxSDmB4WNSLTivM5YMB+GLYatVpeLnQjAizjvWDYt3XWERB5t9rDhciAQrKSPp7DBZmsxJ+09brPT3qKfNPzKBBxumyQ8s2LGgI3jgGVxYdG6Kwc0POqcEWyQeXUhrNNrEDQOKRIXLGITprXoJ3qIHC+JXobRRVgerumtdvcJqJpeEP+gacj8Mx9lFQ6qsnFblXPenw8MhqP5jmwcshEcg0oFLyzRzgZKJA4A8p3SHSprfJOg6CPedh8C2oKIdB1Y+ehASHzc3Pgny9Y2MWg16MxuJCqI4890eMoKVsert/6TYUuHf6GwEFaOFZLBz/hpukrVy+fdfNMcEAnEJqQgeNeuIXl/tT99/aq/fRuB3b7Ae6TDuTakvBu9sU3SErldt0MBP9ZGhNT+mTp+y3ZDkWjcgG0V0IX79lq838TFA9EnP0MBebDizd3J1/QBF6DXTz0tL0Wh43+HteUBRSXH19EE7FXjyExGjnNjFn7azPGhzfz8xDUk5XDRTWbtEoBnhz6Jdj2O1pRE9I1v3PwlE+hyFS6E7Q128v/gWw1SOTTnoAgmzBNb4t6TmTy+KWmNtCNP09N9QMeYxNjsmB2/5W1fzdNkz8mNimDTxIDqYbz5f/X+1IS8i3qRVblN1AdcHUjPzD3H1dIw9F6uRtU0rEMKGAAezdQ0LZCni7l3uMHFVxDRHXc7gu+2bWr4StXwbU291iv05NkEwM0jjdCVgaayyHoGd2B4Qwf/XVHdnkd9uviIBFXQ3cRIK80aHZGy/Y+OTSmH8AmQMcNXMJUBjfzsyduhzcOv+S/nsOzMc98QditQ6QqbwnCwN3DCYPH6+E0IoE4dv0c3L4WE5MEQLBdiQWMwWopbWxJBQ1AXh8pVNSLmaApxiH1ShfsKv0Ti8JbJ8FVeiNldENdGmQWwbkUKwfPqCc4YXeNKysPtVWo370hDwqtU2JGj3pNIS7omoJZtJz26rCqhUSH5Q3A3sNTZUpAxXo4x42cQFXokW3vOmW4owAwbOcmRQP1OOYZEataYMCfhb7JpQRri5u88RzoS0OHiBJy9L0aurtsZS5vXSsNh0SXTt5IUeko87iTQZPtMos0YtuIqCegxnQV7Z8Z+k8kS67B1QYhkC84anQJtPV4MhVviaFL8m7WOl5m41WWp11BK65kMuFd0CBhmQ1P35EwYwp62UhDlcLSgqgsArUwHjhNWRj26jxRut858IJAyLAFiQSrGLd9WEUEc4JWAmkFtVZkP/+bapiHjEJSfm6Qs31eLjA3L7cLEXTygc8N0zjH6fDIDprC6IGxvTQeMzDFB+OAJzBtUuiqZqYR9WlguLextMB+FBTtpV+rcmO X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec166100-4173-48ca-6ff9-08dafeae90d3 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2023 08:31:33.6542 (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: nCscIDLc4skoe+epslrrfdy9lNewb4o95cuIOjP1bnCINeTQeF1rWSVJ8jQYdIFbdguTUfBKBAX881IWRZUuKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9301 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,SPF_HELO_PASS, T_SPF_PERMERROR autolearn=no 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755982648255445537?= X-GMAIL-MSGID: =?utf-8?q?1755982648255445537?= |
Series |
driver: bus: simple-pm-bus: Add Freescale i.MX8qm/qxp CSR compatible strings
|
|
Commit Message
Liu Ying
Jan. 25, 2023, 8:32 a.m. UTC
Freescale i.MX8qm/qxp CSR module matches with what the simple power
managed bus driver does, considering it needs an IPG clock to be
enabled before accessing it's child devices, the child devices need
to be populated by the CSR module and the child devices' power
management operations need to be propagated to their parent devices.
Add the CSR module's compatible strings to simple_pm_bus_of_match[]
table to support the CSR module.
Suggested-by: Rob Herring <robh@kernel.org>
Suggested-by: Lee Jones <lee@kernel.org>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
---
The CSR module's dt-binding documentation can be found at
Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml.
Suggested by Rob and Lee in this thread:
https://patchwork.kernel.org/project/linux-arm-kernel/patch/20221017075702.4182846-1-victor.liu@nxp.com/
drivers/bus/simple-pm-bus.c | 2 ++
1 file changed, 2 insertions(+)
Comments
Hi Liu, On Wed, Jan 25, 2023 at 9:31 AM Liu Ying <victor.liu@nxp.com> wrote: > Freescale i.MX8qm/qxp CSR module matches with what the simple power > managed bus driver does, considering it needs an IPG clock to be > enabled before accessing it's child devices, the child devices need > to be populated by the CSR module and the child devices' power > management operations need to be propagated to their parent devices. > Add the CSR module's compatible strings to simple_pm_bus_of_match[] > table to support the CSR module. > > Suggested-by: Rob Herring <robh@kernel.org> > Suggested-by: Lee Jones <lee@kernel.org> > Signed-off-by: Liu Ying <victor.liu@nxp.com> Thanks for your patch! > --- > The CSR module's dt-binding documentation can be found at > Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml. > > Suggested by Rob and Lee in this thread: > https://patchwork.kernel.org/project/linux-arm-kernel/patch/20221017075702.4182846-1-victor.liu@nxp.com/ > > drivers/bus/simple-pm-bus.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c > index 7afe1947e1c0..4a7575afe6c6 100644 > --- a/drivers/bus/simple-pm-bus.c > +++ b/drivers/bus/simple-pm-bus.c > @@ -120,6 +120,8 @@ static const struct of_device_id simple_pm_bus_of_match[] = { > { .compatible = "simple-mfd", .data = ONLY_BUS }, > { .compatible = "isa", .data = ONLY_BUS }, > { .compatible = "arm,amba-bus", .data = ONLY_BUS }, > + { .compatible = "fsl,imx8qm-lvds-csr", }, > + { .compatible = "fsl,imx8qxp-mipi-lvds-csr", }, I did read the thread linked above, and I still think you should just add "simple-pm-bus" to the compatible value in DTS, so no driver change is needed, cfr. Documentation/devicetree/bindings/bus/renesas,bsc.yaml. If that doesn't work due to DT binding constraints, the latter should be fixed. > { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, simple_pm_bus_of_match); Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
On Wed, 2023-01-25 at 10:05 +0100, Geert Uytterhoeven wrote: > Hi Liu, Hi Geert, > > On Wed, Jan 25, 2023 at 9:31 AM Liu Ying <victor.liu@nxp.com> wrote: > > Freescale i.MX8qm/qxp CSR module matches with what the simple power > > managed bus driver does, considering it needs an IPG clock to be > > enabled before accessing it's child devices, the child devices need > > to be populated by the CSR module and the child devices' power > > management operations need to be propagated to their parent > > devices. > > Add the CSR module's compatible strings to simple_pm_bus_of_match[] > > table to support the CSR module. > > > > Suggested-by: Rob Herring <robh@kernel.org> > > Suggested-by: Lee Jones <lee@kernel.org> > > Signed-off-by: Liu Ying <victor.liu@nxp.com> > > Thanks for your patch! Thanks for your review! > > > --- > > The CSR module's dt-binding documentation can be found at > > Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml. > > > > Suggested by Rob and Lee in this thread: > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fproject%2Flinux-arm-kernel%2Fpatch%2F20221017075702.4182846-1-victor.liu%40nxp.com%2F&data=05%7C01%7Cvictor.liu%40nxp.com%7C3fa98ff270534078019508dafeb34b10%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638102343312884116%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=zm8Z5gWt9yGXakYlxopUfZKLMUJRWTxq1kWHLyqhyww%3D&reserved=0 > > > > drivers/bus/simple-pm-bus.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm- > > bus.c > > index 7afe1947e1c0..4a7575afe6c6 100644 > > --- a/drivers/bus/simple-pm-bus.c > > +++ b/drivers/bus/simple-pm-bus.c > > @@ -120,6 +120,8 @@ static const struct of_device_id > > simple_pm_bus_of_match[] = { > > { .compatible = "simple-mfd", .data = ONLY_BUS }, > > { .compatible = "isa", .data = ONLY_BUS }, > > { .compatible = "arm,amba-bus", .data = ONLY_BUS }, > > + { .compatible = "fsl,imx8qm-lvds-csr", }, > > + { .compatible = "fsl,imx8qxp-mipi-lvds-csr", }, > > I did read the thread linked above, and I still think you should just > add "simple-pm-bus" to the compatible value in DTS, so no driver > change > is needed, cfr. > Documentation/devicetree/bindings/bus/renesas,bsc.yaml. This means that i.MX8qm/qxp CSR module dt-binding documentation needs to be changed. I'd like to know how Rob and Krzysztof think about that. > > If that doesn't work due to DT binding constraints, the latter should > be fixed. Adding "simple-pm-bus" to the compatible value in DTS doesn't work, because "simple-mfd" is matched first and "ONLY_BUS" is set for "simple-mfd". s/simple-mfd/simple-pm-bus/ for the compatbile value in DTS does work, but it means that fsl,imx8qxp-csr.yaml needs to be changed and moved from mfd directory to bus directory... Hmm, fsl,imx8qxp-csr.yaml was first written earlier than the below patch. Without that patch, child devices of the CSR module can be populated. 98e96cf80045 ("drivers: bus: simple-pm-bus: Add support for probing simple bus only devices") Should I go ahead to fix fsl,imx8qxp-csr.yaml and move it to bus directory? Regards, Liu Ying > > > { /* sentinel */ } > > }; > > MODULE_DEVICE_TABLE(of, simple_pm_bus_of_match); > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- > geert@linux-m68k.org > > In personal conversations with technical people, I call myself a > hacker. But > when I'm talking to journalists I just say "programmer" or something > like that. > -- Linus Torvalds
Hi Liu, On Thu, Jan 26, 2023 at 3:55 AM Liu Ying <victor.liu@nxp.com> wrote: > On Wed, 2023-01-25 at 10:05 +0100, Geert Uytterhoeven wrote: > > On Wed, Jan 25, 2023 at 9:31 AM Liu Ying <victor.liu@nxp.com> wrote: > > > Freescale i.MX8qm/qxp CSR module matches with what the simple power > > > managed bus driver does, considering it needs an IPG clock to be > > > enabled before accessing it's child devices, the child devices need > > > to be populated by the CSR module and the child devices' power > > > management operations need to be propagated to their parent > > > devices. > > > Add the CSR module's compatible strings to simple_pm_bus_of_match[] > > > table to support the CSR module. > > > > > > Suggested-by: Rob Herring <robh@kernel.org> > > > Suggested-by: Lee Jones <lee@kernel.org> > > > Signed-off-by: Liu Ying <victor.liu@nxp.com> > > > > Thanks for your patch! > > Thanks for your review! > > > > > > --- > > > The CSR module's dt-binding documentation can be found at > > > Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml. > > > > > > Suggested by Rob and Lee in this thread: > > > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fproject%2Flinux-arm-kernel%2Fpatch%2F20221017075702.4182846-1-victor.liu%40nxp.com%2F&data=05%7C01%7Cvictor.liu%40nxp.com%7C3fa98ff270534078019508dafeb34b10%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638102343312884116%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=zm8Z5gWt9yGXakYlxopUfZKLMUJRWTxq1kWHLyqhyww%3D&reserved=0 > > > > > > drivers/bus/simple-pm-bus.c | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm- > > > bus.c > > > index 7afe1947e1c0..4a7575afe6c6 100644 > > > --- a/drivers/bus/simple-pm-bus.c > > > +++ b/drivers/bus/simple-pm-bus.c > > > @@ -120,6 +120,8 @@ static const struct of_device_id > > > simple_pm_bus_of_match[] = { > > > { .compatible = "simple-mfd", .data = ONLY_BUS }, > > > { .compatible = "isa", .data = ONLY_BUS }, > > > { .compatible = "arm,amba-bus", .data = ONLY_BUS }, > > > + { .compatible = "fsl,imx8qm-lvds-csr", }, > > > + { .compatible = "fsl,imx8qxp-mipi-lvds-csr", }, > > > > I did read the thread linked above, and I still think you should just > > add "simple-pm-bus" to the compatible value in DTS, so no driver > > change > > is needed, cfr. > > Documentation/devicetree/bindings/bus/renesas,bsc.yaml. > > This means that i.MX8qm/qxp CSR module dt-binding documentation needs > to be changed. I'd like to know how Rob and Krzysztof think about > that. > > > > > If that doesn't work due to DT binding constraints, the latter should > > be fixed. > > Adding "simple-pm-bus" to the compatible value in DTS doesn't work, > because "simple-mfd" is matched first and "ONLY_BUS" is set for Is that because you have both "simple-mfd" and "simple-pm-bus", and the former is listed first in DTS? Does it work if you change the order? > "simple-mfd". s/simple-mfd/simple-pm-bus/ for the compatbile value in > DTS does work, but it means that fsl,imx8qxp-csr.yaml needs to be > changed and moved from mfd directory to bus directory... BTW, originally I didn't want to introduce "simple-pm-bus" at all, and make it just call pm_runtime_enable() for "simple-bus" (PM is everywhere anyway), but that was rejected... Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
On Thu, 2023-01-26 at 09:30 +0100, Geert Uytterhoeven wrote: > Hi Liu, Hi Geert, > > On Thu, Jan 26, 2023 at 3:55 AM Liu Ying <victor.liu@nxp.com> wrote: > > On Wed, 2023-01-25 at 10:05 +0100, Geert Uytterhoeven wrote: > > > On Wed, Jan 25, 2023 at 9:31 AM Liu Ying <victor.liu@nxp.com> > > > wrote: > > > > Freescale i.MX8qm/qxp CSR module matches with what the simple > > > > power > > > > managed bus driver does, considering it needs an IPG clock to > > > > be > > > > enabled before accessing it's child devices, the child devices > > > > need > > > > to be populated by the CSR module and the child devices' power > > > > management operations need to be propagated to their parent > > > > devices. > > > > Add the CSR module's compatible strings to > > > > simple_pm_bus_of_match[] > > > > table to support the CSR module. > > > > > > > > Suggested-by: Rob Herring <robh@kernel.org> > > > > Suggested-by: Lee Jones <lee@kernel.org> > > > > Signed-off-by: Liu Ying <victor.liu@nxp.com> > > > > > > Thanks for your patch! > > > > Thanks for your review! > > > > > > > > > --- > > > > The CSR module's dt-binding documentation can be found at > > > > Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml. > > > > > > > > Suggested by Rob and Lee in this thread: > > > > > > > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fproject%2Flinux-arm-kernel%2Fpatch%2F20221017075702.4182846-1-victor.liu%40nxp.com%2F&data=05%7C01%7Cvictor.liu%40nxp.com%7C5121c05b779f4003da7b08daff77a9ac%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638103186659610847%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=yyYJNJcWwDjZESJ%2FiAqkEhKbz2jRdDbgmQ%2Bm%2FWwdWZs%3D&reserved=0 > > > > > > > > drivers/bus/simple-pm-bus.c | 2 ++ > > > > 1 file changed, 2 insertions(+) > > > > > > > > diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple- > > > > pm- > > > > bus.c > > > > index 7afe1947e1c0..4a7575afe6c6 100644 > > > > --- a/drivers/bus/simple-pm-bus.c > > > > +++ b/drivers/bus/simple-pm-bus.c > > > > @@ -120,6 +120,8 @@ static const struct of_device_id > > > > simple_pm_bus_of_match[] = { > > > > { .compatible = "simple-mfd", .data = ONLY_BUS }, > > > > { .compatible = "isa", .data = ONLY_BUS }, > > > > { .compatible = "arm,amba-bus", .data = ONLY_BUS }, > > > > + { .compatible = "fsl,imx8qm-lvds-csr", }, > > > > + { .compatible = "fsl,imx8qxp-mipi-lvds-csr", }, > > > > > > I did read the thread linked above, and I still think you should > > > just > > > add "simple-pm-bus" to the compatible value in DTS, so no driver > > > change > > > is needed, cfr. > > > Documentation/devicetree/bindings/bus/renesas,bsc.yaml. > > > > This means that i.MX8qm/qxp CSR module dt-binding documentation > > needs > > to be changed. I'd like to know how Rob and Krzysztof think about > > that. > > > > > > > > If that doesn't work due to DT binding constraints, the latter > > > should > > > be fixed. > > > > Adding "simple-pm-bus" to the compatible value in DTS doesn't work, > > because "simple-mfd" is matched first and "ONLY_BUS" is set for > > Is that because you have both "simple-mfd" and "simple-pm-bus", > and the former is listed first in DTS? Yes. For example, compatible is set as below for CSR module in i.MX8qm LVDS subsystem. compatible = "fsl,imx8qm-lvds-csr", "syscon", "simple-mfd", "simple-pm- bus"; > Does it work if you change the order? Yes, it works if I swap the positions of "simple-mfd" and "simple-pm- bus". Device tree specification says the compatible strings should be listed from most specific to most general. "simple-mfd" and "simple-pm-bus" sound like two different things, so I don't have good idea about the order. Replacing "simple-mfd" with "simple-pm-bus" and moving fsl,imx8qxp-csr.yaml to bus directory look more reasonable to me. But, I'd like to know how do device tree folks think. Regards, Liu Ying > > > "simple-mfd". s/simple-mfd/simple-pm-bus/ for the compatbile value > > in > > DTS does work, but it means that fsl,imx8qxp-csr.yaml needs to be > > changed and moved from mfd directory to bus directory... > > BTW, originally I didn't want to introduce "simple-pm-bus" at all, > and make it just call pm_runtime_enable() for "simple-bus" (PM is > everywhere anyway), but that was rejected... > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- > geert@linux-m68k.org > > In personal conversations with technical people, I call myself a > hacker. But > when I'm talking to journalists I just say "programmer" or something > like that. > -- Linus Torvalds
On 26/01/2023 03:54, Liu Ying wrote: > On Wed, 2023-01-25 at 10:05 +0100, Geert Uytterhoeven wrote: >> Hi Liu, > > Hi Geert, > >> >> On Wed, Jan 25, 2023 at 9:31 AM Liu Ying <victor.liu@nxp.com> wrote: >>> Freescale i.MX8qm/qxp CSR module matches with what the simple power >>> managed bus driver does, considering it needs an IPG clock to be >>> enabled before accessing it's child devices, the child devices need >>> to be populated by the CSR module and the child devices' power >>> management operations need to be propagated to their parent >>> devices. >>> Add the CSR module's compatible strings to simple_pm_bus_of_match[] >>> table to support the CSR module. >>> >>> Suggested-by: Rob Herring <robh@kernel.org> >>> Suggested-by: Lee Jones <lee@kernel.org> >>> Signed-off-by: Liu Ying <victor.liu@nxp.com> >> >> Thanks for your patch! > > Thanks for your review! > >> >>> --- >>> The CSR module's dt-binding documentation can be found at >>> Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml. >>> >>> Suggested by Rob and Lee in this thread: >>> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fproject%2Flinux-arm-kernel%2Fpatch%2F20221017075702.4182846-1-victor.liu%40nxp.com%2F&data=05%7C01%7Cvictor.liu%40nxp.com%7C3fa98ff270534078019508dafeb34b10%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638102343312884116%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=zm8Z5gWt9yGXakYlxopUfZKLMUJRWTxq1kWHLyqhyww%3D&reserved=0 >>> >>> drivers/bus/simple-pm-bus.c | 2 ++ >>> 1 file changed, 2 insertions(+) >>> >>> diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm- >>> bus.c >>> index 7afe1947e1c0..4a7575afe6c6 100644 >>> --- a/drivers/bus/simple-pm-bus.c >>> +++ b/drivers/bus/simple-pm-bus.c >>> @@ -120,6 +120,8 @@ static const struct of_device_id >>> simple_pm_bus_of_match[] = { >>> { .compatible = "simple-mfd", .data = ONLY_BUS }, >>> { .compatible = "isa", .data = ONLY_BUS }, >>> { .compatible = "arm,amba-bus", .data = ONLY_BUS }, >>> + { .compatible = "fsl,imx8qm-lvds-csr", }, >>> + { .compatible = "fsl,imx8qxp-mipi-lvds-csr", }, >> >> I did read the thread linked above, and I still think you should just >> add "simple-pm-bus" to the compatible value in DTS, so no driver >> change >> is needed, cfr. >> Documentation/devicetree/bindings/bus/renesas,bsc.yaml. I don't think we want to start putting specific compatibles here. We don't do it for simple-mfd, syscon and simple-bus, so neither should we do it here. > > This means that i.MX8qm/qxp CSR module dt-binding documentation needs > to be changed. I'd like to know how Rob and Krzysztof think about > that. The fsl,imx8qxp-csr.yaml bindings are broken anyway... You have device specific bindings for non-simple device but use simple-mfd. You cannot. simple-mfd means it is simple and none of the resources are needed for children, but that binding contradicts it. Now you kind of try to extend it even more make it more and more broken. Rework the bindings keeping them backwards compatible. The combination with simple-mfd should be deprecated and you can add whatever is needed for a proper setup. > >> >> If that doesn't work due to DT binding constraints, the latter should >> be fixed. > > Adding "simple-pm-bus" to the compatible value in DTS doesn't work, > because "simple-mfd" is matched first and "ONLY_BUS" is set for > "simple-mfd". s/simple-mfd/simple-pm-bus/ for the compatbile value in > DTS does work, but it means that fsl,imx8qxp-csr.yaml needs to be > changed and moved from mfd directory to bus directory... Because the device is not simple-mfd and should have never been made that. I am surprised it passed Rob's review, I guess it slipped through the cracks. Now you have to live with borken bindings. You have a lesson for future - put some effort to design them correctly from the beginning, so you won't have problems. Bindings should be complete from the beginning, not "I'll develop whatever is needed to match my driver and I will not care about future". Best regards, Krzysztof
On Thu, 2023-01-26 at 13:45 +0100, Krzysztof Kozlowski wrote: > On 26/01/2023 03:54, Liu Ying wrote: > > On Wed, 2023-01-25 at 10:05 +0100, Geert Uytterhoeven wrote: > > > Hi Liu, > > > > Hi Geert, > > > > > > > > On Wed, Jan 25, 2023 at 9:31 AM Liu Ying <victor.liu@nxp.com> > > > wrote: > > > > Freescale i.MX8qm/qxp CSR module matches with what the simple > > > > power > > > > managed bus driver does, considering it needs an IPG clock to > > > > be > > > > enabled before accessing it's child devices, the child devices > > > > need > > > > to be populated by the CSR module and the child devices' power > > > > management operations need to be propagated to their parent > > > > devices. > > > > Add the CSR module's compatible strings to > > > > simple_pm_bus_of_match[] > > > > table to support the CSR module. > > > > > > > > Suggested-by: Rob Herring <robh@kernel.org> > > > > Suggested-by: Lee Jones <lee@kernel.org> > > > > Signed-off-by: Liu Ying <victor.liu@nxp.com> > > > > > > Thanks for your patch! > > > > Thanks for your review! > > > > > > > > > --- > > > > The CSR module's dt-binding documentation can be found at > > > > Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml. > > > > > > > > Suggested by Rob and Lee in this thread: > > > > > > > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fproject%2Flinux-arm-kernel%2Fpatch%2F20221017075702.4182846-1-victor.liu%40nxp.com%2F&data=05%7C01%7Cvictor.liu%40nxp.com%7C87515adc8fc3401f410808daff9b3279%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638103339276325657%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=FFz5gSIPc6vyvb1IJ1Umu62WpzjNLIiQIi2sOA3RQGc%3D&reserved=0 > > > > > > > > drivers/bus/simple-pm-bus.c | 2 ++ > > > > 1 file changed, 2 insertions(+) > > > > > > > > diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple- > > > > pm- > > > > bus.c > > > > index 7afe1947e1c0..4a7575afe6c6 100644 > > > > --- a/drivers/bus/simple-pm-bus.c > > > > +++ b/drivers/bus/simple-pm-bus.c > > > > @@ -120,6 +120,8 @@ static const struct of_device_id > > > > simple_pm_bus_of_match[] = { > > > > { .compatible = "simple-mfd", .data = ONLY_BUS }, > > > > { .compatible = "isa", .data = ONLY_BUS }, > > > > { .compatible = "arm,amba-bus", .data = ONLY_BUS }, > > > > + { .compatible = "fsl,imx8qm-lvds-csr", }, > > > > + { .compatible = "fsl,imx8qxp-mipi-lvds-csr", }, > > > > > > I did read the thread linked above, and I still think you should > > > just > > > add "simple-pm-bus" to the compatible value in DTS, so no driver > > > change > > > is needed, cfr. > > > Documentation/devicetree/bindings/bus/renesas,bsc.yaml. > > I don't think we want to start putting specific compatibles here. We > don't do it for simple-mfd, syscon and simple-bus, so neither should > we > do it here. > > > > > This means that i.MX8qm/qxp CSR module dt-binding documentation > > needs > > to be changed. I'd like to know how Rob and Krzysztof think about > > that. > > The fsl,imx8qxp-csr.yaml bindings are broken anyway... You have > device > specific bindings for non-simple device but use simple-mfd. You > cannot. > simple-mfd means it is simple and none of the resources are needed > for > children, but that binding contradicts it. > > Now you kind of try to extend it even more make it more and more > broken. > > Rework the bindings keeping them backwards compatible. The > combination > with simple-mfd should be deprecated and you can add whatever is > needed > for a proper setup. I did try to rework the bindings and make the combination with simple- mfd deprecated. However, it reminds me the problem that "simple-pm-bus" and "syscon" can not be in compatible string at the same time, otherwise, nodename should match '^syscon@[0-9a-f]+$' and '^bus@[0-9a- f]+$' at the same time. I mentioned the problem in the same thread[1] where Rob and Lee suggest to go with this patch. "syscon" is needed since i.MX8qxp MIPI DSI/LVDS combo PHY node references the CSR module through a phandle, so dropping/deprecating "syscon" is a no-go. Also, as Rob mentioned in [1] "if register space is all mixed together, then it is the former and an MFD", I think the CSR module should fall into the simple-mfd category. Take i.MX8qxp MIPI DSI/LVDS CSR module as an example, child device pxl2dpi register offset is 0x40, while child device ldb register offsets are 0x20 and 0xe0. Geert, Krzysztof, can you please consider to keep this patch as-is, since it seems that there is no other option? [1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20221017075702.4182846-1-victor.liu@nxp.com/ Regards, Liu Ying > > > > > > > > > If that doesn't work due to DT binding constraints, the latter > > > should > > > be fixed. > > > > Adding "simple-pm-bus" to the compatible value in DTS doesn't work, > > because "simple-mfd" is matched first and "ONLY_BUS" is set for > > "simple-mfd". s/simple-mfd/simple-pm-bus/ for the compatbile value > > in > > DTS does work, but it means that fsl,imx8qxp-csr.yaml needs to be > > changed and moved from mfd directory to bus directory... > > Because the device is not simple-mfd and should have never been made > that. I am surprised it passed Rob's review, I guess it slipped > through > the cracks. > > Now you have to live with borken bindings. You have a lesson for > future > - put some effort to design them correctly from the beginning, so you > won't have problems. Bindings should be complete from the beginning, > not > "I'll develop whatever is needed to match my driver and I will not > care > about future". > > Best regards, > Krzysztof >
On 29/01/2023 09:13, Liu Ying wrote: > On Thu, 2023-01-26 at 13:45 +0100, Krzysztof Kozlowski wrote: >> On 26/01/2023 03:54, Liu Ying wrote: >>> On Wed, 2023-01-25 at 10:05 +0100, Geert Uytterhoeven wrote: >>>> Hi Liu, >>> >>> Hi Geert, >>> >>>> >>>> On Wed, Jan 25, 2023 at 9:31 AM Liu Ying <victor.liu@nxp.com> >>>> wrote: >>>>> Freescale i.MX8qm/qxp CSR module matches with what the simple >>>>> power >>>>> managed bus driver does, considering it needs an IPG clock to >>>>> be >>>>> enabled before accessing it's child devices, the child devices >>>>> need >>>>> to be populated by the CSR module and the child devices' power >>>>> management operations need to be propagated to their parent >>>>> devices. >>>>> Add the CSR module's compatible strings to >>>>> simple_pm_bus_of_match[] >>>>> table to support the CSR module. >>>>> >>>>> Suggested-by: Rob Herring <robh@kernel.org> >>>>> Suggested-by: Lee Jones <lee@kernel.org> >>>>> Signed-off-by: Liu Ying <victor.liu@nxp.com> >>>> >>>> Thanks for your patch! >>> >>> Thanks for your review! >>> >>>> >>>>> --- >>>>> The CSR module's dt-binding documentation can be found at >>>>> Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml. >>>>> >>>>> Suggested by Rob and Lee in this thread: >>>>> >>> >>> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fproject%2Flinux-arm-kernel%2Fpatch%2F20221017075702.4182846-1-victor.liu%40nxp.com%2F&data=05%7C01%7Cvictor.liu%40nxp.com%7C87515adc8fc3401f410808daff9b3279%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638103339276325657%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=FFz5gSIPc6vyvb1IJ1Umu62WpzjNLIiQIi2sOA3RQGc%3D&reserved=0 >>>>> >>>>> drivers/bus/simple-pm-bus.c | 2 ++ >>>>> 1 file changed, 2 insertions(+) >>>>> >>>>> diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple- >>>>> pm- >>>>> bus.c >>>>> index 7afe1947e1c0..4a7575afe6c6 100644 >>>>> --- a/drivers/bus/simple-pm-bus.c >>>>> +++ b/drivers/bus/simple-pm-bus.c >>>>> @@ -120,6 +120,8 @@ static const struct of_device_id >>>>> simple_pm_bus_of_match[] = { >>>>> { .compatible = "simple-mfd", .data = ONLY_BUS }, >>>>> { .compatible = "isa", .data = ONLY_BUS }, >>>>> { .compatible = "arm,amba-bus", .data = ONLY_BUS }, >>>>> + { .compatible = "fsl,imx8qm-lvds-csr", }, >>>>> + { .compatible = "fsl,imx8qxp-mipi-lvds-csr", }, >>>> >>>> I did read the thread linked above, and I still think you should >>>> just >>>> add "simple-pm-bus" to the compatible value in DTS, so no driver >>>> change >>>> is needed, cfr. >>>> Documentation/devicetree/bindings/bus/renesas,bsc.yaml. >> >> I don't think we want to start putting specific compatibles here. We >> don't do it for simple-mfd, syscon and simple-bus, so neither should >> we >> do it here. >> >>> >>> This means that i.MX8qm/qxp CSR module dt-binding documentation >>> needs >>> to be changed. I'd like to know how Rob and Krzysztof think about >>> that. >> >> The fsl,imx8qxp-csr.yaml bindings are broken anyway... You have >> device >> specific bindings for non-simple device but use simple-mfd. You >> cannot. >> simple-mfd means it is simple and none of the resources are needed >> for >> children, but that binding contradicts it. >> >> Now you kind of try to extend it even more make it more and more >> broken. >> >> Rework the bindings keeping them backwards compatible. The >> combination >> with simple-mfd should be deprecated and you can add whatever is >> needed >> for a proper setup. > > I did try to rework the bindings and make the combination with simple- > mfd deprecated. However, it reminds me the problem that "simple-pm-bus" > and "syscon" can not be in compatible string at the same time, > otherwise, nodename should match '^syscon@[0-9a-f]+$' and '^bus@[0-9a- > f]+$' at the same time. I mentioned the problem in the same thread[1] > where Rob and Lee suggest to go with this patch. "syscon" is needed > since i.MX8qxp MIPI DSI/LVDS combo PHY node references the CSR module > through a phandle, so dropping/deprecating "syscon" is a no-go. > > Also, as Rob mentioned in [1] "if register space is all mixed together, > then it is the former and an MFD", I think the CSR module should fall > into the simple-mfd category. You are now mixing MFD with simple-mfd. If you have clocks there or any other resources, it's not simple-mfd anymore. > Take i.MX8qxp MIPI DSI/LVDS CSR module as > an example, child device pxl2dpi register offset is 0x40, while child > device ldb register offsets are 0x20 and 0xe0. > > Geert, Krzysztof, can you please consider to keep this patch as-is, > since it seems that there is no other option? There are other options, why do you say there is no? Making it proper binding/driver for its children without abusing simple bindings. Simple bindings are for simple cases and this turns out not the simple case. Best regards, Krzysztof
On Sun, 2023-01-29 at 11:49 +0100, Krzysztof Kozlowski wrote: > On 29/01/2023 09:13, Liu Ying wrote: > > On Thu, 2023-01-26 at 13:45 +0100, Krzysztof Kozlowski wrote: > > > On 26/01/2023 03:54, Liu Ying wrote: > > > > On Wed, 2023-01-25 at 10:05 +0100, Geert Uytterhoeven wrote: > > > > > Hi Liu, > > > > > > > > Hi Geert, > > > > > > > > > > > > > > On Wed, Jan 25, 2023 at 9:31 AM Liu Ying <victor.liu@nxp.com> > > > > > wrote: > > > > > > Freescale i.MX8qm/qxp CSR module matches with what the > > > > > > simple > > > > > > power > > > > > > managed bus driver does, considering it needs an IPG clock > > > > > > to > > > > > > be > > > > > > enabled before accessing it's child devices, the child > > > > > > devices > > > > > > need > > > > > > to be populated by the CSR module and the child devices' > > > > > > power > > > > > > management operations need to be propagated to their parent > > > > > > devices. > > > > > > Add the CSR module's compatible strings to > > > > > > simple_pm_bus_of_match[] > > > > > > table to support the CSR module. > > > > > > > > > > > > Suggested-by: Rob Herring <robh@kernel.org> > > > > > > Suggested-by: Lee Jones <lee@kernel.org> > > > > > > Signed-off-by: Liu Ying <victor.liu@nxp.com> > > > > > > > > > > Thanks for your patch! > > > > > > > > Thanks for your review! > > > > > > > > > > > > > > > --- > > > > > > The CSR module's dt-binding documentation can be found at > > > > > > Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml. > > > > > > > > > > > > Suggested by Rob and Lee in this thread: > > > > > > > > > > > > > > > > > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fproject%2Flinux-arm-kernel%2Fpatch%2F20221017075702.4182846-1-victor.liu%40nxp.com%2F&data=05%7C01%7Cvictor.liu%40nxp.com%7C58af8a86f0134b6bde3408db01e68522%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638105861813147063%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=mHv%2BTAHMAR8coxDmXucoMbxv%2BuMEdHWHTyLz16OUY50%3D&reserved=0 > > > > > > > > > > > > drivers/bus/simple-pm-bus.c | 2 ++ > > > > > > 1 file changed, 2 insertions(+) > > > > > > > > > > > > diff --git a/drivers/bus/simple-pm-bus.c > > > > > > b/drivers/bus/simple- > > > > > > pm- > > > > > > bus.c > > > > > > index 7afe1947e1c0..4a7575afe6c6 100644 > > > > > > --- a/drivers/bus/simple-pm-bus.c > > > > > > +++ b/drivers/bus/simple-pm-bus.c > > > > > > @@ -120,6 +120,8 @@ static const struct of_device_id > > > > > > simple_pm_bus_of_match[] = { > > > > > > { .compatible = "simple-mfd", .data = ONLY_BUS }, > > > > > > { .compatible = "isa", .data = ONLY_BUS }, > > > > > > { .compatible = "arm,amba-bus", .data = ONLY_BUS }, > > > > > > + { .compatible = "fsl,imx8qm-lvds-csr", }, > > > > > > + { .compatible = "fsl,imx8qxp-mipi-lvds-csr", }, > > > > > > > > > > I did read the thread linked above, and I still think you > > > > > should > > > > > just > > > > > add "simple-pm-bus" to the compatible value in DTS, so no > > > > > driver > > > > > change > > > > > is needed, cfr. > > > > > Documentation/devicetree/bindings/bus/renesas,bsc.yaml. > > > > > > I don't think we want to start putting specific compatibles here. > > > We > > > don't do it for simple-mfd, syscon and simple-bus, so neither > > > should > > > we > > > do it here. > > > > > > > > > > > This means that i.MX8qm/qxp CSR module dt-binding documentation > > > > needs > > > > to be changed. I'd like to know how Rob and Krzysztof think > > > > about > > > > that. > > > > > > The fsl,imx8qxp-csr.yaml bindings are broken anyway... You have > > > device > > > specific bindings for non-simple device but use simple-mfd. You > > > cannot. > > > simple-mfd means it is simple and none of the resources are > > > needed > > > for > > > children, but that binding contradicts it. > > > > > > Now you kind of try to extend it even more make it more and more > > > broken. > > > > > > Rework the bindings keeping them backwards compatible. The > > > combination > > > with simple-mfd should be deprecated and you can add whatever is > > > needed > > > for a proper setup. > > > > I did try to rework the bindings and make the combination with > > simple- > > mfd deprecated. However, it reminds me the problem that "simple-pm- > > bus" > > and "syscon" can not be in compatible string at the same time, > > otherwise, nodename should match '^syscon@[0-9a-f]+$' and '^bus@[0- > > 9a- > > f]+$' at the same time. I mentioned the problem in the same > > thread[1] > > where Rob and Lee suggest to go with this patch. "syscon" is needed > > since i.MX8qxp MIPI DSI/LVDS combo PHY node references the CSR > > module > > through a phandle, so dropping/deprecating "syscon" is a no-go. > > > > Also, as Rob mentioned in [1] "if register space is all mixed > > together, > > then it is the former and an MFD", I think the CSR module should > > fall > > into the simple-mfd category. > > You are now mixing MFD with simple-mfd. If you have clocks there or > any > other resources, it's not simple-mfd anymore. I may try to make the combination with simple-mfd deprecated and add another combination with i.MX8qm/qxp CSR compatible strings and syscon only. Then, it will be a MFD, not simple-mfd. > > > Take i.MX8qxp MIPI DSI/LVDS CSR module as > > an example, child device pxl2dpi register offset is 0x40, while > > child > > device ldb register offsets are 0x20 and 0xe0. > > > > Geert, Krzysztof, can you please consider to keep this patch as-is, > > since it seems that there is no other option? > > There are other options, why do you say there is no? Making it proper > binding/driver for its children without abusing simple bindings. I don't quite understand your comment here, sorry. Here are the 3 options I know: 1) Add a new MFD driver for the CSR module I sent out a MFD driver[1] for the CSR module for review, but Rob and Lee provided comments there and suggested to use this patch. 2) Use "simple-pm-bus" compatible string in the CSR module's compatbile property As mentioned before, "simple-pm-bus" contradicts with "syscon". 3) Add the CSR module's specific compatible strings in simple_pm_bus_of_match[] This is what this patch does and suggested by Rob and Lee. Looks like 3) is the only feasible option. Geert, Krzysztof, any objections to keep this patch as-is? [1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20221017075702.4182846-1-victor.liu@nxp.com/ Regards, Liu Ying > Simple > bindings are for simple cases and this turns out not the simple case. > > Best regards, > Krzysztof >
Hi Krzysztof, On Sun, Jan 29, 2023 at 11:49 AM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > On 29/01/2023 09:13, Liu Ying wrote: > > On Thu, 2023-01-26 at 13:45 +0100, Krzysztof Kozlowski wrote: > >> On 26/01/2023 03:54, Liu Ying wrote: > >>> On Wed, 2023-01-25 at 10:05 +0100, Geert Uytterhoeven wrote: > >>>> On Wed, Jan 25, 2023 at 9:31 AM Liu Ying <victor.liu@nxp.com> > >>>> wrote: > >>>>> Freescale i.MX8qm/qxp CSR module matches with what the simple > >>>>> power > >>>>> managed bus driver does, considering it needs an IPG clock to > >>>>> be > >>>>> enabled before accessing it's child devices, the child devices > >>>>> need > >>>>> to be populated by the CSR module and the child devices' power > >>>>> management operations need to be propagated to their parent > >>>>> devices. > >>>>> Add the CSR module's compatible strings to > >>>>> simple_pm_bus_of_match[] > >>>>> table to support the CSR module. > >>>>> > >>>>> Suggested-by: Rob Herring <robh@kernel.org> > >>>>> Suggested-by: Lee Jones <lee@kernel.org> > >>>>> Signed-off-by: Liu Ying <victor.liu@nxp.com> > >>>>> The CSR module's dt-binding documentation can be found at > >>>>> Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml. > >>>>> > >>>>> Suggested by Rob and Lee in this thread: > >>> > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fproject%2Flinux-arm-kernel%2Fpatch%2F20221017075702.4182846-1-victor.liu%40nxp.com%2F&data=05%7C01%7Cvictor.liu%40nxp.com%7C87515adc8fc3401f410808daff9b3279%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638103339276325657%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=FFz5gSIPc6vyvb1IJ1Umu62WpzjNLIiQIi2sOA3RQGc%3D&reserved=0 > >>>>> > >>>>> drivers/bus/simple-pm-bus.c | 2 ++ > >>>>> 1 file changed, 2 insertions(+) > >>>>> > >>>>> diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple- > >>>>> pm- > >>>>> bus.c > >>>>> index 7afe1947e1c0..4a7575afe6c6 100644 > >>>>> --- a/drivers/bus/simple-pm-bus.c > >>>>> +++ b/drivers/bus/simple-pm-bus.c > >>>>> @@ -120,6 +120,8 @@ static const struct of_device_id > >>>>> simple_pm_bus_of_match[] = { > >>>>> { .compatible = "simple-mfd", .data = ONLY_BUS }, > >>>>> { .compatible = "isa", .data = ONLY_BUS }, > >>>>> { .compatible = "arm,amba-bus", .data = ONLY_BUS }, > >>>>> + { .compatible = "fsl,imx8qm-lvds-csr", }, > >>>>> + { .compatible = "fsl,imx8qxp-mipi-lvds-csr", }, > >>>> > >>>> I did read the thread linked above, and I still think you should > >>>> just > >>>> add "simple-pm-bus" to the compatible value in DTS, so no driver > >>>> change > >>>> is needed, cfr. > >>>> Documentation/devicetree/bindings/bus/renesas,bsc.yaml. > >> > >> I don't think we want to start putting specific compatibles here. We > >> don't do it for simple-mfd, syscon and simple-bus, so neither should > >> we > >> do it here. > >> > >>> This means that i.MX8qm/qxp CSR module dt-binding documentation > >>> needs > >>> to be changed. I'd like to know how Rob and Krzysztof think about > >>> that. > >> > >> The fsl,imx8qxp-csr.yaml bindings are broken anyway... You have > >> device > >> specific bindings for non-simple device but use simple-mfd. You > >> cannot. > >> simple-mfd means it is simple and none of the resources are needed > >> for > >> children, but that binding contradicts it. > >> > >> Now you kind of try to extend it even more make it more and more > >> broken. > >> > >> Rework the bindings keeping them backwards compatible. The > >> combination > >> with simple-mfd should be deprecated and you can add whatever is > >> needed > >> for a proper setup. > > > > I did try to rework the bindings and make the combination with simple- > > mfd deprecated. However, it reminds me the problem that "simple-pm-bus" > > and "syscon" can not be in compatible string at the same time, > > otherwise, nodename should match '^syscon@[0-9a-f]+$' and '^bus@[0-9a- > > f]+$' at the same time. I mentioned the problem in the same thread[1] > > where Rob and Lee suggest to go with this patch. "syscon" is needed > > since i.MX8qxp MIPI DSI/LVDS combo PHY node references the CSR module > > through a phandle, so dropping/deprecating "syscon" is a no-go. > > > > Also, as Rob mentioned in [1] "if register space is all mixed together, > > then it is the former and an MFD", I think the CSR module should fall > > into the simple-mfd category. > > You are now mixing MFD with simple-mfd. If you have clocks there or any > other resources, it's not simple-mfd anymore. I beg to differ (but not w.r.t. the other resources): if any "glue" device between parent and child hierarchies does not call pm_runtime_enable(), Runtime PM (which is a Linux thing, not a DT thing) for the children may not work correctly, as it won't propagate correctly to the parent. So IMHO this is something to fix in Linux, not in DT. > > Take i.MX8qxp MIPI DSI/LVDS CSR module as > > an example, child device pxl2dpi register offset is 0x40, while child > > device ldb register offsets are 0x20 and 0xe0. > > > > Geert, Krzysztof, can you please consider to keep this patch as-is, > > since it seems that there is no other option? > > There are other options, why do you say there is no? Making it proper > binding/driver for its children without abusing simple bindings. Simple > bindings are for simple cases and this turns out not the simple case. Or drop the ".data = ONLY_BUS" for "simple-mfd"? (and treat "simple-bus" the same as "simple-pm-bus", too ;-) Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
On Mon, 2023-01-30 at 09:13 +0100, Geert Uytterhoeven wrote: > Hi Krzysztof, > > On Sun, Jan 29, 2023 at 11:49 AM Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: > > On 29/01/2023 09:13, Liu Ying wrote: > > > On Thu, 2023-01-26 at 13:45 +0100, Krzysztof Kozlowski wrote: > > > > On 26/01/2023 03:54, Liu Ying wrote: > > > > > On Wed, 2023-01-25 at 10:05 +0100, Geert Uytterhoeven wrote: > > > > > > On Wed, Jan 25, 2023 at 9:31 AM Liu Ying < > > > > > > victor.liu@nxp.com> > > > > > > wrote: > > > > > > > Freescale i.MX8qm/qxp CSR module matches with what the > > > > > > > simple > > > > > > > power > > > > > > > managed bus driver does, considering it needs an IPG > > > > > > > clock to > > > > > > > be > > > > > > > enabled before accessing it's child devices, the child > > > > > > > devices > > > > > > > need > > > > > > > to be populated by the CSR module and the child devices' > > > > > > > power > > > > > > > management operations need to be propagated to their > > > > > > > parent > > > > > > > devices. > > > > > > > Add the CSR module's compatible strings to > > > > > > > simple_pm_bus_of_match[] > > > > > > > table to support the CSR module. > > > > > > > > > > > > > > Suggested-by: Rob Herring <robh@kernel.org> > > > > > > > Suggested-by: Lee Jones <lee@kernel.org> > > > > > > > Signed-off-by: Liu Ying <victor.liu@nxp.com> > > > > > > > The CSR module's dt-binding documentation can be found at > > > > > > > Documentation/devicetree/bindings/mfd/fsl,imx8qxp- > > > > > > > csr.yaml. > > > > > > > > > > > > > > Suggested by Rob and Lee in this thread: > > > > > > > > > > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fproject%2Flinux-arm-kernel%2Fpatch%2F20221017075702.4182846-1-victor.liu%40nxp.com%2F&data=05%7C01%7Cvictor.liu%40nxp.com%7C721a36c64fab482d5d3908db0299e1d8%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638106632175447990%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jnxUn2N33xjrmNfGXw02SeG5EN%2Fqluz%2BjZYRk0%2BHlrU%3D&reserved=0 > > > > > > > > > > > > > > drivers/bus/simple-pm-bus.c | 2 ++ > > > > > > > 1 file changed, 2 insertions(+) > > > > > > > > > > > > > > diff --git a/drivers/bus/simple-pm-bus.c > > > > > > > b/drivers/bus/simple- > > > > > > > pm- > > > > > > > bus.c > > > > > > > index 7afe1947e1c0..4a7575afe6c6 100644 > > > > > > > --- a/drivers/bus/simple-pm-bus.c > > > > > > > +++ b/drivers/bus/simple-pm-bus.c > > > > > > > @@ -120,6 +120,8 @@ static const struct of_device_id > > > > > > > simple_pm_bus_of_match[] = { > > > > > > > { .compatible = "simple-mfd", .data = ONLY_BUS > > > > > > > }, > > > > > > > { .compatible = "isa", .data = ONLY_BUS > > > > > > > }, > > > > > > > { .compatible = "arm,amba-bus", .data = ONLY_BUS > > > > > > > }, > > > > > > > + { .compatible = "fsl,imx8qm-lvds-csr", }, > > > > > > > + { .compatible = "fsl,imx8qxp-mipi-lvds-csr", }, > > > > > > > > > > > > I did read the thread linked above, and I still think you > > > > > > should > > > > > > just > > > > > > add "simple-pm-bus" to the compatible value in DTS, so no > > > > > > driver > > > > > > change > > > > > > is needed, cfr. > > > > > > Documentation/devicetree/bindings/bus/renesas,bsc.yaml. > > > > > > > > I don't think we want to start putting specific compatibles > > > > here. We > > > > don't do it for simple-mfd, syscon and simple-bus, so neither > > > > should > > > > we > > > > do it here. > > > > > > > > > This means that i.MX8qm/qxp CSR module dt-binding > > > > > documentation > > > > > needs > > > > > to be changed. I'd like to know how Rob and Krzysztof think > > > > > about > > > > > that. > > > > > > > > The fsl,imx8qxp-csr.yaml bindings are broken anyway... You have > > > > device > > > > specific bindings for non-simple device but use simple-mfd. You > > > > cannot. > > > > simple-mfd means it is simple and none of the resources are > > > > needed > > > > for > > > > children, but that binding contradicts it. > > > > > > > > Now you kind of try to extend it even more make it more and > > > > more > > > > broken. > > > > > > > > Rework the bindings keeping them backwards compatible. The > > > > combination > > > > with simple-mfd should be deprecated and you can add whatever > > > > is > > > > needed > > > > for a proper setup. > > > > > > I did try to rework the bindings and make the combination with > > > simple- > > > mfd deprecated. However, it reminds me the problem that "simple- > > > pm-bus" > > > and "syscon" can not be in compatible string at the same time, > > > otherwise, nodename should match '^syscon@[0-9a-f]+$' and > > > '^bus@[0-9a- > > > f]+$' at the same time. I mentioned the problem in the same > > > thread[1] > > > where Rob and Lee suggest to go with this patch. "syscon" is > > > needed > > > since i.MX8qxp MIPI DSI/LVDS combo PHY node references the CSR > > > module > > > through a phandle, so dropping/deprecating "syscon" is a no-go. > > > > > > Also, as Rob mentioned in [1] "if register space is all mixed > > > together, > > > then it is the former and an MFD", I think the CSR module should > > > fall > > > into the simple-mfd category. > > > > You are now mixing MFD with simple-mfd. If you have clocks there or > > any > > other resources, it's not simple-mfd anymore. > > I beg to differ (but not w.r.t. the other resources): if any "glue" > device > between parent and child hierarchies does not call > pm_runtime_enable(), > Runtime PM (which is a Linux thing, not a DT thing) for the children > may not work correctly, as it won't propagate correctly to the > parent. > So IMHO this is something to fix in Linux, not in DT. > > > > Take i.MX8qxp MIPI DSI/LVDS CSR module as > > > an example, child device pxl2dpi register offset is 0x40, while > > > child > > > device ldb register offsets are 0x20 and 0xe0. > > > > > > Geert, Krzysztof, can you please consider to keep this patch as- > > > is, > > > since it seems that there is no other option? > > > > There are other options, why do you say there is no? Making it > > proper > > binding/driver for its children without abusing simple bindings. > > Simple > > bindings are for simple cases and this turns out not the simple > > case. > > Or drop the ".data = ONLY_BUS" for "simple-mfd"? Saravana said it's wrong to deleting ONLY_BUS for "simple-mfd". See Saravana's comments in [1]. [1] https://lore.kernel.org/linux-arm-kernel/CAGETcx_QVaYYHsD9HZmBu404K-oXRCPm4N4GRrYu4pGyw2DHbg@mail.gmail.com/ Regards, Liu Ying > (and treat "simple-bus" the same as "simple-pm-bus", too ;-) > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- > geert@linux-m68k.org > > In personal conversations with technical people, I call myself a > hacker. But > when I'm talking to journalists I just say "programmer" or something > like that. > -- Linus Torvalds
On 30/01/2023 02:45, Liu Ying wrote: > On Sun, 2023-01-29 at 11:49 +0100, Krzysztof Kozlowski wrote: >> On 29/01/2023 09:13, Liu Ying wrote: >>> On Thu, 2023-01-26 at 13:45 +0100, Krzysztof Kozlowski wrote: >>>> On 26/01/2023 03:54, Liu Ying wrote: >>>>> On Wed, 2023-01-25 at 10:05 +0100, Geert Uytterhoeven wrote: >>>>>> Hi Liu, >>>>> >>>>> Hi Geert, >>>>> >>>>>> >>>>>> On Wed, Jan 25, 2023 at 9:31 AM Liu Ying <victor.liu@nxp.com> >>>>>> wrote: >>>>>>> Freescale i.MX8qm/qxp CSR module matches with what the >>>>>>> simple >>>>>>> power >>>>>>> managed bus driver does, considering it needs an IPG clock >>>>>>> to >>>>>>> be >>>>>>> enabled before accessing it's child devices, the child >>>>>>> devices >>>>>>> need >>>>>>> to be populated by the CSR module and the child devices' >>>>>>> power >>>>>>> management operations need to be propagated to their parent >>>>>>> devices. >>>>>>> Add the CSR module's compatible strings to >>>>>>> simple_pm_bus_of_match[] >>>>>>> table to support the CSR module. >>>>>>> >>>>>>> Suggested-by: Rob Herring <robh@kernel.org> >>>>>>> Suggested-by: Lee Jones <lee@kernel.org> >>>>>>> Signed-off-by: Liu Ying <victor.liu@nxp.com> >>>>>> >>>>>> Thanks for your patch! >>>>> >>>>> Thanks for your review! >>>>> >>>>>> >>>>>>> --- >>>>>>> The CSR module's dt-binding documentation can be found at >>>>>>> Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml. >>>>>>> >>>>>>> Suggested by Rob and Lee in this thread: >>>>>>> >>>>> >>>>> >>> >>> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fproject%2Flinux-arm-kernel%2Fpatch%2F20221017075702.4182846-1-victor.liu%40nxp.com%2F&data=05%7C01%7Cvictor.liu%40nxp.com%7C58af8a86f0134b6bde3408db01e68522%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638105861813147063%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=mHv%2BTAHMAR8coxDmXucoMbxv%2BuMEdHWHTyLz16OUY50%3D&reserved=0 >>>>>>> >>>>>>> drivers/bus/simple-pm-bus.c | 2 ++ >>>>>>> 1 file changed, 2 insertions(+) >>>>>>> >>>>>>> diff --git a/drivers/bus/simple-pm-bus.c >>>>>>> b/drivers/bus/simple- >>>>>>> pm- >>>>>>> bus.c >>>>>>> index 7afe1947e1c0..4a7575afe6c6 100644 >>>>>>> --- a/drivers/bus/simple-pm-bus.c >>>>>>> +++ b/drivers/bus/simple-pm-bus.c >>>>>>> @@ -120,6 +120,8 @@ static const struct of_device_id >>>>>>> simple_pm_bus_of_match[] = { >>>>>>> { .compatible = "simple-mfd", .data = ONLY_BUS }, >>>>>>> { .compatible = "isa", .data = ONLY_BUS }, >>>>>>> { .compatible = "arm,amba-bus", .data = ONLY_BUS }, >>>>>>> + { .compatible = "fsl,imx8qm-lvds-csr", }, >>>>>>> + { .compatible = "fsl,imx8qxp-mipi-lvds-csr", }, >>>>>> >>>>>> I did read the thread linked above, and I still think you >>>>>> should >>>>>> just >>>>>> add "simple-pm-bus" to the compatible value in DTS, so no >>>>>> driver >>>>>> change >>>>>> is needed, cfr. >>>>>> Documentation/devicetree/bindings/bus/renesas,bsc.yaml. >>>> >>>> I don't think we want to start putting specific compatibles here. >>>> We >>>> don't do it for simple-mfd, syscon and simple-bus, so neither >>>> should >>>> we >>>> do it here. >>>> >>>>> >>>>> This means that i.MX8qm/qxp CSR module dt-binding documentation >>>>> needs >>>>> to be changed. I'd like to know how Rob and Krzysztof think >>>>> about >>>>> that. >>>> >>>> The fsl,imx8qxp-csr.yaml bindings are broken anyway... You have >>>> device >>>> specific bindings for non-simple device but use simple-mfd. You >>>> cannot. >>>> simple-mfd means it is simple and none of the resources are >>>> needed >>>> for >>>> children, but that binding contradicts it. >>>> >>>> Now you kind of try to extend it even more make it more and more >>>> broken. >>>> >>>> Rework the bindings keeping them backwards compatible. The >>>> combination >>>> with simple-mfd should be deprecated and you can add whatever is >>>> needed >>>> for a proper setup. >>> >>> I did try to rework the bindings and make the combination with >>> simple- >>> mfd deprecated. However, it reminds me the problem that "simple-pm- >>> bus" >>> and "syscon" can not be in compatible string at the same time, >>> otherwise, nodename should match '^syscon@[0-9a-f]+$' and '^bus@[0- >>> 9a- >>> f]+$' at the same time. I mentioned the problem in the same >>> thread[1] >>> where Rob and Lee suggest to go with this patch. "syscon" is needed >>> since i.MX8qxp MIPI DSI/LVDS combo PHY node references the CSR >>> module >>> through a phandle, so dropping/deprecating "syscon" is a no-go. >>> >>> Also, as Rob mentioned in [1] "if register space is all mixed >>> together, >>> then it is the former and an MFD", I think the CSR module should >>> fall >>> into the simple-mfd category. >> >> You are now mixing MFD with simple-mfd. If you have clocks there or >> any >> other resources, it's not simple-mfd anymore. > > I may try to make the combination with simple-mfd deprecated and add > another combination with i.MX8qm/qxp CSR compatible strings and syscon > only. Then, it will be a MFD, not simple-mfd. > >> >>> Take i.MX8qxp MIPI DSI/LVDS CSR module as >>> an example, child device pxl2dpi register offset is 0x40, while >>> child >>> device ldb register offsets are 0x20 and 0xe0. >>> >>> Geert, Krzysztof, can you please consider to keep this patch as-is, >>> since it seems that there is no other option? >> >> There are other options, why do you say there is no? Making it proper >> binding/driver for its children without abusing simple bindings. > > I don't quite understand your comment here, sorry. Here are the 3 > options I know: > > 1) Add a new MFD driver for the CSR module > I sent out a MFD driver[1] for the CSR module for review, but Rob and > Lee provided comments there and suggested to use this patch. Where are the clocks in that driver? Having MFD for something without resources does not make any sense - this is why we have simple-mfd. But I see in your [1] Rob's suggestion about adding the compatible to simple-pm-bus.c, therefore it looks correct approach. Best regards, Krzysztof
On Wed, 2023-02-01 at 08:31 +0100, Krzysztof Kozlowski wrote: > On 30/01/2023 02:45, Liu Ying wrote: > > On Sun, 2023-01-29 at 11:49 +0100, Krzysztof Kozlowski wrote: > > > On 29/01/2023 09:13, Liu Ying wrote: > > > > On Thu, 2023-01-26 at 13:45 +0100, Krzysztof Kozlowski wrote: > > > > > On 26/01/2023 03:54, Liu Ying wrote: > > > > > > On Wed, 2023-01-25 at 10:05 +0100, Geert Uytterhoeven wrote: > > > > > > > Hi Liu, > > > > > > > > > > > > Hi Geert, > > > > > > > > > > > > > On Wed, Jan 25, 2023 at 9:31 AM Liu Ying <victor.liu@nxp.com> > > > > > > > wrote: > > > > > > > > Freescale i.MX8qm/qxp CSR module matches with what the > > > > > > > > simple > > > > > > > > power > > > > > > > > managed bus driver does, considering it needs an IPG clock > > > > > > > > to > > > > > > > > be > > > > > > > > enabled before accessing it's child devices, the child > > > > > > > > devices > > > > > > > > need > > > > > > > > to be populated by the CSR module and the child devices' > > > > > > > > power > > > > > > > > management operations need to be propagated to their parent > > > > > > > > devices. > > > > > > > > Add the CSR module's compatible strings to > > > > > > > > simple_pm_bus_of_match[] > > > > > > > > table to support the CSR module. > > > > > > > > > > > > > > > > Suggested-by: Rob Herring <robh@kernel.org> > > > > > > > > Suggested-by: Lee Jones <lee@kernel.org> > > > > > > > > Signed-off-by: Liu Ying <victor.liu@nxp.com> > > > > > > > > > > > > > > Thanks for your patch! > > > > > > > > > > > > Thanks for your review! > > > > > > > > > > > > > > --- > > > > > > > > The CSR module's dt-binding documentation can be found at > > > > > > > > Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml. > > > > > > > > > > > > > > > > Suggested by Rob and Lee in this thread: > > > > > > > > > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fproject%2Flinux-arm-kernel%2Fpatch%2F20221017075702.4182846-1-victor.liu%40nxp.com%2F&data=05%7C01%7Cvictor.liu%40nxp.com%7C32a4c39e47ec4fc834ae08db04264e35%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638108334805268216%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=M2SddU7wPx465kB%2F5p2r6j3%2FAotcVvMiPORPzh%2BC%2FxY%3D&reserved=0 > > > > > > > > drivers/bus/simple-pm-bus.c | 2 ++ > > > > > > > > 1 file changed, 2 insertions(+) > > > > > > > > > > > > > > > > diff --git a/drivers/bus/simple-pm-bus.c > > > > > > > > b/drivers/bus/simple- > > > > > > > > pm- > > > > > > > > bus.c > > > > > > > > index 7afe1947e1c0..4a7575afe6c6 100644 > > > > > > > > --- a/drivers/bus/simple-pm-bus.c > > > > > > > > +++ b/drivers/bus/simple-pm-bus.c > > > > > > > > @@ -120,6 +120,8 @@ static const struct of_device_id > > > > > > > > simple_pm_bus_of_match[] = { > > > > > > > > { .compatible = "simple-mfd", .data = ONLY_BUS }, > > > > > > > > { .compatible = "isa", .data = ONLY_BUS }, > > > > > > > > { .compatible = "arm,amba-bus", .data = ONLY_BUS }, > > > > > > > > + { .compatible = "fsl,imx8qm-lvds-csr", }, > > > > > > > > + { .compatible = "fsl,imx8qxp-mipi-lvds-csr", }, > > > > > > > > > > > > > > I did read the thread linked above, and I still think you > > > > > > > should > > > > > > > just > > > > > > > add "simple-pm-bus" to the compatible value in DTS, so no > > > > > > > driver > > > > > > > change > > > > > > > is needed, cfr. > > > > > > > Documentation/devicetree/bindings/bus/renesas,bsc.yaml. > > > > > > > > > > I don't think we want to start putting specific compatibles here. > > > > > We > > > > > don't do it for simple-mfd, syscon and simple-bus, so neither > > > > > should > > > > > we > > > > > do it here. > > > > > > > > > > > This means that i.MX8qm/qxp CSR module dt-binding documentation > > > > > > needs > > > > > > to be changed. I'd like to know how Rob and Krzysztof think > > > > > > about > > > > > > that. > > > > > > > > > > The fsl,imx8qxp-csr.yaml bindings are broken anyway... You have > > > > > device > > > > > specific bindings for non-simple device but use simple-mfd. You > > > > > cannot. > > > > > simple-mfd means it is simple and none of the resources are > > > > > needed > > > > > for > > > > > children, but that binding contradicts it. > > > > > > > > > > Now you kind of try to extend it even more make it more and more > > > > > broken. > > > > > > > > > > Rework the bindings keeping them backwards compatible. The > > > > > combination > > > > > with simple-mfd should be deprecated and you can add whatever is > > > > > needed > > > > > for a proper setup. > > > > > > > > I did try to rework the bindings and make the combination with > > > > simple- > > > > mfd deprecated. However, it reminds me the problem that "simple-pm- > > > > bus" > > > > and "syscon" can not be in compatible string at the same time, > > > > otherwise, nodename should match '^syscon@[0-9a-f]+$' and '^bus@[0- > > > > 9a- > > > > f]+$' at the same time. I mentioned the problem in the same > > > > thread[1] > > > > where Rob and Lee suggest to go with this patch. "syscon" is needed > > > > since i.MX8qxp MIPI DSI/LVDS combo PHY node references the CSR > > > > module > > > > through a phandle, so dropping/deprecating "syscon" is a no-go. > > > > > > > > Also, as Rob mentioned in [1] "if register space is all mixed > > > > together, > > > > then it is the former and an MFD", I think the CSR module should > > > > fall > > > > into the simple-mfd category. > > > > > > You are now mixing MFD with simple-mfd. If you have clocks there or > > > any > > > other resources, it's not simple-mfd anymore. > > > > I may try to make the combination with simple-mfd deprecated and add > > another combination with i.MX8qm/qxp CSR compatible strings and syscon > > only. Then, it will be a MFD, not simple-mfd. > > > > > > Take i.MX8qxp MIPI DSI/LVDS CSR module as > > > > an example, child device pxl2dpi register offset is 0x40, while > > > > child > > > > device ldb register offsets are 0x20 and 0xe0. > > > > > > > > Geert, Krzysztof, can you please consider to keep this patch as-is, > > > > since it seems that there is no other option? > > > > > > There are other options, why do you say there is no? Making it proper > > > binding/driver for its children without abusing simple bindings. > > > > I don't quite understand your comment here, sorry. Here are the 3 > > options I know: > > > > 1) Add a new MFD driver for the CSR module > > I sent out a MFD driver[1] for the CSR module for review, but Rob and > > Lee provided comments there and suggested to use this patch. > > Where are the clocks in that driver? Having MFD for something without The clocks are missed in that driver. But simple-pm-bus.c in linux-next uses the clocks. Regards, Liu Ying > resources does not make any sense - this is why we have simple-mfd. > > But I see in your [1] Rob's suggestion about adding the compatible to > simple-pm-bus.c, therefore it looks correct approach. > > Best regards, > Krzysztof >
diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c index 7afe1947e1c0..4a7575afe6c6 100644 --- a/drivers/bus/simple-pm-bus.c +++ b/drivers/bus/simple-pm-bus.c @@ -120,6 +120,8 @@ static const struct of_device_id simple_pm_bus_of_match[] = { { .compatible = "simple-mfd", .data = ONLY_BUS }, { .compatible = "isa", .data = ONLY_BUS }, { .compatible = "arm,amba-bus", .data = ONLY_BUS }, + { .compatible = "fsl,imx8qm-lvds-csr", }, + { .compatible = "fsl,imx8qxp-mipi-lvds-csr", }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, simple_pm_bus_of_match);