Received: by 10.223.185.116 with SMTP id b49csp3530334wrg; Mon, 26 Feb 2018 01:21:51 -0800 (PST) X-Google-Smtp-Source: AH8x227AmprkOYG22g0jxaTQOgKkx8D7wPxYPzZKjXjcq/ouEvo6kNlRQozI2fYM/3uEILrO15gs X-Received: by 10.98.98.194 with SMTP id w185mr10009046pfb.9.1519636911325; Mon, 26 Feb 2018 01:21:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519636911; cv=none; d=google.com; s=arc-20160816; b=C5BiIwMlb49ble1/XO9Uu404sd9W4kVyhgEp8L7jVupKRTXOHSbVVMelxZ5oOD83xJ nLqESYPy/a8MX2ptdNG85nqfTVQGKJ/MdUoENf8z5Vi1wPA+DjRXxlHtZZokR7C2N1j6 Yc9MN9bRLj1N4onCav4DUGdW37ZMtd0Miao9poJXVq4PHJASXU+I/ZLhouFIlTeGyutD 6+mpUqFEs3H1PcWDCRk66jKd4dYMeL+RawOwNltUs547wAlycwJSBJHBz5J1mGsbHcG2 t5bPlaFUDdqC6L+yXwArTahdaUnMT3v08EQ5qFp7B1iBf90hpWi3xNJ/yt/UlH6FavJw +JnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=zV5/opJGe/rRDSlAAkc2S7bQQLTzbvXTvhtRTYDZF/Q=; b=BKrMAmL8a1dfs3ts8rahg96fkXv8jeW49OdTe9fISAtsVGyColzEHmiTuM9zBcFOU9 PHUxahNY1pDKSF0I1k27UwqOuYWH6ZEp0AHR+u2QIVdqJuLAaak6m60lz50hXWvM0ZhD C1cpNGzuSy7rwIC04c/YTPu9rJazza3t8f33SnFTXOWcVvKLtURYyQPt9HrRC+G9AqNi ISeQ1r20UsOZYvWXJH+8YKK55HaOe6y2u+PFJNsZuhQbsrcCONjGeMMOkdRRDS4fTb8E Crj+HncFQjvos3F8WncmkrwJBfu2LO+H/5KvkNKwodA72xZECpjUD+T614w7qRQFevAL j/Kw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7si6513892pfg.30.2018.02.26.01.21.37; Mon, 26 Feb 2018 01:21:51 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752055AbeBZJUr (ORCPT + 99 others); Mon, 26 Feb 2018 04:20:47 -0500 Received: from 178.115.242.59.static.drei.at ([178.115.242.59]:39408 "EHLO mail.osadl.at" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751310AbeBZJUo (ORCPT ); Mon, 26 Feb 2018 04:20:44 -0500 Received: by mail.osadl.at (Postfix, from userid 1001) id 05F6E5C0BE8; Mon, 26 Feb 2018 09:20:07 +0000 (UTC) Date: Mon, 26 Feb 2018 09:20:07 +0000 From: Nicholas Mc Guire To: Tobias Jordan Cc: linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Simek , Wolfram Sang Subject: Re: [SIL2review] [PATCH] i2c: cadence: Fix PM device usage count Message-ID: <20180226092007.GC6152@osadl.at> References: <20180224224238.nlr3mrifwngjzkrz@agrajag.zerfleddert.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180224224238.nlr3mrifwngjzkrz@agrajag.zerfleddert.de> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 24, 2018 at 11:42:38PM +0100, Tobias Jordan wrote: > pm_runtime_get_sync() increases the device's usage count even when > reporting an error, so add a call to pm_runtime_put_noidle() in the > error branch. > > Fixes: 7fa32329ca03 ("i2c: cadence: Move to sensible power management") > Signed-off-by: Tobias Jordan > --- > This is one of a number of patches for problems found using coccinelle > scripting in the SIL2LinuxMP project. The patch has been compile-tested; > it's based on linux-next-20180223. > > For a discussion of the corresponding issue, see > https://marc.info/?l=linux-pm&m=151904483924999&w=2 just wondering if that should not be above the --- as: Link: https://marc.info/?l=linux-pm&m=151904483924999&w=2 notably as the discussion about why not to fix it in __pm_runtime_resume would seem reasonable to carry into the mainline logs. thx! hforat > > drivers/i2c/busses/i2c-cadence.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c > index b13605718291..898faa7fbac5 100644 > --- a/drivers/i2c/busses/i2c-cadence.c > +++ b/drivers/i2c/busses/i2c-cadence.c > @@ -574,8 +574,10 @@ static int cdns_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, > bool hold_quirk; > > ret = pm_runtime_get_sync(id->dev); > - if (ret < 0) > + if (ret < 0) { > + pm_runtime_put_noidle(id->dev); > return ret; > + } > /* Check if the bus is free */ > if (cdns_i2c_readreg(CDNS_I2C_SR_OFFSET) & CDNS_I2C_SR_BA) { > ret = -EAGAIN; > -- > 2.11.0 > > _______________________________________________ > SIL2review mailing list > SIL2review@lists.osadl.org > https://lists.osadl.org/mailman/listinfo/sil2review