Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp344034pxp; Wed, 16 Mar 2022 06:59:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxS3/DAk3UGJ7Bj8ErqxrPOanIVi43ke0XqzGgTjXS0z+8rQO4aVSZ2boxnHznr2kE/mCFy X-Received: by 2002:a17:906:478c:b0:6df:6b35:156d with SMTP id cw12-20020a170906478c00b006df6b35156dmr109545ejc.578.1647439178833; Wed, 16 Mar 2022 06:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647439178; cv=none; d=google.com; s=arc-20160816; b=NS14Auxb64RDEU91FMa+7XaTWqpSa7dqKvpxADagtxM451BBOQtF7ERlkjT7vsQ0/X 1Y2RME5KSLsBcRh+D6qgw2DtkJMe/76i740+LfE20lvgAXoozDvdVFQe68m6TdWjdpyb JmA5H/2q60tW0YE5IRaGr8CoXGHGH++QuAzg+KU5/zR5ixk/vlbMtjgfVAccLta4rn0l v37BT0PVyRKkFCCf+8KcAM+c+ODi5qFf0NWvwJLpZzCz20iBtmm9m3wlNE3t+IFJgSlV 12CPTrKTFQlDFoZKXQH8DHNjABVFRSDfHJQZrg7wnqE61X6Xl5ewQMxOqidC7enpFPqQ l4tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=qheZ1ENvb9x/0d1hNVlELAPpvFkCjTkbEefvApG+abE=; b=qsDyWCVnivl4yRSIa5s7X3pfRHsWlhWjGD7z76qlCgSX365UQysnTKG+gklD3eA+az yick7cNoWQ4TmzTRT1wJ1Q9njnnz2kZkhxJMjub+GUwZH2Mkedolj0J8Y5Yuon9pMNP9 RgWUQRKuTtb1Ci4pyCqGKIj+HXvsQkdkSATgeayulxnptx9LiT93wrC3xcYJFAiMyGJR ZivLv6RF62OtFKScNZ62llks6r/ArkhF7c4u8L0NLrO4m8Np2fTj5GAoILIuz1CrY7I2 f3iG2mNY4tfBX8OW0fUUq4rFTxwKxXSguW1D1P5h1yyylLuzJ5VDYK+3uvPyQdjsCJyr +f8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=YcBDtxaz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb5-20020a170907960500b006cf0dd73024si1342565ejc.51.2022.03.16.06.59.09; Wed, 16 Mar 2022 06:59:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=YcBDtxaz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350193AbiCOQuF (ORCPT + 99 others); Tue, 15 Mar 2022 12:50:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350203AbiCOQt6 (ORCPT ); Tue, 15 Mar 2022 12:49:58 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15D42517D0 for ; Tue, 15 Mar 2022 09:48:45 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id qa43so42410003ejc.12 for ; Tue, 15 Mar 2022 09:48:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qheZ1ENvb9x/0d1hNVlELAPpvFkCjTkbEefvApG+abE=; b=YcBDtxazXi0/rbjjeFXc0/+X6MOk72vz+oc9wZNmmn/hyEyD5oDZ7/AFOtAUlfpJvx zvgLtC1TjtUmIfQiW2e35EfuMYVxo8igY34EIWuJEvC0eQFMdcRv//N2etI/2VA7mS1J Bk6WIPQUFn5kuQlrCq5PRwBxaphVupZiUFKvI9w4Y1s2szE78fIh7jJbCNLpwH7Ix/Ok 2vTiQdu2VUqkkQfiZw9dWkJhWTtgsjYbtHrUzmQZEMxDhUAp7DTW3ICVJvlrav7065jX b2AKguiStJ5f8kWKa7DwXAUV8xIPITyxe6XR8jaBaM1MH3Z1cNaJY8I8lD/HVVkmwdof 2bow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qheZ1ENvb9x/0d1hNVlELAPpvFkCjTkbEefvApG+abE=; b=XWF2HN1Gh9nHoNvbfzmuCIitD88B8jOb+rBkMu9i8C8KeagAaytJJIOTHUabVzUbBE AoDmYVOnwiX9TDjqv6+lKMW9El7ZiDiV1vBG8KUb5JKE/C0qIv29UGvbOn8rDdU5dio1 9391PBvpo1Eb+ZW6nKS2JYOeDTwncRxWnfl7gMp84JffMiq03Dxj1uwSipU0pyN9I5N7 V46k4xvvZduNKpryXXLzrL1yU/HoRWL1k44NLmWfFAtAsdGSWaSTUY2CmYps1JabuD32 a/yt/5E6JGl6MrEou3SPjD6c7O2NRYWsdTR9Dptb+nPVLa/zDbbFNaco3sqGXLgFSZQn bHMA== X-Gm-Message-State: AOAM530KX7dng31mTDET67qFgb4m03J1JKteHicNvjRZR011hk0Z0KHX wPz90tgikIYduXY+XBkWKbRUU+ZVlc2eGnxONiCu+w== X-Received: by 2002:a17:907:3f24:b0:6da:68fa:b2cc with SMTP id hq36-20020a1709073f2400b006da68fab2ccmr23711912ejc.734.1647362923497; Tue, 15 Mar 2022 09:48:43 -0700 (PDT) MIME-Version: 1.0 References: <20220314192522.GA3031157@roeck-us.net> In-Reply-To: From: Bartosz Golaszewski Date: Tue, 15 Mar 2022 17:48:32 +0100 Message-ID: Subject: Re: Linux 5.17-rc8 To: Linus Torvalds Cc: Marcelo Roberto Jimenez , Guenter Roeck , Thierry Reding , Linus Walleij , Vidya Sagar , Edmond Chung , Andrew Chant , Will McVicker , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 On Tue, Mar 15, 2022 at 2:47 AM Linus Torvalds wrote: > > On Mon, Mar 14, 2022 at 5:45 PM Marcelo Roberto Jimenez > wrote: > > > > At a certain point, I tried Thorsten's suggestion to add a gpio-ranges > > property in a way similar to another patch, but the kernel went into > > an EPROBE_DEFER deadlock. Thierry Reding made some comments about this > > in the sequence. > > Hmm. The problem does sound like that particular driver doesn't use > the pin_ranges thing, so then the tests for an empty pin_ranges will > always be true. > > The EPROBE_DEFER deadlock then sounds like something went wrong in the > gpio-ranges patch when you tried to fix it - but I don't actually find > that patch or that attempt, so I can't even guess at it. > > This whole code pin_ranges code looks very odd: > gpiochip_add_pin{group}_range() seems to add the pin ranges properly, > but that actual gpiochip_add_pin_ranges() function does *not*. > > It just expects that that the 'add_pin_ranges()' callback exists, and > if it doesn't, does nothing at all. > > Which then makes those > > if (list_empty(&gc->gpiodev->pin_ranges)) > return 0; > > tests very suspicious - because if some doesn't implement that > add_pin_ranges() callback, it looks like nothing at all ever gets > done, because nothing calls the function to actually add the pinrange. > And then that "list_empty()" test very much will trigger. > > IOW, it looks like either a gpio controller has to implement that > 'add_pin_ranges()' function (only tegra), or it needs to always add > the pin ranges at probe time. > > Am I guessing right that the driver that you use does neither? > There are more drivers than just tegra that implement add_pin_ranges() but you're right, pinctrl-at91.c used by Marcelo does not. > LinusW/Bartoz - this all really sounds strange to me. Maybe I'm It's BartoSz actually. :) > misreading the situation entirely. Should there be some sanity-test > that any gpio/pinctrl driver that uses gpiochip_generic_request() > would either have to have that add_pin_ranges() callback, or a > successful probe needs to always populate that 'gpiodev->pin_ranges' > list? > This sounds right to me but I need to spend some more time on this, I didn't author the code in question. > Or maybe I'm misreading the situation entirely. I don't know the code > - I'm just grepping for things and trying to make sense of how that > '->pin_ranges' list is supposed to work. > > But for now, I think that patch has to be reverted. > Sounds good, I'll send a revert and make another PR with fixes before v5.17. Bartosz > Linus