Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3426451ybt; Tue, 23 Jun 2020 01:54:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0PeB1aGaS0z2u1g40ESuVLTjU9+RvZ4XQtvN43HJsRjtD2iQCebI6l+klHgQ+sB2Wh8ir X-Received: by 2002:a05:6402:6c6:: with SMTP id n6mr20154437edy.277.1592902476563; Tue, 23 Jun 2020 01:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592902476; cv=none; d=google.com; s=arc-20160816; b=bRTgJiMisY42LDIiGNeMPnPJd91jzOu+4HjkjLkUXl5v4MEMoBC5JQ1HOJ4W1WhOxC JLQqpqf3Yj9S2vSZ+mVAgE8WuJuE68mprRAz6TS3ACO9HT9Ein3wjzdyNH5f4ixvqoVM pxUgPXEP/lfKR6eW6lBpEAe2T5lfUMPe5LrmqgncxcJdkB+GNIkJJF+Oqsl6opcVarGI FjWxv3yMKm0R5nmDj8y69/Do6Er9qno7ccZhtnCoHczubKUFcWkFToeK+FxYhpf1YJea DW0W+RfSRpyxBctgSrn8IM28jUJn6vkk3R29HlUho+aTaWowR3naXoTpB8zWQYXLydC0 degg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=y/cIlmiQGFW7vkgx22yAxQ6q0R1TKH8fVp3Z9jLtHCE=; b=oeWnTa3ftb1BTSMu4Fo8BGoWb1fztxI38R8Enr98V9hGlN6G+zMEHGWN7N/5kivuD7 sfuWVDV3KDWex3Ny4xpFA7buQe40eyyN0Q+STr5cxl3Wk5TtdVYAj6WShjIcEcxy4v7Q TNC2d9EAeIz6zUs2hiddSNIJzMmZNr3QModawCLtfSxjlLMFHxXGa+Nmu3HKDhQ31owG WVkqu0hplwWsUOLIpjcNcF/ThVrWHKE0S9sEu6UD87pqKaRjZIXgKrh7chHPt3lL0s4O SR1U/rF/+KfUeL5nw/R3xOgRoboBADVBQ63VOms5yJftXz5n7bE/pmtHJ2PU6xNaiWfM QvqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=WYg5PiNk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si6019574edq.493.2020.06.23.01.54.14; Tue, 23 Jun 2020 01:54:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=WYg5PiNk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731853AbgFWIuh (ORCPT + 99 others); Tue, 23 Jun 2020 04:50:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731691AbgFWIug (ORCPT ); Tue, 23 Jun 2020 04:50:36 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A199C061573 for ; Tue, 23 Jun 2020 01:50:36 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id e12so3902054qtr.9 for ; Tue, 23 Jun 2020 01:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=y/cIlmiQGFW7vkgx22yAxQ6q0R1TKH8fVp3Z9jLtHCE=; b=WYg5PiNkGFNFNcFvVRGdTJteyILQn2nptS9bCOYMnwE+WtWJ007MM1aFQO5500+ZCf k7XDFyKgKx4wc55k9QRa5D1IGH+MO2wZujCH0FfNqhPnIIn+Y524vvxGmjWsKiCdNPGl gFkZ7Qx0TWQ3lZa89N4Iu0YJ+yEb1t0xAvS94np3zk16yFcxagwGXpPpIphYB+tnQfi9 VSYvT4mpIxHaJaibpUkPlRDBtR6Plnlb4w5zHz6/Z/4dH2lPohIrTnnfUe1bL081QhED Ki8Od93dXAvzZQGRA4gGEL6oks9aSa7YJCZHc02GqNxgrBrC1kcJaGab9HgwUZbpc0wM ezUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=y/cIlmiQGFW7vkgx22yAxQ6q0R1TKH8fVp3Z9jLtHCE=; b=CeR2Nqw6BG9AGWW+lM5E2PMq8pLyHz81LP3g0h0MIQhjK34j/q+V7IQ2ffk2Goo4ln lMFdYwrBnJ8w10dTsnJ9P9qiO2lqXKaiAEQ5LAWvvzcQoPFhlHkBmGheV94paekXGSf1 ozJAxKpphZy7/IuYw5sQ0yDCg6hdThEURzCiTxG7x+d7KyhnyhEsdaEHF5eVnPl5CvD1 cdQJeTvLSkYa6Xl7D80IxZeirPxUNRJQ15+yMoFcPCw4JGu5Bk+e3xdlE3JlX1luBxEm eEhi1d+4IkO8W4sVj8qBKj/xCp2uo80ekelmbujPL7SAGELiHm+jIUtLC64ESO8K0NDd WmXg== X-Gm-Message-State: AOAM530/TMvuiU6C4/4G8eZHPL4R4SgxgP3F+AphWgHbqdbWs+jgNljm uKMZEaRJ/eC4T6ABRud+ZRpY5MRbDp9P8SYTMnSjaA== X-Received: by 2002:aed:2a75:: with SMTP id k50mr4736033qtf.27.1592902235814; Tue, 23 Jun 2020 01:50:35 -0700 (PDT) MIME-Version: 1.0 References: <20200605024919.56177-1-navid.emamdoost@gmail.com> In-Reply-To: <20200605024919.56177-1-navid.emamdoost@gmail.com> From: Bartosz Golaszewski Date: Tue, 23 Jun 2020 10:50:24 +0200 Message-ID: Subject: Re: [PATCH] gpio: rcar: handle pm_runtime_get_sync failure case To: Navid Emamdoost Cc: Linus Walleij , linux-gpio , LKML , Navid Emamdoost , Qiushi Wu , Kangjie Lu , smccaman@umn.edu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pt., 5 cze 2020 o 04:49 Navid Emamdoost napisa= =C5=82(a): > > Calling pm_runtime_get_sync increments the counter even in case of > failure, causing incorrect ref count. Call pm_runtime_put if > pm_runtime_get_sync fails. > > Signed-off-by: Navid Emamdoost > --- > drivers/gpio/gpio-rcar.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c > index 7284473c9fe3..eac1582c70da 100644 > --- a/drivers/gpio/gpio-rcar.c > +++ b/drivers/gpio/gpio-rcar.c > @@ -250,8 +250,10 @@ static int gpio_rcar_request(struct gpio_chip *chip,= unsigned offset) > int error; > > error =3D pm_runtime_get_sync(p->dev); > - if (error < 0) > + if (error < 0) { > + pm_runtime_put(p->dev); > return error; > + } > > error =3D pinctrl_gpio_request(chip->base + offset); > if (error) > -- > 2.17.1 > Hi Navid! This doesn't apply to current master. I think the previous version got applied. Could you please rebase? Bart