Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp392747pxb; Sat, 10 Apr 2021 06:19:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9YayJlPodttd8RPsgyLjMm3Dys0b+jui09R5k3m1aA8wP5fiThpGxmukXlGpf5KrCnGXR X-Received: by 2002:a65:6415:: with SMTP id a21mr17798108pgv.417.1618060740425; Sat, 10 Apr 2021 06:19:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618060740; cv=none; d=google.com; s=arc-20160816; b=VUWLJI40xsN4bJxoz660AgoXOjmK9x0W4Kk9UnDRNt9Y8vGxqjQVUbylJBzTX2n/r6 uQRd4d8NS86okSqMOE7x7sweai7qtd6Kx/wILdGU3YcmEP3nDEGA3/Qcq+IXSCPTG9zT hq/K9s4yo9R3ttZQARz+GQN2+EpcGYirCgyiA5sORj0VcyXS1ho9QPb01OgE1Xs2jVQb 0rM4s6o0tTec03UGTeFedTddvWisMZJwxKVDQb7y0AsPc1vfulKi2y5lGA3HS201fCkE +Lhf9oyPqxGz6/MoQod1ITZcdgcRcxHrQssOmpaOAULHc87A824h7s4gh2+XQvqc3cUC zc/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=SP1Xb30MptYLP/0miAsEqbTIYI+F3i3O67//Pima43I=; b=q35DeEVJxOZUS8Zlzfx0ZXqCDrh1gwVQEVQK56g9tmD2dA5NaJaYzBgyXQX0HuHuj/ ABLJA4mOYG0XV5jWqYIJCVDIjJCBTrQvI+j/adGdAhMp6CT4xwF+zEvAzaAlPBTtDDub 1na+Jo4PYoz8sfCMpG13VC46TPQeTuZJF/wjCbN2QdXUKbkP4CwEZtMRt8fjdMCP6Rld 9o2meXD5st5574oXk0LAzidBjxxM5xnCYp6G6fb+sfi/hwZLXLdtnnaZenADq+oBCkRw pD+X23+rPAStzcAIQxnGJxgvxXriKYf5Dp7C5HlbSJBXkI0SzQQbpayjXXTVtksDkPQc 02aA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t18si6639533plo.403.2021.04.10.06.18.47; Sat, 10 Apr 2021 06:19:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234708AbhDJNS3 (ORCPT + 99 others); Sat, 10 Apr 2021 09:18:29 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:52290 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234262AbhDJNS3 (ORCPT ); Sat, 10 Apr 2021 09:18:29 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4FHbCm3ymZz1s2K6; Sat, 10 Apr 2021 15:18:12 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4FHbCm2vWBz1qqwx; Sat, 10 Apr 2021 15:18:12 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id vHMAnVr03gwN; Sat, 10 Apr 2021 15:18:10 +0200 (CEST) X-Auth-Info: RGcXB+iopJ+4TeVqcxAEHEGJxp5Cx/Cne2UyxCPzL3A= Received: from [IPv6:::1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sat, 10 Apr 2021 15:18:10 +0200 (CEST) Subject: Re: [PATCH v1 1/1] gpiolib: Read "gpio-line-names" from a firmware node To: Bartosz Golaszewski Cc: Andy Shevchenko , Bartosz Golaszewski , Andy Shevchenko , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Linus Walleij , Roman Guskov References: <20210305120240.42830-1-andriy.shevchenko@linux.intel.com> <5bf6771d-5783-0a40-5a72-7ddbb9c694aa@denx.de> From: Marek Vasut Message-ID: Date: Sat, 10 Apr 2021 15:18:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/10/21 11:06 AM, Bartosz Golaszewski wrote: > On Sat, Apr 10, 2021 at 2:46 AM Marek Vasut wrote: >> >> On 3/15/21 6:04 PM, Andy Shevchenko wrote: >>> On Mon, Mar 15, 2021 at 6:49 PM Bartosz Golaszewski >>> wrote: >>>> >>>> On Mon, Mar 15, 2021 at 3:34 PM Andy Shevchenko >>>> wrote: >>>>> >>>>> On Mon, Mar 15, 2021 at 03:04:37PM +0100, Bartosz Golaszewski wrote: >>>>>> On Mon, Mar 15, 2021 at 1:50 PM Andy Shevchenko >>>>>> wrote: >>>>>>> >>>>>>> On Mon, Mar 15, 2021 at 12:16:26PM +0200, Andy Shevchenko wrote: >>>>>>>> On Mon, Mar 15, 2021 at 10:01:47AM +0100, Bartosz Golaszewski wrote: >>>>>>>>> On Fri, Mar 5, 2021 at 1:03 PM Andy Shevchenko >>>>>>>>> wrote: >>>>>>>> >>>>>>>>> Unfortunately while this may fix the particular use-case on STM32, it >>>>>>>>> breaks all other users as the 'gpio-line-names' property doesn't live >>>>>>>>> on dev_fwnode(&gdev->dev) but on dev_fwnode(chip->parent). >>>>>>>>> >>>>>>>>> How about we first look for this property on the latter and only if >>>>>>>>> it's not present descend down to the former fwnode? >>>>>>>> >>>>>>>> Oops, I have tested on x86 and it worked the same way. >>>>>>>> >>>>>>>> Lemme check this, but I think the issue rather in ordering when we apply fwnode >>>>>>>> to the newly created device and when we actually retrieve gpio-line-names >>>>>>>> property. >>>>>>> >>>>>>> Hmm... I can't see how it's possible can be. Can you provide a platform name >>>>>>> and pointers to the DTS that has been broken by the change? >>>>>>> >>>>>> >>>>>> I noticed it with gpio-mockup (libgpiod tests failed on v5.12-rc3) and >>>>>> the WiP gpio-sim - but it's the same on most DT platforms. The node >>>>>> that contains the `gpio-line-names` is the one associated with the >>>>>> platform device passed to the GPIO driver. The gpiolib then creates >>>>>> another struct device that becomes the child of that node but it >>>>>> doesn't copy the parent's properties to it (nor should it). >>>>>> >>>>>> Every driver that reads device properties does it from the parent >>>>>> device, not the one in gdev - whether it uses of_, fwnode_ or generic >>>>>> device_ properties. >>>>> >>>>> What you are telling contradicts with the idea of copying parent's fwnode >>>>> (or OF node) in the current code. >>>>> >>>> >>>> Ha! While the OF node of the parent device is indeed assigned to the >>>> gdev's dev, the same isn't done in the core code for fwnodes and >>>> simulated chips don't have an associated OF node, so this is the >>>> culprit I suppose. >>> >>> Close, but not fully correct. >>> First of all it depends on the OF / ACPI / platform enumeration. >>> Second, we are talking about secondary fwnode in the case where it happens. >>> >>> I'm in the middle of debugging this, I'll come up with something soon I believe. >> >> Was there ever any follow up on this ? >> >> I would like to point out that on STM32MP1 in Linux 5.10.y, the >> gpio-line-names are still broken, and a revert of "gpiolib: generalize >> devprop_gpiochip_set_names() for device properties" is still necessary. > > Yes, Andy has fixed that in commit b41ba2ec54a7 ("gpiolib: Read > "gpio-line-names" from a firmware node") but for some reason this has > never made its way into stable. I'll resend it. Yes, that's the missing one, thanks. With that picked, the mp1 is fine.