Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp255858rdg; Tue, 10 Oct 2023 09:19:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6xg6Fyfhm0IlAzu9IC5o9BpGmacQWi+w1CoI+XRpOscAzy4IetbRq4grqvJ8iFSlF5KeS X-Received: by 2002:a05:6a00:2189:b0:693:3851:bd3e with SMTP id h9-20020a056a00218900b006933851bd3emr16532502pfi.3.1696954780815; Tue, 10 Oct 2023 09:19:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696954780; cv=pass; d=google.com; s=arc-20160816; b=eTT/6pysmBfwxRFusGqDxfAFwAN4rk4cP9UyzRG06y3EB2KVbihxzQXWdRtklknQ4x DFR8ZK13WwnDCvJiiZsX97N3eB6axUdofAY9q26Zv1qkxMNYjyUj0mwN6Eqx5q6DBx2j TdYZfjWS9gKBf5BlvUJsXVyp9ZKGpHLeoQx+nX3+0K1iuo6/Kd+B7Z7bgD5UI7Q1Qn+L TQLZwHq6oBbva6g5VLM7hCxb2l3/WBOCcYhw01MoHymYfqW+JrqQcRAQA3xDMooNOdLe zAqDyuVEosO/5+52DERncUtL3aOjttd6sHPKPRWaptTLRI5FalhJRgExOIzUYzzA2Vqb HLPg== 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=VfzkA0GQQLXO9CL/qP+sLdO+j/ZeJD4MDPWdzhJAQ4s=; fh=gFZdaDPDi9xTI9c+2i+uJhnwneUNEgRtnO14kpUZJO0=; b=dN1sQRqCGczhX6NexOgp3WrXMcDXbfM56H4gyYN+q1kqftcIBu40fbnNl8Pc0tD5U0 mlkzCBR9Q2KjI5uLRfxW9cbEBKGAu9+YDAHfw8FQS0aco7C2bjSz6IiNgkorV8rBsDxP 1EV8lCBD7G4mZkkMWwggEm0IX9c2fiV58OE/LWrdA6td0SYh1Hmrt/OvUdNnMwxE3za/ P/aK1nPPWnajuSZNlggqSL+oPuShSrNufhz4pRgB9Lt9Na61KcQvFfborH05WkFC8PX8 XuR3e6/8AdaKzzqU4qpkGFlomIcXypi5d7IAgPBtN7zdz007MXuihj7/YFRVVK5X4q1T JJWg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="s6i/WZpE"; 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::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b18-20020a056a0002d200b0069335e0c824si9395247pft.204.2023.10.10.09.19.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 09:19:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="s6i/WZpE"; 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::3:7 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 snail.vger.email (Postfix) with ESMTP id 97875802D524; Tue, 10 Oct 2023 09:19:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233751AbjJJQTg (ORCPT + 99 others); Tue, 10 Oct 2023 12:19:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbjJJQTf (ORCPT ); Tue, 10 Oct 2023 12:19:35 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2085.outbound.protection.outlook.com [40.107.212.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69F02AC; Tue, 10 Oct 2023 09:19:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c+pHb8h3arVAJp9Vpl8RHQSa49jYDqCu02P5uJVc+0HcZEYylb4Hn1NawQ0Er5HTegEnj27JasT2gkqjlOkyuTlk4yCcokNsk1PSJ1QX/unAGevp8kCeU1LLqiWcbCKd+84cka6YCPbVtS5chBtxlVmi9htRrKX2402CIqn0s33F2KZRk/VCtdbzZ8zk3X5FZpqluoahf8vtl+jwyyNKGryEU2BF9unFKoQ2v0+jWfRahxJOrUzFL98MQcQKhco+XSzXKCAPVw/XiKw8pPf9EJwShtCOc+FLBPaNU1NYTrLzUhpo6z5OmSNjD/Dh7yLNEgrLPZwCw+LFhDN6UXdIrA== 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=VfzkA0GQQLXO9CL/qP+sLdO+j/ZeJD4MDPWdzhJAQ4s=; b=XGxsT5VVAp5Z+mx03ZIK69DQwiyPHCP+aYCfO4qqbBv4HAjVpjewGVoo1+q7LXmtdZqc52mUGbVfRsQvKPp0tpZ2j6DcRXJtgaDmL35NqR1/M/RIQDNKQKcdQ6bFwbYok79tNPFdEtC5w9u1kJxAflbmJnRpotn0ZZOrSiUm7Na2lyQab526Gey91MvM8L6Q5vqGOEXjXhzacqlnyg5xI4TCzCtZ6QgSqPwetUuICSEZ5Rh7QQ7UR1/lZCMa/EIxVR23bBwlFD00pP3MK1WaJwG7HEVJWQPLRo7c9VxLau8JYZuIINFeUXMSI9N+pofjqJhNxncHdjATyt3D3BFzLw== 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=VfzkA0GQQLXO9CL/qP+sLdO+j/ZeJD4MDPWdzhJAQ4s=; b=s6i/WZpEpAl5KHCBn/cMQocr++nj5ze4h4W47ZxDL9lo7DN1DBpBOuIynRPHxsrkdxcFrtRzF4KZrcND7BY/+B4O2yesdCabv/cKl6tF5X46T3otRRUvbi24u5JleatzhCguodSFi8+Q58MDcph/jZ9XVQtms31j6+gVUx3g6Y0hMTnDFoRjFL91gXcGGTtwbfWIh2mrBnRVSLhmQLafHtwRSbZ4Mrqr8yq7+Jw8d28Z8HapWMVVo50MsXdbUmg0vUcv18ooZdnTG/9U0OF0pmXfa/iwHO/jWO0wO4VNBwg4nJxCMBzM73fg8dEgMnkFtU2VlLz5x6DV115Mg3lUgQ== 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 IA1PR12MB8555.namprd12.prod.outlook.com (2603:10b6:208:44f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.38; Tue, 10 Oct 2023 16:19:30 +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 16:19:30 +0000 Message-ID: <3e1e6acf-5862-9f35-cbe6-72bb17cf3851@nvidia.com> Date: Tue, 10 Oct 2023 09:19:27 -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 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> X-Nvconfidentiality: public From: Dipen Patel In-Reply-To: <20231010151709.4104747-3-andriy.shevchenko@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SJ0PR03CA0332.namprd03.prod.outlook.com (2603:10b6:a03:39c::7) To IA1PR12MB6604.namprd12.prod.outlook.com (2603:10b6:208:3a0::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR12MB6604:EE_|IA1PR12MB8555:EE_ X-MS-Office365-Filtering-Correlation-Id: 33ba1320-dc2b-4946-52de-08dbc9acae88 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AhP6fR+yRFeHgNj5F3wBDYHe4jigT1BvqIyPRr0iz6fnr1NwpgBJ0DCzajQcE6dfRy20bK4J+5QoFcYHJGyNQA43112Q0fgtRGlQTRi7SdpzoYZDLAA+zOXP3BKiLl03mZksh/TpoLBNAxkxPJWX6mgkXc103YYGMhTq8QHvVBSFk88gTiQqVvSj2I+mwv9/LCqkVRbQWxXqidRoPpOVlvb/mte4h/dPiFxDW7DnFqk0JFuDI1UNfJnT0yEGd3wHvWa/PhzkCDw/4T8R3NW0zoIv2S0ir7DLplWyaJZ8WCfNrovzpeRtnMxnmk+7etUZe7Vf81CS6yIFQ/EIb6s+seMvJRnfz9k27zmbQfp69R2GY4yJ7GD9LGskz3YiTgIWXy++6kktuyPqITkdzfFf2oPG/qXfoWQMjxybkR7MLrT++PrM+yiI9e76CLA7hnX6lP77ylAolZTaUVHHcrugtkdrXpM+Q4uD6fDg/3ZoeyWRmuRf1/sBl/lvtWrGWo8Pd25wSQi7bruzMz4z914KkgdrOd7D9ZFqHcV6uwivc0beNUdsaIH4z7hjDyG7Uv1Ue++EAmfYeOJa52BKNTxnhiC+goGkwH2WK0oEq+GTa+/0EZ6/uD3DFCfKLkZokUhGv0ub76GQErMxpyWVZ15Rtw== 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)(39860400002)(346002)(376002)(396003)(136003)(366004)(230922051799003)(1800799009)(64100799003)(186009)(451199024)(26005)(83380400001)(38100700002)(8936002)(4326008)(8676002)(110136005)(54906003)(66946007)(66476007)(316002)(2616005)(66556008)(107886003)(2906002)(5660300002)(7416002)(41300700001)(478600001)(53546011)(6506007)(6666004)(6486002)(6512007)(31696002)(86362001)(36756003)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TjV3T3N0M2dzblJ2cnNNcEtOakZ0Vyt2djhlOU5tRWhuL3ZhV1pDOCtFRnRt?= =?utf-8?B?WWZVSm0vbWVVbG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Tkl1?= =?utf-8?B?b2RreVVvYmNETHg1UU9aMmFjN1Z1dUhTSDJzU21DRm1kWlNlWEw2THN6cTll?= =?utf-8?B?YytBZTBMaDU1eEdZMVMwZWRQYWJIVTVLU0ZhODdQQkJmWW5odnNBZXpsUmtY?= =?utf-8?B?UThkMGdrNWY4dUxhaE0wWEVvdnQ2NGlZS1U0MXNEREt0R2pZbzluK0lxbkps?= =?utf-8?B?eHdsbWxiT25vVU5pSzZrVUVaM2drZUcrYUtMVmQwejk1VVBDYlBOQnBKTEhX?= =?utf-8?Q?TCVhEAv0OvK454Kwc6CmshlyP?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33ba1320-dc2b-4946-52de-08dbc9acae88 X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB6604.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2023 16:19:30.4497 (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: HXMj9n4sj/FW7ZoqWQkVB/7hCTXzR84hcl2MWc6iJINM1O974i7aYOMLkXKIJPYsepazjkcqCJBA+Nr7VIoeRA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8555 X-Spam-Status: No, score=-4.4 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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 10 Oct 2023 09:19:39 -0700 (PDT) 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)); > 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.