Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp410056rwb; Fri, 18 Nov 2022 03:20:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf7NRNc9b/BbDngX548GenDnttCCYgzFHkdYMC1mVKYew44KTv+Yd39NGjop2CpbLtRTm8d1 X-Received: by 2002:a05:6a00:a96:b0:554:4162:1ec1 with SMTP id b22-20020a056a000a9600b0055441621ec1mr7423231pfl.64.1668770453318; Fri, 18 Nov 2022 03:20:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668770453; cv=pass; d=google.com; s=arc-20160816; b=f6HcHhp7OXMzOj7bNUEoOChGkJLOxN5M7TjquOxlZTSn0khXACWTbtZTzkiBtVQ1jd al5iQJJswjABpg9ecRUxgiY0OJ0dhLheaKZK9avMHMD0VCwSulgffG9Gug5L6P7n/JyA 9nuBVyW8QOpjLUKyAC/kXl5RgLg7R606eX0wu1hcZ7jE8nyCYFfq72CTPwVPw8TtmBnU xwTYJMeZLHtvPiCtuGSkU61nGWp+YCkLoOheN5vIHlFG7x6D1WJ7ulcpL2PMT9vMWfuN smcvn1l+EYjrgMip1ft0ZhHbObfezGbl1MEGGAcAtdVpl0XPHrcPelFZZhFbGbZ/mv6W acKQ== 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 :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=HDT+q8HgiLtn2Y5MWYsWM+JoHGWq04mlJ+A4RezDr+k=; b=DH/AH5Cl1EK4lbeZcMJVfOjFgSQcra8kcvbiur59aNpxB35X7eRdXQhHsdtgX4Xtcs pQGsDtrHROY3aIE3hQ8o+JjPEP/6CyVHYIVFcLJUUUmne208lUJNstfgXL6jlFGcPG1g i/FIto7tlGJfUJ8Ghfregwqs/lLzZRxiJgJ19j/xK435RfyAWYU9Cxk6wbv1FeWTADmY TQoe+CwSPOHlYrfu9Y0hoOXc7iXMlyOxi3xFnrbxLzOLzkniYfUh7x33Wykjsd2sFu1I MqeOf62Gv/coTD0TrBElMh7VuX06SamUZjQf8vWQFv016xzOglzUxF+AyYx89xCs+Ibm 3puA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=ORH9exd3; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w5-20020a17090a780500b0021824fcc6b9si3033208pjk.63.2022.11.18.03.20.42; Fri, 18 Nov 2022 03:20:53 -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=@Nvidia.com header.s=selector2 header.b=ORH9exd3; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241299AbiKRLHT (ORCPT + 91 others); Fri, 18 Nov 2022 06:07:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241962AbiKRLHE (ORCPT ); Fri, 18 Nov 2022 06:07:04 -0500 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2080.outbound.protection.outlook.com [40.107.93.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C346099EA9; Fri, 18 Nov 2022 03:07:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FAos0hkLsiUN3nhHwvQdbf0U/lUJUoe2UTrfrhCaQ0BK0JlXnXWBazus3TqbLdA7zj2j0FNxpGdN1qAtFR0qj4FpvVkzAcHxvSYjuJiM7Z0SMJAopUMX8+cNffTyAiMU9QzU/UbqorzwOq2U8tWqWIALyxfRB5zJ0NotRE1Q+VZAioKv/jp7K5eg6Okc5v1yDG/NmEQd1qzv5iYsFiRRHBNO4OYZQEnJYAfpz+e292+SgvSSzslr8IEfwYnRgx+hK+xxF1/woJNYwlDhKChiwY1xO+tBs0QrEYL+hiPyjHmV1nXWlZKzVp2O2m8u1wVPZC2udv3vo9nqELa5liaUKw== 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=HDT+q8HgiLtn2Y5MWYsWM+JoHGWq04mlJ+A4RezDr+k=; b=clboe7tR4N08C2sUsOaydWpUxs/HZqHuywEjweMmSEwZ4LmqnpjyjNkcZII1neu3Xp2/ladciUIje18CrKIQnp98Ju4ra7v1Wb8siEYEkVt1JgLXQVkEoB2xyJPlLH3iZ0QTDU6dK9Yfx0vtqbWYEThFd4+XQfMyOPKjmuRRgbf6dc50F2YrFsGzzwZsCbj9Amcb5JtYxHafjHoP3OyqlyjJXMkaxQUT0XAicaejIjDbsl5Ux9VksZulLiLFMOijxzcKczleAU6PxKsueqxJw8LDSaqHBsDt5H6Wo3/OAg3sdMoSPpXvtLbzcjYmdY3Z7QVDxML6xaKACRo30Us86Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HDT+q8HgiLtn2Y5MWYsWM+JoHGWq04mlJ+A4RezDr+k=; b=ORH9exd3LBdWpp9fLE2Rewkh21SEXLt1YZYa6GMNl1c47mf7HdAYp1KItVlWKtNAEjWf0jZtWyd7GFnoRID9tAV0SVX/xPNvyi7MDnQy36ZL/EACVRi5I9ZZ8sJ7lB+pz0n1R1Cli9BpRMfUIzZ2wskNlaTK3h23z73ziMSDe50Ilv1z2M8wnr7DhTTL24tVHoqESnU5peDKN0Amphfqt48vWAxlEaEZXmgmwIkUHlGn+b1AU3RFkBS8klZVxgPUxEoflfOC2cfVCjVRCYxPrB2j26CiqzUjBJvlnIlAgfGVrttTwCmcTX4yoBrcAWhl42iSzbH7lfNi181oBGT6yg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CO6PR12MB5444.namprd12.prod.outlook.com (2603:10b6:5:35e::8) by BL1PR12MB5351.namprd12.prod.outlook.com (2603:10b6:208:317::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.9; Fri, 18 Nov 2022 11:07:00 +0000 Received: from CO6PR12MB5444.namprd12.prod.outlook.com ([fe80::8edd:6269:6f31:779e]) by CO6PR12MB5444.namprd12.prod.outlook.com ([fe80::8edd:6269:6f31:779e%5]) with mapi id 15.20.5813.020; Fri, 18 Nov 2022 11:07:00 +0000 Message-ID: <1edbceed-e5a1-460e-25a7-08f299e11c35@nvidia.com> Date: Fri, 18 Nov 2022 11:06:49 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] i2c: tegra: Set ACPI node as primary fwnode Content-Language: en-US To: Thierry Reding Cc: Akhil R , christian.koenig@amd.com, digetx@gmail.com, ldewangan@nvidia.com, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, sumit.semwal@linaro.org, wsa@kernel.org, Zubair Waheed References: <20221117100415.20457-1-akhilrajeev@nvidia.com> <29db0e24-4f7c-e3dc-91ce-2decf6a253a5@nvidia.com> From: Jon Hunter In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0266.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:37c::8) To CO6PR12MB5444.namprd12.prod.outlook.com (2603:10b6:5:35e::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR12MB5444:EE_|BL1PR12MB5351:EE_ X-MS-Office365-Filtering-Correlation-Id: ff54fdda-c922-4702-f1f1-08dac95502f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KwWoR8OQQZnm9wv4MvirI3PvTGW5Kfg/n7fKrMTu8o8wPnX1KWPU8baUFDuSL8jAsou0Zqm4zyBQP+k4EImI+UQ/K5WV/0PCTbFwzlAC5nCENTPDRfNGhvL7NRlh3HCfIAC/WMTtZrXJ44yIAtv1aiOcTXg3Zv2GNH2wzZ+q6PwGNH3VnCvJyAa8KJikz3vB3uF96HWqVsYQaJ1wmj3w88mOW6OVHKonTyn98JNZSbQm8W8MRU1A2D7m6E+VVudgZpLwijemn1gnN4SPdglWatJpPoOG9K8uHscJJsl2K3ymPOl4xRU/o9AGP0D+f7ywCCRh96POz66u0/n9tjW+tjEYxmR7WgCM6nsmFDErYZ8/mGBPN++1G0dPk8Ik9tgZZ5AHM8IZ1h6836gajqRCXTSY9xWsGxZdepIB/3H+cgebGCfkBQCcfmJVUMQJPGixfXFeVYilzknURp3MSvB36h3uDNLIEm6OCJIi/IoovWAb78Tc4jck1MqlictgEi5KqZOQX7MRb8YqnaMvLCI9P4JLfFACjbPyZZ01INEpoPPTq5C2oKmqPGs0UD6KxY/i/IPCkuz/gS19plHyKZs3u1GLii/J27jrQ+6aavPoWSpunH2i080Sj7MqM7ybnSsb2Mjmx2bL6SvKxXpURRYUrkOgKZjpRo8VWqUWTUPhJAQ+gIDskkRO9+A7sU25kqI/lK33lUKqxY0qx9zznh8Dcn1UjOVqVfp+a+D2KrximVU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR12MB5444.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(366004)(396003)(346002)(376002)(39860400002)(451199015)(6506007)(54906003)(478600001)(6486002)(316002)(6666004)(6512007)(66946007)(53546011)(6916009)(107886003)(31686004)(41300700001)(66476007)(4326008)(66556008)(8676002)(8936002)(2616005)(5660300002)(186003)(2906002)(83380400001)(38100700002)(36756003)(86362001)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SkFWWlVwSFRHSVVOdXE5M1dVb2UxaE9RTjQxcmorU0xjdit1ckF2MmE5NlNO?= =?utf-8?B?dXRHMUEzQTVZamZVTExCTjlaQW8zUGlwYlNOWDdUcXNyQk0rbEt1bFR1bGZi?= =?utf-8?B?RFhGMFlZRExLck8rZFYvVHVjRVdFQWdYZ21ITTgvOFl0akRiZlN3eXlSRWdR?= =?utf-8?B?SDFTQTBYMnNVUXcvNWZSWFJ5Rk5MN2tkWHJhdVpJZDhhSHB5R1BNQWJJSkQr?= =?utf-8?B?cUcxcTcwN0dqOTNLZjRkYjZ5aEdiM1NueXVpS0hmVjUxRH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lWRE56eDRpemQ0bjNXZ0NS?= =?utf-8?B?N2Ywc21vTStBcjdJWHlsVnBpdXh0dnY4V3hqSHZsTW9WUUNDVjZWbm5QdXRi?= =?utf-8?Q?ti52N+jnpt5lkdt5uucTGkb+pR4CAm60134P4Ml7Xz3A?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff54fdda-c922-4702-f1f1-08dac95502f5 X-MS-Exchange-CrossTenant-AuthSource: CO6PR12MB5444.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2022 11:06:59.9182 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CR09C8ltkw0CV6HOxRgccTatsPOFYWyFDvLUKHuJwr60TKXDSH6OtdpMZZLW10FqwWyIxVqKSlFeshwzkXC6XA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5351 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_NONE 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: X-Mailing-List: linux-kernel@vger.kernel.org On 18/11/2022 10:18, Thierry Reding wrote: > On Fri, Nov 18, 2022 at 09:38:52AM +0000, Jon Hunter wrote: >> >> On 17/11/2022 10:04, Akhil R wrote: >>> Set ACPI node as the primary fwnode of I2C adapter to allow >>> enumeration of child devices from the ACPI table >>> >>> Signed-off-by: Zubair Waheed >>> Signed-off-by: Akhil R >>> --- >>> drivers/i2c/busses/i2c-tegra.c | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c >>> index 954022c04cc4..69c9ae161bbe 100644 >>> --- a/drivers/i2c/busses/i2c-tegra.c >>> +++ b/drivers/i2c/busses/i2c-tegra.c >>> @@ -1826,6 +1826,7 @@ static int tegra_i2c_probe(struct platform_device *pdev) >>> i2c_dev->adapter.class = I2C_CLASS_DEPRECATED; >>> i2c_dev->adapter.algo = &tegra_i2c_algo; >>> i2c_dev->adapter.nr = pdev->id; >>> + ACPI_COMPANION_SET(&i2c_dev->adapter.dev, ACPI_COMPANION(&pdev->dev)); >>> if (i2c_dev->hw->supports_bus_clear) >>> i2c_dev->adapter.bus_recovery_info = &tegra_i2c_recovery_info; >> >> >> Do we always want to set as the primary fwnode even when booting with >> device-tree? I some other drivers do, but I also see some others ... >> >> if (has_acpi_companion(dev)) >> ACPI_COMPANION_SET(&i2c_dev->adapter.dev, >> ACPI_COMPANION(&pdev->dev)); >> >> It would be nice to know why it is OK to always do this even for device-tree >> because it is not clear to me. > > ACPI_COMPANION() returns NULL if there is no ACPI companion, which will > cause ACPI_COMPANION_SET() to set the primary fwnode to NULL. If I read > the code for set_primary_fwnode() correctly, that's essentially a no-op > for DT devices. Yes it does, but doesn't it is not clear to me if it is a good idea to pass NULL to set_primary_fwnode(). It does seem to handle this but my biggest gripe is the lack of explanation in the commit message why this is OK. Jon -- nvpublic