From patchwork Fri Mar 2 11:10:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 10254335 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CC25360211 for ; Fri, 2 Mar 2018 11:11:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0E98288EB for ; Fri, 2 Mar 2018 11:11:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B542628964; Fri, 2 Mar 2018 11:11:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 51932288EB for ; Fri, 2 Mar 2018 11:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aS5uqMsleesu33yGs2v2JYConRVJ9MMERpkTrtrjAjw=; b=I3R1BBX5Nc0IC87CpIL28W7yI gS3jmHkVTqLxIE1pSGU4Jaj8jtc2wwpIzpRVJg1hMQpg6Pcioo5KbPBamYD872b++8xkgu8ikjIDr ObZd99WSbrW0lLpG1HNeEYvYC4XDexRvRzYR+MBgOVhicDJyiNl1y45Ho14afOOw/s4qCa8gRi6aM k6kYJTIna1BYp/h5+aCcShl7iIIh5QReqCLJD7fM5tEIr2rmL6GDQBHgDzCgp22mBgmuK124GUkJC EmTm5mmnqiLPPt6y0UB2KAFjnOjkR1MbuA1upCW2NJ1cqbO3IVQjpqfmhzL58nFEnFjh1lIiSahuG EyavV6rJg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eriaY-0003Mc-8I; Fri, 02 Mar 2018 11:10:58 +0000 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eriaT-0003L5-Pv for linux-arm-kernel@lists.infradead.org; Fri, 02 Mar 2018 11:10:56 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 81167801F9; Fri, 2 Mar 2018 12:10:40 +0100 (CET) Date: Fri, 2 Mar 2018 12:10:40 +0100 From: Pavel Machek To: Linus Walleij Subject: Re: [alsa-devel] regression v4.16 on Nokia N900: sound does not work Message-ID: <20180302111040.GA6344@amd> References: <20180224214617.GA22619@amd> <71aa88ec-d4df-b49c-7d73-27197f468491@leemhuis.info> <20180226131318.GA14045@amd> <20180226231336.GA18565@amd> <20180302091025.GC30267@amd> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180302_031054_166145_E6D570FE X-CRM114-Status: GOOD ( 19.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA , ext Tony Lindgren , =?utf-8?B?TWlja3Vsw6HFoQ==?= Qwertz , Sebastian Reichel , Martijn Braam , Filip =?utf-8?Q?Matijevi=C4=87?= , Patrik Bachan , Ivajlo Dimitrov , Kevin Hilman , serge@hallyn.com, Mark Brown , Linux-OMAP , linux-arm-kernel , Peter Ujfalusi , Daniel Baluta , Aaro Koskinen , kernel list , "Andrew F . Davis" , Thorsten Leemhuis , clayton@craftyguy.net, Sakari Ailus , Pali =?iso-8859-1?Q?Roh=E1r?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi! > > If this is taking longer to fix, should c85823390215 be reverted in > > the meantime? It does not seem particulary important/urgent... > > No patience between the v4.16 release candidates eh ;) > > commit 6662ae6af82df10259a70c7569b4c12ea7f3ba93 > ("gpiolib: Keep returning EPROBE_DEFER when we should") > > and > > commit ce27fb2c56db6ccfe8099343bb4afdab15e77e7b > ("gpio: Handle deferred probing in of_find_gpio() properly") > > that are both in Torvalds' tree since yesterday should be fixing > this, I think? Did you try just using the upstream HEAD? Ok, so this code looks pretty crazy to me: I tried removing the "of_find_spi_gpio" part, and audio started working. What is going on with the ()s around == s? You made me look up C operator precedence. Hmm, and it is also wrong, right? It turns any error code into ENOENT, as it tries to do the "special handling". * * This means we don't need to look any further for * alternate name conventions, and we should really * preserve the return code for our user to be able to * retry probing later. */ if (IS_ERR(desc) && PTR_ERR(desc) == -EPROBE_DEFER) return desc; if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT)) break; } /* Special handling for SPI GPIOs if used */ if (IS_ERR(desc)) desc = of_find_spi_gpio(dev, con_id, &of_flags); /* Special handling for regulator GPIOs if used */ if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER) desc = of_find_regulator_gpio(dev, con_id, &of_flags); Something like this? diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 84e5a9d..f0fab26 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -241,29 +241,17 @@ struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id, desc = of_get_named_gpiod_flags(dev->of_node, prop_name, idx, &of_flags); - /* - * -EPROBE_DEFER in our case means that we found a - * valid GPIO property, but no controller has been - * registered so far. - * - * This means we don't need to look any further for - * alternate name conventions, and we should really - * preserve the return code for our user to be able to - * retry probing later. - */ - if (IS_ERR(desc) && PTR_ERR(desc) == -EPROBE_DEFER) - return desc; - if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT)) + if (!IS_ERR(desc) || PTR_ERR(desc) != -ENOENT) break; } /* Special handling for SPI GPIOs if used */ - if (IS_ERR(desc)) + if (IS_ERR(desc) && PTR_ERR(desc) == -ENOENT) desc = of_find_spi_gpio(dev, con_id, &of_flags); /* Special handling for regulator GPIOs if used */ - if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER) + if (IS_ERR(desc) && PTR_ERR(desc) == -ENOENT) desc = of_find_regulator_gpio(dev, con_id, &of_flags); if (IS_ERR(desc))