From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [80.237.130.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 034D82F25 for ; Tue, 8 Feb 2022 12:24:34 +0000 (UTC) Received: from ip4d144895.dynamic.kabel-deutschland.de ([77.20.72.149] helo=[192.168.66.200]); authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1nHPXq-0006Dt-4I; Tue, 08 Feb 2022 13:24:31 +0100 Message-ID: Date: Tue, 8 Feb 2022 13:24:29 +0100 Precedence: bulk X-Mailing-List: regressions@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] gpio: Revert regression in sysfs-gpio (gpiolib.c) Content-Language: en-BS To: Marcelo Roberto Jimenez Cc: Bartosz Golaszewski , stable , regressions@lists.linux.dev, Linus Walleij , "open list:GPIO SUBSYSTEM" , Thierry Reding , Vidya Sagar , Geert Uytterhoeven , Stephen Rothwell , Edmond Chung , Andrew Chant , Will McVicker , Sergio Tanzilli References: <20211217153555.9413-1-marcelo.jimenez@gmail.com> <37d074c7-b264-acac-4bf6-65caa4dbab1a@leemhuis.info> From: Thorsten Leemhuis In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;regressions@leemhuis.info;1644323075;8f0c81af; X-HE-SMSGID: 1nHPXq-0006Dt-4I Hi, this is your Linux kernel regression tracker speaking. Top-posting for once, to make this easy accessible to everyone. GPIO Maintainers and developers, what the status of this regression and getting it fixed? It looks like there was no progress for quite a while. Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat) P.S.: As the Linux kernel's regression tracker I'm getting a lot of reports on my table. I can only look briefly into most of them and lack knowledge about most of the areas they concern. I thus unfortunately will sometimes get things wrong or miss something important. I hope that's not the case here; if you think it is, don't hesitate to tell me in a public reply, it's in everyone's interest to set the public record straight. #regzbot poke On 12.01.22 01:09, Marcelo Roberto Jimenez wrote: > Hi, > > On Mon, Jan 10, 2022 at 4:02 AM Thorsten Leemhuis > wrote: >> >> Hi, this is your Linux kernel regression tracker speaking. >> >> On 20.12.21 21:41, Marcelo Roberto Jimenez wrote: >>> On Mon, Dec 20, 2021 at 11:57 AM Bartosz Golaszewski wrote: >>>> On Sat, Dec 18, 2021 at 7:28 AM Thorsten Leemhuis >>>> wrote: >>>>> >>>>> [TLDR: I'm adding this regression to regzbot, the Linux kernel >>>>> regression tracking bot; most text you find below is compiled from a few >>>>> templates paragraphs some of you might have seen already.] >>>>> >>>>> On 17.12.21 16:35, Marcelo Roberto Jimenez wrote: >>>>>> Some GPIO lines have stopped working after the patch >>>>>> commit 2ab73c6d8323f ("gpio: Support GPIO controllers without pin-ranges") >>>>>> >>>>>> And this has supposedly been fixed in the following patches >>>>>> commit 89ad556b7f96a ("gpio: Avoid using pin ranges with !PINCTRL") >>>>>> commit 6dbbf84603961 ("gpiolib: Don't free if pin ranges are not defined") >>>>> >>>>> There seems to be a backstory here. Are there any entries and bug >>>>> trackers or earlier discussions everyone that looks into this should be >>>>> aware of? >>>> >>>> Agreed with Thorsten. I'd like to first try to determine what's wrong >>>> before reverting those, as they are correct in theory but maybe the >>>> implementation missed something. >>>> >>>> Have you tried tracing the execution on your platform in order to see >>>> what the driver is doing? >>> >>> Yes. The problem is that there is no list defined for the sysfs-gpio >>> interface. The driver will not perform pinctrl_gpio_request() and will >>> return zero (failure). >>> >>> I don't know if this is the case to add something to a global DTD or >>> to fix it in the sysfs-gpio code. >> >> Out of interest, has any progress been made on this front? >> >> BTW, there was a last-minute commit for 5.16 yesterday that referenced >> the culprit Marcelo specified: >> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=master&id=c8013355ead68dce152cf426686f8a5f80d88b40 >> >> This was for a BCM283x and BCM2711 devices, so I assume it won't help. >> Wild guess (I don't know anything about this area of the kernel): >> Marcelo, do the dts files for your hardware maybe need a similar fix? > > I have tried to add "gpio-ranges" to the gpio-controllers in > at91sam9x5.dtsi, but the system deadlocks, because in pinctrl-at91.c, > function at91_pinctrl_probe() we have: > > /* > * We need all the GPIO drivers to probe FIRST, or we will not be able > * to obtain references to the struct gpio_chip * for them, and we > * need this to proceed. > */ > for (i = 0; i < gpio_banks; i++) > if (gpio_chips[i]) > ngpio_chips_enabled++; > > if (ngpio_chips_enabled < info->nactive_banks) { > dev_warn(&pdev->dev, > "All GPIO chips are not registered yet (%d/%d)\n", > ngpio_chips_enabled, info->nactive_banks); > devm_kfree(&pdev->dev, info); > return -EPROBE_DEFER; > } > > On the other hand, in gpiolib-of.c, function > of_gpiochip_add_pin_range() we have: > > if (!pctldev) > return -EPROBE_DEFER; > > In other words, the pinctrl needs all the gpio-controllers, and the > gpio-controllers need the pinctrl. Each returns -EPROBE_DEFER and the > system deadlocks. > >> >> Ciao, Thorsten >> >> P.S.: As a Linux kernel regression tracker I'm getting a lot of reports >> on my table. I can only look briefly into most of them. Unfortunately >> therefore I sometimes will get things wrong or miss something important. >> I hope that's not the case here; if you think it is, don't hesitate to >> tell me about it in a public reply, that's in everyone's interest. >> >> BTW, I have no personal interest in this issue, which is tracked using >> regzbot, my Linux kernel regression tracking bot >> (https://linux-regtracking.leemhuis.info/regzbot/). I'm only posting >> this mail to get things rolling again and hence don't need to be CC on >> all further activities wrt to this regression. >> >> #regzbot poke >> > > Regards, > Marcelo. > >