Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp178642rdg; Tue, 10 Oct 2023 07:26:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG6zVLzzDy9DnWcjm74CgWQBFedcBhbYEH5U0nHXnENTz5+roalC4UcBN/xUyGLdYjC+WMc X-Received: by 2002:a17:902:d490:b0:1c6:19da:b29d with SMTP id c16-20020a170902d49000b001c619dab29dmr18686439plg.44.1696947999275; Tue, 10 Oct 2023 07:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696947999; cv=none; d=google.com; s=arc-20160816; b=JjOUolJ5dBMKj9olZoWT1vjkA5ul+sianBl5ilwT75onYaVB0kn+x3hEoqbISXgiJa e68eIrgDCPUqZ0QNBhucIXkSZzA0wyqwwdXp8tjLodYmuq8PNTMQYHo4+aGWaBI+olvZ BY7Px3iWNQ4aqSHpeWphHMXKwjo5JjxDh3wI1/kGD280mHw6/0TQ8NAReV3AXaQla6u/ MembYu0X/gOH1+n92vRzYLEBO1z9n5JprrHdY2bGMFvOxIIz2Z99gL1+KRkQNKiIhBAO uNnSFNx1aza8ILN5xjAx06gfwJnQZGegNc/34OQTjkawtbgImCWHkmtRfaSEuCCfJ/On LyTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=fCQgnzaIaOSbXWoepCdTdDgPtTMXa7oTTaeLdjGlDQs=; fh=vj6uynCxX1PIjx28RkHRDil9ntV7XPNFYulihnoZdUg=; b=SowT4H5t3Oj78NfjOZCo5Af8BDX9Kpi9ieX5hfUBMrGAZL6mZyPPPB1an0aABd42Mx lRcNZmm4clbJQ0TgBiU46CHhzyoJnCBDppsE1ZgV8yH0o39NYqmnhU7nycN7raP+vPx5 H4Blt+LPZB5nEjhZT+oHaoNgngDgRUDO+qcd5y3pLxthqdjhV+iu2GYLtiXsp4UoGeVe o/wouTtPdufZCfEiqzdrV1sb2E0Jbhu4EKuP1J/J8C4q1Ikxln36l9ELLZ59Pomtf2fg KfwsOP0vl8ZHQXiDFhjOFSYFDl8kFmSc+mmoucmLnh9/irQh4uBZG18WLVIkHysnDF4O tccQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id l20-20020a170903005400b001c474ff2fdesi2073294pla.378.2023.10.10.07.26.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 07:26:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 9037E8022C1E; Tue, 10 Oct 2023 07:25:20 -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 S232977AbjJJOZO (ORCPT + 99 others); Tue, 10 Oct 2023 10:25:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232460AbjJJOZN (ORCPT ); Tue, 10 Oct 2023 10:25:13 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 571FDB4; Tue, 10 Oct 2023 07:25:12 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="388274687" X-IronPort-AV: E=Sophos;i="6.03,212,1694761200"; d="scan'208";a="388274687" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 07:25:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="703332710" X-IronPort-AV: E=Sophos;i="6.03,212,1694761200"; d="scan'208";a="703332710" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 07:25:09 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC1) (envelope-from ) id 1qqDfW-00000004MZ9-42f5; Tue, 10 Oct 2023 17:25:06 +0300 Date: Tue, 10 Oct 2023 17:25:06 +0300 From: Andy Shevchenko To: Dipen Patel Cc: linus.walleij@linaro.org, brgl@bgdev.pl, thierry.reding@gmail.com, jonathanh@nvidia.com, linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] gpio: tegra186: Set fwnode of the GPIO chip Message-ID: References: <20231009173858.723686-1-dipenp@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=2.6 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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, 10 Oct 2023 07:25:20 -0700 (PDT) X-Spam-Level: ** On Tue, Oct 10, 2023 at 05:13:42PM +0300, Andy Shevchenko wrote: > On Tue, Oct 10, 2023 at 04:48:25PM +0300, Andy Shevchenko wrote: > > On Tue, Oct 10, 2023 at 04:13:19PM +0300, Andy Shevchenko wrote: > > > On Mon, Oct 09, 2023 at 10:38:58AM -0700, Dipen Patel wrote: ... > > > > + /* > > > > + * This is needed for driver using gpio device matching where it > > > > + * has to use gpio_chip fwnode to match the gpio controller. > > > > + */ > > > > + gpio->gpio.fwnode = of_node_to_fwnode(pdev->dev.of_node); > > > > > > of_node_to_fwnode() is specific to IRQ, in other places we use generic > > > of_fwnode_handle(). That's why better just to use dev_fwnode(). > > > > On the second thought is there any parent assigned? > > At least I see that in tegra186_gpio_probe(). Are you saying > > it is not working? Or is it (matching) called _before_ we > > add a GPIO device? > > Okay, I think I got it. There is a function called tegra_gpiochip_match() > in drivers/hte/hte-tegra194.c which fails after my patch. Yeah, if provider > doesn't set fwnode, it can't match. But, since the driver sets the parent > properly it means that the matching function should be done against the > device. > > Seems to me that in HTE code the matching function is broken. I'll send a patch soon. Please, test it. -- With Best Regards, Andy Shevchenko