Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp639398pxb; Tue, 5 Apr 2022 16:56:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFLP7hEJuLOTjBlyimXta+NBMGrQiKNJsvacXItsTxo3Vkk0A4NwFao+YnQp5u74gCrPmN X-Received: by 2002:a17:902:ba83:b0:154:727e:5fc5 with SMTP id k3-20020a170902ba8300b00154727e5fc5mr6114503pls.55.1649202982345; Tue, 05 Apr 2022 16:56:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649202982; cv=none; d=google.com; s=arc-20160816; b=trxkCvCV9pNWY0YRSwOx4/mbKgj5pySlLhViHfVQiKTtNtng44TIW25smp4eAxRU9P Pyf0QO03JhlBerSPUCT6iXEuQiiywPpDLovdXF2iOJaHKEi0sVhLkMkEsJ5G72u+VLzU A05J7kbGRevBq8/9PNg3TJ/+yMkoL68oQeVhtlTV19WOnSpQjs33DN2dVpP3tuduxYaC HB6zoKXyVIO0CMnFNHAuDQUBbk+e8gbmbRZC7VIjzWgiJP/ueMoUkMO5UxIXs7viT9Hn 43FT/BgXWU2r65xdteuCCg3UoiB2ebbHJXB+Gu9wwtaHuQydnMfJmdHszL7mtjbsR/Ap /uXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9J23LDEmqdBaPu2gDk8Gj/03FdaO6b3awXYZA8xe9nE=; b=jaKF4VuUZ6fLBRFjadvI/cxTuGrbD3vv3K8VOeTWd2gHlNOLjhfBlqUQ5PTDCFvBR+ 9AbfLmWtsddVmoS+mGDDnCyFYDfLzvMRh/r9a6ADiHncWJifTp5Ipn1h3FhPSK+mTuEq y4qads3ipk4RUZhYH/mh76BcINNgwl1jTQITJ2Hd8kwEY7eXsIPVCuwZhS0wBPqfxwB1 vSRBQgOVmtFHig7TohiZUcHtVeGnt8ElcSt3Xb2WJvEZWh+i8/M+zKPpPSyg2zTQxHuk +YNtD3lFw3448Qy8Woua//ThSryvzZ5pl+ZLspew7YDhSR9itTUjtLsbV0+/6ljRmE36 97gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C+nlcNYU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q12-20020a656a8c000000b003816043f0b4si15254099pgu.681.2022.04.05.16.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:56:22 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C+nlcNYU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A32CF1E5304; Tue, 5 Apr 2022 16:41:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347756AbiDEKpO (ORCPT + 99 others); Tue, 5 Apr 2022 06:45:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241412AbiDEIdc (ORCPT ); Tue, 5 Apr 2022 04:33:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40F49C4; Tue, 5 Apr 2022 01:31:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DE537B81BC5; Tue, 5 Apr 2022 08:31:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3855FC385A1; Tue, 5 Apr 2022 08:31:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649147492; bh=RLwCfRV3oMmc2bb2HfmnBVXedm6GHoVaSfPttRHLqYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C+nlcNYU7O08C+yYnyUC4CR+hBTYpgLxEDXej6ioQX7utIV7A0LvdKJv7AiMslSYs qnHM1EvXw6KIBDCnD1cFCv2dujrKtDcULUE7MOcSATUI8RMF05lqGBOpf1eevnbYdG D8+wsPx+ksosu9YiIQwOQakYcGtFmJtvwpwIGViU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bartosz Golaszewski , Michael Walle , Thorsten Leemhuis , Marcelo Roberto Jimenez , Linus Torvalds , Sasha Levin , Guenter Roeck Subject: [PATCH 5.16 0018/1017] Revert "gpio: Revert regression in sysfs-gpio (gpiolib.c)" Date: Tue, 5 Apr 2022 09:15:31 +0200 Message-Id: <20220405070354.714970989@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Bartosz Golaszewski [ Upstream commit 56e337f2cf1326323844927a04e9dbce9a244835 ] This reverts commit fc328a7d1fcce263db0b046917a66f3aa6e68719. This commit - while attempting to fix a regression - has caused a number of other problems. As the fallout from it is more significant than the initial problem itself, revert it for now before we find a correct solution. Link: https://lore.kernel.org/all/20220314192522.GA3031157@roeck-us.net/ Link: https://lore.kernel.org/stable/20220314155509.552218-1-michael@walle.cc/ Link: https://lore.kernel.org/all/20211217153555.9413-1-marcelo.jimenez@gmail.com/ Signed-off-by: Bartosz Golaszewski Reported-and-bisected-by: Guenter Roeck Reported-by: Michael Walle Cc: Thorsten Leemhuis Cc: Marcelo Roberto Jimenez Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- drivers/gpio/gpiolib.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 1c73e4cfe80e..dcb0dca651ac 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1665,6 +1665,11 @@ static inline void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gc) */ int gpiochip_generic_request(struct gpio_chip *gc, unsigned int offset) { +#ifdef CONFIG_PINCTRL + if (list_empty(&gc->gpiodev->pin_ranges)) + return 0; +#endif + return pinctrl_gpio_request(gc->gpiodev->base + offset); } EXPORT_SYMBOL_GPL(gpiochip_generic_request); @@ -1676,6 +1681,11 @@ EXPORT_SYMBOL_GPL(gpiochip_generic_request); */ void gpiochip_generic_free(struct gpio_chip *gc, unsigned int offset) { +#ifdef CONFIG_PINCTRL + if (list_empty(&gc->gpiodev->pin_ranges)) + return; +#endif + pinctrl_gpio_free(gc->gpiodev->base + offset); } EXPORT_SYMBOL_GPL(gpiochip_generic_free); -- 2.34.1