Received: by 10.223.185.116 with SMTP id b49csp2887144wrg; Sun, 25 Feb 2018 08:36:20 -0800 (PST) X-Google-Smtp-Source: AH8x224g5D1F8wNcTImdJEvLJipzBYX0tlnJItmwLGxMVTSmwsP0rBxuDEfskncA49QrMFkRpUka X-Received: by 10.98.14.200 with SMTP id 69mr7830415pfo.168.1519576580520; Sun, 25 Feb 2018 08:36:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519576580; cv=none; d=google.com; s=arc-20160816; b=PTNwNQwL5FTPTuqu+eZDA9Rjda5n/gdZ3kQyOJCdRi0N2+LzEnw87lfijpYIP0KCkG RtzC1ZUmCzYrdPzwwXBA9gBM529Iax7uLKT3v6ixSrUKm8lnEBrE4AaH7EtYswwAok/C SyuIvWbrTU+mjSOEvmeQ96OeOzLP7QBkoI4j5L5qn/fafsp6LxMjIK6blXlNJEeDh5II ojg5Xezkt5PR9CHHTmE7bii869J41jEt+mrktyaZcM2962xct4Ul7pZTtXBORaIJtCOk KCZl+ZvJf/3umNdwsspVV1mLf4seOMLK2+t9gwJ8FW6+7lNZGKCiT4nfrC8UMLJXjIV9 0F2w== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=qsf84psqWwrPyaWG8qUauSfNAzzRs9buQPMT1JuoQHA=; b=lDu4NlCL3fRKAlVxUr+eNhwOgDl0Pi8nH/D5j3T3caSxdBqfCThBaF/c0Wgdw99NOz BigE7ic/Jr/A10EPN40XUdaL7Ny+R1ypGORfxlnvM6Sob/SCK8jF5z/vDQmmuP+9Cfsv /vyVOB1nqsGBEmPJ69iTpq69ut1oI4EaEfvVIrmBiZ4XpFpDPSJO1AGWvz5XB2qkDR1v Bb2vcue+jkmNb4xrJYWsj9tJbPVzehFyWePLAVVjOq6tCtJb6cixJ1lqYjsa8CvZ02dt Nax6zlOXKRDNSE4GcXPRTzOV1KWqCatpG/tnSSsWC6zr4pV8cXwD9N/l76EXMxOr1jc0 XGtQ== 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 z2si5280858pfe.350.2018.02.25.08.36.05; Sun, 25 Feb 2018 08:36:20 -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 S1751836AbeBYQf2 (ORCPT + 99 others); Sun, 25 Feb 2018 11:35:28 -0500 Received: from agrajag.zerfleddert.de ([88.198.237.222]:50646 "EHLO agrajag.zerfleddert.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751667AbeBYQfY (ORCPT ); Sun, 25 Feb 2018 11:35:24 -0500 X-Greylist: delayed 472 seconds by postgrey-1.27 at vger.kernel.org; Sun, 25 Feb 2018 11:35:24 EST Received: from denkmatte (unknown [IPv6:2001:a62:817:801:71b9:327b:c200:29a6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: knilch) by agrajag.zerfleddert.de (Postfix) with ESMTPSA id 82C995B2009A; Sun, 25 Feb 2018 17:27:31 +0100 (CET) Date: Sun, 25 Feb 2018 17:27:30 +0100 From: Tobias Jordan To: Nicholas Mc Guire Cc: , , Wolfram Sang Subject: Re: [SIL2review] [PATCH] i2c: img-scb: fix PM device usage count Message-ID: <20180225172730.2b443978@denkmatte> In-Reply-To: <20180225132014.GA8844@osadl.at> References: <20180224224303.3mpwhal2axcr6aos@agrajag.zerfleddert.de> <20180225132014.GA8844@osadl.at> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.99.3 at agrajag X-Virus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! On Sun, 25 Feb 2018 13:20:14 +0000 Nicholas Mc Guire wrote: > the decrement though is conditional: > pm_runtime_put_noidle > -> atomic_add_unless(&dev->power.usage_count, -1, 0); pm_runtime_put_noidle is playing it safe by not decrementing past 0, I think that's a good thing. > Also just wondering - could one not decrement in pm_runtime_get_sync > on the error path rather than defering this to the caller and fixing > it there ? That's what I've asked linux-pm in the linked discussion: > > https://marc.info/?l=linux-pm&m=151904483924999&w=2 As far as I've understood the idea is that most "error" return values actually are a result of disabled runtime PM, and that should be transparent to the caller. Looking at the code, that's what the vast majority of callers do - they just ignore the return value of pm_runtime_get_sync, and somewhere later have an unconditional pm_runtime_put_... call. So the only issue are callers that don't ignore the pm_runtime_get_sync return value, probably because they're having some kind of special requirements for error handling. For those, they need to ensure that a proper _put_ is done somewhere in the error path. > Reviewed-by: Nicholas Mc Guire Thanks for the review!, Tobias