Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1322627ybg; Tue, 2 Jun 2020 07:05:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbbd4/JWXjSD+IEXFYxJIj6DGgBYf8CDYiIecctV33BcL5qxgzdP4rN3mzqMlZVF4DyIXq X-Received: by 2002:aa7:ce13:: with SMTP id d19mr18398936edv.355.1591106745432; Tue, 02 Jun 2020 07:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591106745; cv=none; d=google.com; s=arc-20160816; b=zhtgF5V8f12NNbUqMwj5fb/4FcgzQHFw979/PhmFyAqGV5auXP1Ak8s9HZ/0StnmU5 EymEY2BUJvgyrtA4WTBiSIWor468K8gG5vF8Qc98pTuzdPc1dyMKGFZI35wXSg9e65QC gNl89TZaX3bXd0Yiokcl8/3NuTSJv/YGkQwHhEabSLhhcawSCpfMlEn01Z8lqI1lYjeT GvPb2C3g/AgDfcU3ZkRiI96fdhyj+pRoHN4YH8LckfXT6nAFFr4SQ2Rh17oAlwNtTnkN OvsmKUD+zI5UX/DBZoFaLGRTdHh0TbEZXrD3JyUpzwQjKMcjhmn7YY5g/OaKJJkcHaSF 5wXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JQjaC1xCI2dfpZan+5KWwPWqlT4N6CVI5CYUzC/YfCk=; b=poZeYKfv5INZhROkHzvYmotJeE1docAcJfk719GP6G8V7uRBo+dGEy0CeRoeEPHO14 xQP+v3Bebt7MDcFLIPciBPV6AKyZB7XoszKmUmf2kwt2QcmWurBpggdcPpyQ6cIP/Lic YWrXfTdDXWCsmbY2D6OthQ7mDz234ZOMBC6ypf+81+owJD3YreOscwxncflggaLwWZEZ gTeg/XpQMllhWzrZQtqVdtPZJhS9i1W47ZCpnj643zHjHDQVPOsxc+YX6EhN9LoWFS9B Iy37nMeHLH3DIiseSWQu4JDvUqu+cOs37CE0gTtmB75OGB1nV2q+sNN0Fy1/cGIM6+Nu g+Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C4PFWgMM; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n24si1357803ejd.648.2020.06.02.07.05.18; Tue, 02 Jun 2020 07:05:45 -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=@gmail.com header.s=20161025 header.b=C4PFWgMM; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728299AbgFBOAh (ORCPT + 99 others); Tue, 2 Jun 2020 10:00:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbgFBOAe (ORCPT ); Tue, 2 Jun 2020 10:00:34 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE05EC08C5C0; Tue, 2 Jun 2020 07:00:33 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id e125so6253185lfd.1; Tue, 02 Jun 2020 07:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JQjaC1xCI2dfpZan+5KWwPWqlT4N6CVI5CYUzC/YfCk=; b=C4PFWgMMsPkeuD0aU2b1PhywPv60JLQj6vwv2tCKyeUIY1tZXTw5OMfEkd/LCH96I+ OGE8g+akc8c2SMW0b7t/4Xy6dcLfnuyQHMv8ewbaIFtgRPdBPCOUmH9npw4923JqnvTx 0U0P2+kEIdVecEJWWDhcEaBSCRdx5FmlmeRzbiy8il1T7SneHE7luSm/y7xeWAdOPNKr R0cJYZOAtv8N6dVpJjKaPa9ksqb1AYKzCrbaMe6KIa/QlHihqTR74M1PALGo6BItp2Jn 69FMfSMaYYZ4NMkRNbGPNedjrYQpzMtNZqRIWFX7cDiV/3NAfbR14DsVyFOxAWLZfqkI pLiA== 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; bh=JQjaC1xCI2dfpZan+5KWwPWqlT4N6CVI5CYUzC/YfCk=; b=rKUvHjn+o3mIUDFm9SX83H7G1ZQcIjOWCXtvR286tQlt+qf6w4ERJQcm3+mKvi3BMd f8+pGtmVWn+2cE13fQeOPULKZQUtBPGvqnzHJnjEmIaOo20jDxVfg2sdHtEnnLJIoqjH I/GyxNeNhzQ5m6daLXjE4S+rzKF1ScQEkFeHVXxvMaVzP+7aTVtGTVcCCvLaGheVAuvp sqhcopSZDnCm4kGLMNLWn1p7CDSCpmwy8IZ9bvp1K9NVP6lfpgJ4BoIaJdwKocvU3e+B MMdH7M/zBHJKlm//jKpPuxXklPTgJOMvorbHsx5fPGr4SfFX+nuasHHfbcL0LRcanK/D 866A== X-Gm-Message-State: AOAM531GXOSt/3ekwyru2kB7AQZP3Nwr/r4JlHATb/Wwuta3bFWRgeY3 OhC6vhNUIXD6AUN7bkd/xgPipPilqGyIP+I8uvBqcgAq X-Received: by 2002:ac2:5b9e:: with SMTP id o30mr14041813lfn.153.1591106431562; Tue, 02 Jun 2020 07:00:31 -0700 (PDT) MIME-Version: 1.0 References: <20200602051959.60440-1-navid.emamdoost@gmail.com> In-Reply-To: <20200602051959.60440-1-navid.emamdoost@gmail.com> From: Baolin Wang Date: Tue, 2 Jun 2020 21:59:45 +0800 Message-ID: Subject: Re: [PATCH] spi: sprd: call pm_runtime_put if pm_runtime_get_sync fails To: Navid Emamdoost Cc: Mark Brown , Orson Zhai , Chunyan Zhang , linux-spi@vger.kernel.org, LKML , emamd001@umn.edu, wu000273@umn.edu, kjlu@umn.edu, smccaman@umn.edu Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Jun 2, 2020 at 1:20 PM Navid Emamdoost wrote: > > Call to pm_runtime_get_sync increments counter even in case of > failure leading to incorrect ref count. > Call pm_runtime_put_noidle if pm_runtime_get_sync fails. > > Signed-off-by: Navid Emamdoost Looks good to me. Thanks Reviewed-by: Baolin Wang > --- > drivers/spi/spi-sprd.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/spi/spi-sprd.c b/drivers/spi/spi-sprd.c > index 6678f1cbc566..860032af4b98 100644 > --- a/drivers/spi/spi-sprd.c > +++ b/drivers/spi/spi-sprd.c > @@ -1018,6 +1018,7 @@ static int sprd_spi_remove(struct platform_device *pdev) > ret = pm_runtime_get_sync(ss->dev); > if (ret < 0) { > dev_err(ss->dev, "failed to resume SPI controller\n"); > + pm_runtime_put_noidle(&pdev->dev); > return ret; > } > > -- > 2.17.1 > -- Baolin Wang