Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp364225rdg; Tue, 10 Oct 2023 12:31:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHVvlBMLiyWGeqxxzYd8/PlRBrxKW+wmhMNf8EfLBqZ6GVDO8oWcDLq4zg9sV2OMXFzi0n+ X-Received: by 2002:a05:6a20:a121:b0:15e:b253:269f with SMTP id q33-20020a056a20a12100b0015eb253269fmr22421089pzk.28.1696966316979; Tue, 10 Oct 2023 12:31:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696966316; cv=pass; d=google.com; s=arc-20160816; b=WoCzuaXwkUEGTiJCVNWngrsDJEin1YCCOlcCs9B9Os9mrkaSGOWDY9CJ6eR8CkMpRs hAtU2NHlwxsV58/lbswKXl/wkRveYsP5/LDxtC3Q8JiYZl1maucYJ9sA8m4+4o0Ks8tx aoRdd051EREjX/kLU18jfUopmvJ1soffm/uMO+6tCA/VQR/iBarP8sFxZUbb5Ek7c+hj YSvPycDWjnCMa2Yi4OwMhsdD28rsT/G2UnNVT8v5irTnNDDlChjswdKDo9MQVZXMzF6M dVwoVjKIjt+e4DvuMdsm5RvW+9EI5WsPp0UFqr7EYA0pcUFWLl5D4r6gwxRZCe4Gg0EG tZVg== 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:references:cc:to:from:content-language:subject :user-agent:date:message-id:dkim-signature; bh=HPMqpFmL/qkDeTPh1Uruw88jf+UrHdRvT5aQ4P5ctUc=; fh=gFZdaDPDi9xTI9c+2i+uJhnwneUNEgRtnO14kpUZJO0=; b=EvhOedAHl0EoZJiFJDKb/AG2LjchCfevwHAuUmoADQmSEL/qJOlNjq5us1Pc1AtXV8 0LQlTgNTiWa/KnFGOTLadQJ0SROQY27ohcEKRSRCY7PVvPajKZcOADWKRCVL4vNUdGEF RgN0CDSVOTAii3yVURi+30gRPp+4DrkBMNKXnou35pW/UJukjKxg6dlv6QRM4/m/S4Lz KZwAVxRuQ6iCQlR8tR5nuSS6r5PVFCN2xCU10dCksXWZQJu7RQH+0jWf5K8b0rINg0ei RH4QL15kIPOBkrT1AYZRnBozJhhRe4muDUbQBmcBSqjX+7l25jm9+A2GhDkHTrn12W0/ 3p0g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=MDbFga1g; 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 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id y5-20020a056a001c8500b00690d55d630dsi9947266pfw.274.2023.10.10.12.31.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 12:31:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=MDbFga1g; 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 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 1B67D807CB7A; Tue, 10 Oct 2023 12:31:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231474AbjJJTbj (ORCPT + 99 others); Tue, 10 Oct 2023 15:31:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230195AbjJJTbi (ORCPT ); Tue, 10 Oct 2023 15:31:38 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35DFA93; Tue, 10 Oct 2023 12:31:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kq5o5JryZeE7zX22VNu4ah+lNJDuD9jfmwEbUfHB8tKLkNApz8gwuOJZ6grBkcDt3QUHjbM8XmkAy+hUuzxAkqmHEfKjkG7sZn5XlNb2+5V2SCm+GJfsMDf6avJWBmo9BpBp/7hNTYd/uVoForWRVuZBRQgi0o7mncK5xjaFg2EbO5NbZvQW50PEsNxbW1SM2OA527S0EopGFZsvlB4v8c/MJE/DEX/AK9Ws2pD1xHIwSevfBOciniVjHEef0piYxzhf0K3D9oTtNV2KEZ8oieZTTsnOIXNV4g3lp5QInrtKHEjFQaPrMEhOMqc3uXhiImPZ8uUc9QsNWQWxp56hsA== 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=HPMqpFmL/qkDeTPh1Uruw88jf+UrHdRvT5aQ4P5ctUc=; b=auENzkKKpxfYWKZOj9+7/5hF7rLB+qh3FU31T2DnmCRJUnJAqJacttt3bUEw3H8k5CsznJ0sjuI2om79ottrJ6KFj+Ovk2Q6f6GVfFw8AlCPSm6Xgus5JRo6oUReibRnnqID5EmOrX2kdI2OVQbSW6C6i89YtCEvqJU+pTxeUmIELSDCw2OVYwu3NVlhQz640QlpTF5ebiottUHeFbrblbSDJp0oAeoe1kj9L5Fox2mo3D9+b810hYkhv+fw+FP1Vw0ej1e5/WihRhAJbXDrw+G7mu04sisXFPPxY4tApzery6CFAsIwm/d6n3//enRTId60hYshVq8Vnj3HCZdkNQ== 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=HPMqpFmL/qkDeTPh1Uruw88jf+UrHdRvT5aQ4P5ctUc=; b=MDbFga1ghejwW1Th44y1WqdgUpHFTxsVh6EjLHkj9IMQvQsnCpOsfMonR8jRbrK4dmjNgH0ukLmtrHlReSYt9NjAGBCV7kAoDfYIH5fH8sgPYCoMi+6fcuWnQKtNUqACXKOasyX44qCU8GvxULbGC9JCft7Z6emhXpemnf5Mdng7/qz7UVKU56ni/rr090bCgx/DdBQN9XSbRNL0fLgO3yjCcf38LBbftpAe6x45NxD8+U6mMSOJlZ8cgEzPq5IUR/oCMcjAsa6Qr9YlOnugIzl8C3augIZ1iY1fOfF674xMp9cz3ffFQRDEGbqNp76Q9qlSYwG9SDytvwQGDmRwnA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from IA1PR12MB6604.namprd12.prod.outlook.com (2603:10b6:208:3a0::7) by MW4PR12MB6801.namprd12.prod.outlook.com (2603:10b6:303:1e8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Tue, 10 Oct 2023 19:31:33 +0000 Received: from IA1PR12MB6604.namprd12.prod.outlook.com ([fe80::8814:146:e28e:6eea]) by IA1PR12MB6604.namprd12.prod.outlook.com ([fe80::8814:146:e28e:6eea%4]) with mapi id 15.20.6863.032; Tue, 10 Oct 2023 19:31:33 +0000 Message-ID: <147fe15c-13d3-60dc-bd49-cd0cb40126e9@nvidia.com> Date: Tue, 10 Oct 2023 12:31:29 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v1 2/4] hte: tegra194: don't access struct gpio_chip Content-Language: en-US From: Dipen Patel To: Andy Shevchenko , Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, timestamp@lists.linux.dev, linux-tegra@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Thierry Reding , Jonathan Hunter References: <20231010151709.4104747-1-andriy.shevchenko@linux.intel.com> <20231010151709.4104747-3-andriy.shevchenko@linux.intel.com> <3e1e6acf-5862-9f35-cbe6-72bb17cf3851@nvidia.com> X-Nvconfidentiality: public In-Reply-To: <3e1e6acf-5862-9f35-cbe6-72bb17cf3851@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SJ0PR03CA0162.namprd03.prod.outlook.com (2603:10b6:a03:338::17) To IA1PR12MB6604.namprd12.prod.outlook.com (2603:10b6:208:3a0::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR12MB6604:EE_|MW4PR12MB6801:EE_ X-MS-Office365-Filtering-Correlation-Id: 23343a93-402b-4ba2-6e93-08dbc9c782c1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YLuvtKWZcLCKcNizNWOr2YPlELvngbLGBNjYb8TVLCIPcpd6pkBvauFNdZZ0JPyytgVpnc3vV6QjG7uhzpUoBqmt6nKFk+6pb7umHKhDM7SXY0aidoF4exvWj31lpu11ema7H2et6d/3jEHKmljsVotM6/wDYz5KdU7BNkOMWtQooUhc3y41CTQ+kzgHSc/bAqCq2Dz2VRvu8Q9GqV3T23Cxnb7KM0HU2toM3WfbtqaV7Jxv+yYo4g7mcGLr3pDzKVpzz1hxjx49Onzeb0cndT72+sEKpJRp6scdxq29sD62wZ0l/WnQP3UNrFWFIj8zYxPjKBUvp8JUYYv6vcBlHJ8vhUKk0sOz0Uq/JVv1d5g+bx1hvHoLQc9rNOo2LRVn4AN7q12q0SLXlTZz63ZKDthGZjs/oDnIYUYHm4A+KwTZi+dZxG35ytxyJXMUmq3M5ZJkeqTiiX+ACobm82bN9fR9dFgSQpnKN8ZsdMQmM42RkFa1nVVxIuJkSIWdCVOJLxPJoJgDJJ7xWtlV++Kr0+b5HTOpiP8eBmqTdDYV9OVTyS1vh0BEeVSXutbPk0Q2LXZTIrZL1qokxHgaI7nmoccyS5EWRMSUj+E/Us/tl8zMhxA0iKQ4MWeKzBZURoCaAuwisERLa+WcKMzMIdAXAQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR12MB6604.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(366004)(136003)(396003)(39860400002)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(6666004)(31686004)(53546011)(2616005)(107886003)(6506007)(6512007)(86362001)(36756003)(31696002)(38100700002)(83380400001)(2906002)(7416002)(41300700001)(6486002)(478600001)(316002)(8676002)(8936002)(4326008)(66946007)(26005)(5660300002)(110136005)(66556008)(54906003)(66476007)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?L2paRkxCa0JlTFkyUTJvcnlabzIzZjZScjlVUk0vRWV4YnhZT0hWY3RLK0Rq?= =?utf-8?B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WJ4bU0raC9hOC84L0pMZzNGTXE5SEFaVFA1ZXE0?= =?utf-8?B?Kzh2dFc1U2FtT25OTS9ZOThhVEZHWlJ4Ky9rRGZJMXZxQ0QwV0pRQ0V3VXJ1?= =?utf-8?B?RXF2ZVIzVmV4YkwwRTJZSnZZU3FUWVc5Uk1hUVJXV0Q1aFQ1UzNZTXJlcVlz?= =?utf-8?B?M21qV2dCNWR1NVVNNnBPb28zdTFlVFNQcVlZZ09NSUpUaWpzU3VLSEErV2dK?= =?utf-8?B?S1NqUFlEdm9Odk1zbUczd1JpTjRWSmNHZWQ3VzdON1pJWktva21lWTJSTENj?= =?utf-8?Q?y2WS5bMlLzAIEUcZCTezDZRRE?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 23343a93-402b-4ba2-6e93-08dbc9c782c1 X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB6604.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2023 19:31:33.4469 (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: yzQwAUu/v+qN7AXZcYCb/nWbBt3praXRHfJN8p8tQZXXWOdwcI6Ah1AEES25r54tWK2lTGcc+OVbNQaUOjL2gw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6801 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 10 Oct 2023 12:31:54 -0700 (PDT) On 10/10/23 9:19 AM, Dipen Patel wrote: > On 10/10/23 8:17 AM, Andy Shevchenko wrote: >> From: Bartosz Golaszewski >> >> Using struct gpio_chip is not safe as it will disappear if the >> underlying driver is unbound for any reason. Switch to using reference >> counted struct gpio_device and its dedicated accessors. >> >> Signed-off-by: Bartosz Golaszewski >> Tested-by: Dipen Patel >> Reviewed-by: Linus Walleij >> [andy: used gpio_device_find_by_fwnode()] >> Signed-off-by: Andy Shevchenko >> --- >> drivers/hte/hte-tegra194.c | 33 +++++++++++++++++++-------------- >> 1 file changed, 19 insertions(+), 14 deletions(-) >> >> diff --git a/drivers/hte/hte-tegra194.c b/drivers/hte/hte-tegra194.c >> index 9fd3c00ff695..339ff5921ec8 100644 >> --- a/drivers/hte/hte-tegra194.c >> +++ b/drivers/hte/hte-tegra194.c >> @@ -132,7 +132,7 @@ struct tegra_hte_soc { >> const struct tegra_hte_data *prov_data; >> struct tegra_hte_line_data *line_data; >> struct hte_chip *chip; >> - struct gpio_chip *c; >> + struct gpio_device *gdev; >> void __iomem *regs; >> }; >> >> @@ -421,7 +421,7 @@ static int tegra_hte_line_xlate(struct hte_chip *gc, >> * HTE/GTE namespace. >> */ >> if (gs->prov_data->type == HTE_TEGRA_TYPE_GPIO && !args) { >> - line_id = desc->attr.line_id - gs->c->base; >> + line_id = desc->attr.line_id - gpio_device_get_base(gs->gdev); >> map = gs->prov_data->map; >> map_sz = gs->prov_data->map_sz; >> } else if (gs->prov_data->type == HTE_TEGRA_TYPE_GPIO && args) { >> @@ -643,12 +643,15 @@ static irqreturn_t tegra_hte_isr(int irq, void *dev_id) >> static bool tegra_hte_match_from_linedata(const struct hte_chip *chip, >> const struct hte_ts_desc *hdesc) >> { >> + struct gpio_device *gdev __free(gpio_device_put) = NULL; >> struct tegra_hte_soc *hte_dev = chip->data; >> >> if (!hte_dev || (hte_dev->prov_data->type != HTE_TEGRA_TYPE_GPIO)) >> return false; >> >> - return hte_dev->c == gpiod_to_chip(hdesc->attr.line_data); >> + gdev = gpiod_to_device(hdesc->attr.line_data); >> + >> + return hte_dev->gdev == gdev; >> } >> >> static const struct of_device_id tegra_hte_of_match[] = { >> @@ -676,14 +679,11 @@ static void tegra_gte_disable(void *data) >> tegra_hte_writel(gs, HTE_TECTRL, 0); >> } >> >> -static int tegra_get_gpiochip_from_name(struct gpio_chip *chip, void *data) >> +static void tegra_hte_put_gpio_device(void *data) >> { >> - return !strcmp(chip->label, data); >> -} >> + struct gpio_device *gdev = data; >> >> -static int tegra_gpiochip_match(struct gpio_chip *chip, void *data) >> -{ >> - return chip->fwnode == of_node_to_fwnode(data); >> + gpio_device_put(gdev); >> } >> >> static int tegra_hte_probe(struct platform_device *pdev) >> @@ -763,8 +763,8 @@ static int tegra_hte_probe(struct platform_device *pdev) >> >> if (of_device_is_compatible(dev->of_node, >> "nvidia,tegra194-gte-aon")) { >> - hte_dev->c = gpiochip_find("tegra194-gpio-aon", >> - tegra_get_gpiochip_from_name); >> + hte_dev->gdev = >> + gpio_device_find_by_label("tegra194-gpio-aon"); >> } else { >> gpio_ctrl = of_parse_phandle(dev->of_node, >> "nvidia,gpio-controller", >> @@ -775,14 +775,19 @@ static int tegra_hte_probe(struct platform_device *pdev) >> return -ENODEV; >> } >> >> - hte_dev->c = gpiochip_find(gpio_ctrl, >> - tegra_gpiochip_match); >> + hte_dev->gdev = >> + gpio_device_find_by_fwnode(of_fnode_handle(gpio_ctrl)); I think there is typo for of_fnode*. Should it be of_fwnode*? >> of_node_put(gpio_ctrl); >> } >> >> - if (!hte_dev->c) >> + if (!hte_dev->gdev) >> return dev_err_probe(dev, -EPROBE_DEFER, >> "wait for gpio controller\n"); >> + >> + ret = devm_add_action_or_reset(dev, tegra_hte_put_gpio_device, >> + hte_dev->gdev); >> + if (ret) >> + return ret; >> } >> >> hte_dev->chip = gc; > > Looks good to me, I will wait for others to comment and will test out (2,3,4 > also) probably end of the day 11th Oct. >