Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 711D4C05027 for ; Sun, 29 Jan 2023 08:13:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231713AbjA2INm (ORCPT ); Sun, 29 Jan 2023 03:13:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229617AbjA2INj (ORCPT ); Sun, 29 Jan 2023 03:13:39 -0500 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2073.outbound.protection.outlook.com [40.107.105.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8DE213D4D for ; Sun, 29 Jan 2023 00:13:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RzbJmJxp7FUiPUfB7kMB8boJdnb2RGkhCmB87av4BPLg2SjKH+X65gMgzulLmt3BRX6zYowV6oMwMdvCAP+yKCQJxWENLmegG8bU2cyZzgnWhtZI9micvXtpzL451qosundgnCpV8u1arxkyv0DPymfWPCSVIUmHYDTybDqPv+/SMHz6QryZCeyMGirPcZlyl20hqUi2zg5B5S0vnf2UPpTwODy1ozjiPNc8JXpn9Y57JEjkkttlhEWoqHcwr6Mf+GGI42k0p20LIhXjIMSurtz72fGPo+uHto6p2DTSlrpu/SVhd+XuaIR7kpnLlvXzE+HkgCsUS6gzFt5J9lUgVg== 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=7xayl73m+IOefMPW1tBJijEp3bruFOUpsgJ/Y7dTp2k=; b=gEf7RlSJU6iXE0oUNYans6eKQdTUyIDHIbozBABJS+MUYJJERxzro1RL/ayACo48JQ9Yh8k0fh3O9GMPD1cUMZ5n4njy618FzudJ4pdGXNWNxYBbw6C3xOJaAT9E1evyvv95rDvjiI+l32jt8nVjzbIP2kOtK1akmH+yrL+zzRmir7BvU+YFSUhzaQuwJE+TE84gfjQ/TbnRa/ae59+H8RkmWTC+eiFcVgA3x8wgqrQfEn89Qb/ho96IYhpahSkV+2oyQlP4yfssQAUSxJsWIjVu+mYQ9w8NzOTQFU3M0fLu5RyXEZeCi2UiuE58ESHh70QLChJh5fOX6u/o38wR2w== 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=7xayl73m+IOefMPW1tBJijEp3bruFOUpsgJ/Y7dTp2k=; b=RSzBZ96fTUegsfQ0a18H4xz1/IcUidG27ulB8rJwwsHVC5QXxuQ/7drUSr5glpL/CPmHZOGk54E6Qgs/gb+PJ6UXEkSDdmEv1nRKAvc0Xnp8d024duYYDMYgE1qqefZ+RpxJ7OPD49kNhUrjzLK9Q0yG7rEyPzOYwmcDKFSTUGQ= 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 DB9PR04MB9675.eurprd04.prod.outlook.com (2603:10a6:10:307::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.30; Sun, 29 Jan 2023 08:13:34 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::5725:92ec:f43e:f5fc]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::5725:92ec:f43e:f5fc%8]) with mapi id 15.20.6043.023; Sun, 29 Jan 2023 08:13:33 +0000 Message-ID: <2d06468ab1274af3c84e61dbca8d172b9d64cd68.camel@nxp.com> Subject: Re: [PATCH] driver: bus: simple-pm-bus: Add Freescale i.MX8qm/qxp CSR compatible strings From: Liu Ying To: Krzysztof Kozlowski , Geert Uytterhoeven Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, linux-imx@nxp.com, Rob Herring , Lee Jones , krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org Date: Sun, 29 Jan 2023 16:13:07 +0800 In-Reply-To: References: <20230125083248.1305270-1-victor.liu@nxp.com> <7c84cbd1808dc89f9ddaece13f846c4fbd12935a.camel@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: TYCP301CA0010.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:386::13) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|DB9PR04MB9675:EE_ X-MS-Office365-Filtering-Correlation-Id: 14043607-06ba-42b8-b55f-08db01d0b69b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2MIawcFHgfEYgEiZ6TZ1AmaMrYo1xzFLgjOMh+4x40GKBjgqDrTcH73jhzZatXvj05sJbc3xCm07dbSryREIlOYt8W/Cn7x+c5AyBLPmlZdmLPcxKGzH9nEO/hFH2JvuCiaBoABdvlqiL3a2rcotecfvSczWGcNzQtnb0FI8o5pSka+VyfHp0nVSN/eSUHPb2ViSxbccQdezHdfv0w5QIum91N0bBmAh/ErxcOw5G4K6ZrHqXNXWv1eJNeQDeasi39jyc4UL6zK4BQOwvl4i4JuirYtVQhSPwVG2GL2G1eLS4YkGGC8xPJU9BC+SYNVaRF5ojedQOtWj6eRbQwWxJctdBbRqntxpgxVA0rqp8BakffR3/GZxRCrb8o3Ktdu22dXXPCvdHFVjrXd7GqLaAYYg3sQWwqwgLUVndgku0nZT2jM8ZJepPXMaVBhPy/Acw9U7CfZpd6FC1SCJFlWJwKcpu5SZNIYfiKfJGaazTJAPRDMvOQjvP4Itzk3bddmBo+0//Q6VE59rStCqmTWCE+qGQtx29vEmcPDFFLaN2CxfmHLtFss9s5QLrHNynsxMXluBu3ovp0SGL5edp9Za+ho20XyKFE09Ts+BmSD9fuw/zElLZcxn34blKpSs23wDzN7K/9PuksQIFEg0PGUR9IXYkaIEC/KhTStepZ1PCSUCQD3BhqAUwmewHethputkeZEeDX+s7P6EAqe3ZnZ95ggTfwdq8qAdnyDm35sdlFmqJreq2a1V6ozt4pvJBbcXHnt3JSTMei/D1keE2rquXs6azeoW9kr+JtjcFvTGH3qYLUo7TERMTBOzfHAHy2ip 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)(366004)(136003)(376002)(346002)(396003)(39850400004)(451199018)(8936002)(478600001)(2906002)(5660300002)(8676002)(4326008)(41300700001)(66946007)(66476007)(66556008)(316002)(110136005)(54906003)(45080400002)(966005)(6486002)(52116002)(6506007)(53546011)(6666004)(83380400001)(186003)(26005)(6512007)(2616005)(36756003)(86362001)(38100700002)(38350700002)(99106002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WGVzTk4vWk9qTVNrN0FVSVF5WlJxZlBVZ3FrcFlwWEFvUW81YXVnWnBoeUVp?= =?utf-8?B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f-8?B?UzJKUncwYkgxZlpTZXBXMk5WTnZnNE5iYS8vWnc1WEZ5NlhrT3ViSXFXaVI5?= =?utf-8?B?SjgrUndrV2QvTktvWXBwWURYYjVpRjh2b2xlTEVGbU1KWS9MNUdGeDZVSWV0?= =?utf-8?B?bzNwNE5QL2hqeXJncWErZk1qY2daZ0lKQ3VKc0N6b0swK2tjY1lqMllZeFlW?= =?utf-8?B?MVQrWk4va21uZHIrMWdvQkZxY1pLYjduVWJSWmhEWnh4eElXcUcrbERuWStE?= =?utf-8?Q?yCuNpvZEVJuxK3j7jXTBBQyDo?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14043607-06ba-42b8-b55f-08db01d0b69b X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2023 08:13:33.3727 (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: kDeFRFlTPzfbdRoKRx4EXJ362p3kRDrgaUGXqj6CiHnxySAAtAFnz0ys6VQy0MwKoWExV/FcECC+rbCRXSN3tg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9675 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > > 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 > > > > Suggested-by: Lee Jones > > > > Signed-off-by: Liu Ying > > > > > > 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 >