Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp1009527oof; Tue, 25 Sep 2018 07:15:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV61dB0x9imf7xABP+WFD92NGx4myBCpyf6ldLZDhN7j0nn20YIx1Zug5Pv70JgnsM+YWUcya X-Received: by 2002:a63:4f4f:: with SMTP id p15-v6mr1293242pgl.71.1537884910203; Tue, 25 Sep 2018 07:15:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537884910; cv=none; d=google.com; s=arc-20160816; b=0B+RqHcX8M/ZK5eI2a9lvoXo5NHxNzwS20kNgXS0e+tLw84+dae9LIqSn0Klmtmp2/ uYM9+qb+HpJG9uSCRa/AlQO4PtzqpAiGlkxX/tCBsAtU+byc30M39DxasCPzbY83teMR FtLr6Ic/LVpyJvjXNuW6U/r3iyfHuoRdV0edEex7Wk85E+1WfviU5CLHoR/PsQRixbg3 uc79kfCawdGkCiVjEGOm9p+EnKd57kb/Km6aEzwOwGT28xVDM0Fa4ox8LUlwCiUpuw4w n8ifkMzWHwuWPLEdZWdyWlvDzsBWeVaEs8LJO+i9lqdenOYViGIJrIE8TcdmD08cBRA3 OIhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=uhZo8b4NZKBIo3cHRBBL44pojBeyGLNS2uQtD7kDG9U=; b=jpDklGd2002D6WR6GypMRcjV4OgjriwQSYoAmLjulEr7/9WTJ7sUGgYrQPyCe11NgY 9gxSB5gpGlDQYcmzq33ZLcThAHmOJWG+4GiE3HTYwVLdsidrzkmTB8AWdZHhc0E8P0b7 ganfSKWeZjHGTeB8G9AtM1YClEd1N8uCzOe5qg4LK2Yy2w2UwFpHVp9/AVAIgVbcqaCw e/27nLgKLgy4GVwO1evyPvutFWF+v5QjuBFPp4bqS8yQoVH1Bk6bkRJbFXhk2hIWDOWL GGJ+w/wBbMQLFxK3Y61aB21jKH2cDR5uk2imknhi3BQ3+agCqg6K2UwBM2dYLiRQk7MF P6jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=TSvUZXNc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k185-v6si2532439pgk.183.2018.09.25.07.14.55; Tue, 25 Sep 2018 07:15:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=TSvUZXNc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729347AbeIYUUA (ORCPT + 99 others); Tue, 25 Sep 2018 16:20:00 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:16461 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729098AbeIYUUA (ORCPT ); Tue, 25 Sep 2018 16:20:00 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 25 Sep 2018 07:12:23 -0700 Received: from HQMAIL101.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 25 Sep 2018 07:12:17 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 25 Sep 2018 07:12:17 -0700 Received: from [10.21.132.143] (172.20.13.39) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 25 Sep 2018 14:12:15 +0000 Subject: Re: [PATCH 4.14 156/173] gpiolib: Respect error code of ->get_direction() To: Greg Kroah-Hartman , CC: , Andy Shevchenko , Mika Westerberg , Linus Walleij , Sasha Levin , linux-tegra References: <20180924113114.334025954@linuxfoundation.org> <20180924113126.730832814@linuxfoundation.org> From: Jon Hunter Message-ID: Date: Tue, 25 Sep 2018 15:12:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180924113126.730832814@linuxfoundation.org> X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL106.nvidia.com (172.18.146.12) To HQMAIL101.nvidia.com (172.20.187.10) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1537884743; bh=uhZo8b4NZKBIo3cHRBBL44pojBeyGLNS2uQtD7kDG9U=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=TSvUZXNcw+7dawWmhfi5CBuA7wmI6Int39N+X161tyNf/EXFZzvdVJplbVTxzGvYs /p4PDC+Q4Y6YeCKt3kEefzjNzkxIw009jAbzrB02llgYhdyl+0B5umBz7FigT6v8Wr dqAUK21PUZbqQmRjD59VjmCT68/fimX0grjiIRvVv6lODDxeBNhBfo8mZ0kVY8PVST ouuydzeZP2+28eYx8ACddKO2TU3/WNzD8xsfTQL0QY4youjZQyDrumvZPmCHuS6sbf H9kdEGRGT6othgsf0EilUIsg6AEdCa2pnrCz+BYy2uu2EalIPN91NBANJugxVzatks Cw+Lx3IRYFLKg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, On 24/09/18 12:53, Greg Kroah-Hartman wrote: > 4.14-stable review patch. If anyone has any objections, please let me know. > > ------------------ > > From: Andy Shevchenko > > [ Upstream commit 36b312792b97933dc07abe074f50941199bd357c ] > > In case we try to lock GPIO pin as IRQ when something going wrong > we print a misleading message. > > Correct this by checking an error code from ->get_direction() in > gpiochip_lock_as_irq() and printing a corresponding message. > > Signed-off-by: Andy Shevchenko > Cc: Mika Westerberg > Signed-off-by: Linus Walleij > Signed-off-by: Sasha Levin > Signed-off-by: Greg Kroah-Hartman > --- > drivers/gpio/gpiolib.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > --- a/drivers/gpio/gpiolib.c > +++ b/drivers/gpio/gpiolib.c > @@ -2811,6 +2811,12 @@ int gpiochip_lock_as_irq(struct gpio_chi > if (!chip->can_sleep && chip->get_direction) { > int dir = chip->get_direction(chip, offset); > > + if (dir < 0) { > + chip_err(chip, "%s: cannot get GPIO direction\n", > + __func__); > + return dir; > + } > + > if (dir) > clear_bit(FLAG_IS_OUT, &desc->flags); > else This change is causing a boot regression on Tegra20 and Tegra30. After this change was merged in mainline there was a fix for Tegra [0] that was also needed. On Tegra the above change causes the allocation of GPIOs to fail and looks like this then exposes another bug somewhere else that finally leads to a system crash. If this is needed for stable, then we will need the fix for Tegra as well. Cheers Jon [0] https://lkml.org/lkml/2018/7/17/871 -- nvpublic