Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3339296rdg; Tue, 17 Oct 2023 11:24:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEutbuxEor1PDhGbheqvOhk2WaaNV0Y266kAP+4gZSLxzHbliBnAilOHFPL79r0LJ6FbMmv X-Received: by 2002:a05:6a00:1788:b0:68e:351b:15b9 with SMTP id s8-20020a056a00178800b0068e351b15b9mr3739929pfg.4.1697567053665; Tue, 17 Oct 2023 11:24:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697567053; cv=pass; d=google.com; s=arc-20160816; b=wSZq8TVg/ZQd+xKYEp9Dged0NRYqMqYQuBvqtHwdrl3jgqxhbBoHWCXgELcZDQd+J9 t46wSsaE4LoVq4rQioGo2YTA/1hYDNkzVGdJwI5vFuwpkQdMI/xhBBpJeR/KitQaa3FU VfYPc6nkrzwT0vb8FSJzSbvKKeBN02XY0ggUNQsONhYQFNDymUL4zLyTLdZsUVhuMyY9 0c0ac55wvssvXU7//jU9XcOazQBaqxtWy88lJaaZtTiav7z14CFq8haoyhC4q53m3aCq bja1bb1DZN7S/ke5WXVYCCFd9C/fTFPuQWn9mGzCjaj0PAY4lLK6KNRYjSdGU9Hfa6SW WHcA== 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=RZw9p1UmRNkyjSlhsvKorIebmTZBjJX8ajiSCcgPPsw=; fh=Igl2Pbokmi9OfVUhTe6QhPyc17zXNy9NvsYBaA0raFQ=; b=ArHYtR7nSGE4Zf4eb/df+rY6brYIL36f63ozOzkgqjLlCa+Z+b/8WTOrEmM3VGDX8+ U2VkWsCsDChS9VzhQMpgYAMwNVLDMU/J/xCd6D1RoXHyUP6kf5r1nwsD5RVZsVfWD2sh HeKIF8ZdwCo+dXHjABhHvWCqy8mtSR0r5Y/QOPzkeeOf+ov2MVC0XeRONEOtqvKi8Ou+ Rwv3iwws7JLECJ4BCJHSD1HS9vqJCtvI6LHuDgkDp1SIlDKIlOCkES1WeqmgRNx7tCdI /bM3HpkefwCoyK53ulvzsP9mSngD02aBnbApGOz/pYfpTL7B6PHNWpGAGr6xbl4ogeVe BO3w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=ct5+vTE3; 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.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id r29-20020aa7963d000000b006be3c302801si2035759pfg.397.2023.10.17.11.24.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 11:24:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=ct5+vTE3; 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.36 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 pete.vger.email (Postfix) with ESMTP id 15D6180296D8; Tue, 17 Oct 2023 11:24:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343923AbjJQSXl (ORCPT + 99 others); Tue, 17 Oct 2023 14:23:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343775AbjJQSXj (ORCPT ); Tue, 17 Oct 2023 14:23:39 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2078.outbound.protection.outlook.com [40.107.244.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED63C95 for ; Tue, 17 Oct 2023 11:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AZL4oSAWCaksAxYObQVn7Cw6TspcHXMEO23joWH9GVpPBhvlhA7Rj17yXZkZsWxWff98yND1r6xz89uH8krsiogeAjlIE8ExHzWGfQMpyvE8JZALgTyofZT8qyArcZydVBYinnh5DHlY6bFMXMjY6M17nx/3KtpimVMApg2IBJ/KIJ4q8EOkMnBC1R4F5FiYtLgLySQ0A+OG3ldC3lGKAptiwpaDSoNf/QWz8rYhBjuqDfUV+9DXx7zcIMc6Y6TtPPWfKK2LI3X0w+LUFbDSuaozfz8URFzBg1QCgy6yWbNKMLCELXBYL0FJFYXXRHQ/MTA7CTRWq5Qt2gCDQoJhUQ== 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=RZw9p1UmRNkyjSlhsvKorIebmTZBjJX8ajiSCcgPPsw=; b=R5G6FTeoXJ598v2ORck5sqG4neUb7hioBQetafZyUaoIe28Z1R8L2ujGKB1yM0vvpdY3rG2OwPgY1XphnGWZuLaX44HWuMgP3a5fXVdPXp3XFGeroIFzJFSUlTc+a6R163JiU9TbpeyFWzFF4R9gONeor68/ih2fq1twyzMtKaPEt8aY1AhQvdd4SqfSrAW9ba104HpStrkLkK8Kwta2K2IUKxmK4VOuDgI+U39tdxTQu0b8AObyDj0h83aoYaY03iQ2QYe29b28JuAzD7caTIhJl7Uw7rM6kbNCDBd+lA9zRN5t5SryqRUN9pN3S1qNuip5rPeFflDe+lVhSnt5JQ== 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=RZw9p1UmRNkyjSlhsvKorIebmTZBjJX8ajiSCcgPPsw=; b=ct5+vTE3OIZwky4QMnrnln4obrgx0Au1W2RtWMshvAa6hMUQXQJwWz64eoxymL9JMrofrs4R8tP5BfvN2wztEah+DbnlET5iaDEp6N8JbT51NGrbYu3zqipysuAetIc9LgaRm6vJioAABQh4ckfCMZKvZGa/e9714HksJXOliaGB/us2DDAiuuW3cZUuKTXdJM9JT8LBf9uoii4oz67LNCbK0sbvYXQC/i2ddAgVqs8menctXQseMTVcpPBPVhT1/OUVKMomCFEubhw4N19wiKZwl+NOMSjy8urIeicuLEpKJ9vQChpIPWjcZPoeD8vzryj6uwsOgy03LRUJOFjo+Q== 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 IA0PR12MB7577.namprd12.prod.outlook.com (2603:10b6:208:43e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Tue, 17 Oct 2023 18:23:35 +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.6907.021; Tue, 17 Oct 2023 18:23:34 +0000 Message-ID: <74a8acea-1064-a759-53eb-ed0ea0fbb7d6@nvidia.com> Date: Tue, 17 Oct 2023 11:23:30 -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 v2] hte: tegra194: don't access struct gpio_chip Content-Language: en-US To: Bartosz Golaszewski , Thierry Reding , Jonathan Hunter , Linus Walleij , Andy Shevchenko Cc: timestamp@lists.linux.dev, linux-kernel@vger.kernel.org, Bartosz Golaszewski , Andy Shevchenko References: <20231013072340.16411-1-brgl@bgdev.pl> X-Nvconfidentiality: public From: Dipen Patel In-Reply-To: <20231013072340.16411-1-brgl@bgdev.pl> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR07CA0091.namprd07.prod.outlook.com (2603:10b6:a03:12b::32) To IA1PR12MB6604.namprd12.prod.outlook.com (2603:10b6:208:3a0::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR12MB6604:EE_|IA0PR12MB7577:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e925017-445f-4d6a-bc98-08dbcf3e2bd3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R2IuPR+zvzIKAtZz7Vrh6KRuNvBv8t/dZ02P/rhguTrz+KkGZkxcFpIIZd2c3g0W01lZtVShXQSud7uz0YbpH1JcjU8IGUQfKjkkYJrXRX2u10x1pO1hNcEUQBXAOFPasTftSrEE3ockRNfYvtE3ctH+ojpAWJ2fnKGl18d2K/ZWWZXvFcinms0Gi8QgnKW1R5uYosrDFSBEnyfDaiBHFgU89gtb1BbUBckNLCOqeNBADcxlb7xuQQCnMZF9sGW4LPpvVFeJyN0z9lPGhLDlP3EMyggn5rzdrgRdfRXWa+64MTZ9S6lkTrQ9vsY0d755mFjPFsarS8T4MQ303G43bK/69wOAsC9+Xn45vepw7SW/Mj2QDgRv+QiBMlThU0dkMhBPAXrKV+7ghDsH0Um90lKdFqVMqStBcpqqr6/5dBj3wx8PumH8csvuk6je95ik3mjZAn66b9PhtMA3pEskKVP6beRg8100/46yKi2E87jU/fD5XzPIV6Irm4yqIANPffRBViCHQ4fGB1wbMbu6oSBV+TsWJH4f7lhPxLJ9SjECbXydbkS4Op7oxKwmUam6aTP17mg+f7dE2krWwx+bJoJdOGCf3B1yLoEcHPYLEKQVmO/E5U7m7VILjCK8CFImmzSrsk7tdg/+B02M5DnTONVUOE6AC+ZKrsS7ITdS6FtfpsPG/RMdpEr+qlgm255AZn6qsdnMtYYpJ3dZLia4rQwL4040aEhuZcy3WP4lEbA= 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)(136003)(376002)(39860400002)(396003)(366004)(230922051799003)(451199024)(1800799009)(64100799003)(186009)(6666004)(31696002)(6506007)(5660300002)(2906002)(8936002)(6486002)(478600001)(4326008)(8676002)(110136005)(316002)(66946007)(66476007)(66556008)(54906003)(41300700001)(36756003)(83380400001)(966005)(26005)(31686004)(6512007)(53546011)(38100700002)(86362001)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UUdCQmFCb2hSdVdXb05OZXZ1bUwzZG03SVV2S3Y3V29hdHIzZC9waWNCWnp3?= =?utf-8?B?SkMvcHp1Ynh6aUNWNklNTTEvSUlTOXNnNW9ZSnNMYkJpM1Bla0ZDMlQrMzVu?= =?utf-8?B?S2k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4Qm9iV1didTFVUTN4RFRG?= =?utf-8?B?UmV0aHhESktpQ3lMMjFjV3A2dVpXN1BtdncyMDhTRXRweGZKRDYzalArSkIy?= =?utf-8?B?bndNUVJRbzlXNjlnbGcvVkI5K08xcUhEbW5hdGJOWjFrS0luTUhKMVRVaThO?= =?utf-8?B?eHQ3U2xrVHNRQ3B4K3NNMGdMcTk3SjNhci9YTklFTUpOSXNJajkxOGo5eThE?= =?utf-8?Q?hgGCd1iAhl/J+ZHA47N5LZOy5?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e925017-445f-4d6a-bc98-08dbcf3e2bd3 X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB6604.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 18:23:34.9068 (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: +aLhc1ONfUlRWpPAO5QNqrRCrT0HK2WRj4J+uuDPnzgf7y6WYMeIEz7cbDU6PlhurEifahjFDlDFK7UDpP3n2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7577 X-Spam-Status: No, score=-4.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 pete.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 (pete.vger.email [0.0.0.0]); Tue, 17 Oct 2023 11:24:11 -0700 (PDT) On 10/13/23 12:23 AM, Bartosz Golaszewski 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()] > Reviewed-by: Dipen Patel > Link: https://lore.kernel.org/r/20231010151709.4104747-3-andriy.shevchenko@linux.intel.com > Signed-off-by: Andy Shevchenko > --- > Dipen, > > Can you retest this patch now rebased on top of current GPIO for-next? Tested-by: Dipen Patel > > v1 -> v2: > - rebase on top of current gpio/for-next > > drivers/hte/hte-tegra194.c | 30 ++++++++++++++++-------------- > 1 file changed, 16 insertions(+), 14 deletions(-) > > diff --git a/drivers/hte/hte-tegra194.c b/drivers/hte/hte-tegra194.c > index 6fe6897047ac..341a134cb7d0 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; > }; > > @@ -418,7 +418,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) { > @@ -645,7 +645,7 @@ static bool tegra_hte_match_from_linedata(const struct hte_chip *chip, > 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); > + return hte_dev->gdev == gpiod_to_gpio_device(hdesc->attr.line_data); > } > > static const struct of_device_id tegra_hte_of_match[] = { > @@ -673,14 +673,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) > @@ -760,8 +757,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", > @@ -772,14 +769,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_fwnode_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;