From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 667C8C433E1 for ; Mon, 8 Jun 2020 11:55:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 37B2D2072F for ; Mon, 8 Jun 2020 11:55:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="HVQV+piK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729715AbgFHLzV (ORCPT ); Mon, 8 Jun 2020 07:55:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729615AbgFHLzU (ORCPT ); Mon, 8 Jun 2020 07:55:20 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F27BC08C5C2; Mon, 8 Jun 2020 04:55:20 -0700 (PDT) Received: from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2D0552C9; Mon, 8 Jun 2020 13:55:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1591617316; bh=1lj9FjuIipvGhcLtMC0uXaiiiMBYwOb9zRyCfR/27uw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HVQV+piKImt3IAI21N+NZKvdaNsADGQJ+OggKy6Jw8hF7GqRPeVVf0qvY+xkmGyVk FKKKJOmGaL1i8VAo+4W9PwJAresMPWF+jlCS9aV6Yr6gYpmton4jniCarYAPsZ7RqG +WfvBKQBuBT5CYAt4oYcM3LgCLTobKLnkjW6TO38= Date: Mon, 8 Jun 2020 14:54:57 +0300 From: Laurent Pinchart To: Geert Uytterhoeven Cc: dinghao.liu@zju.edu.cn, Kangjie Lu , Kieran Bingham , Mauro Carvalho Chehab , Linux Media Mailing List , Linux-Renesas , Linux Kernel Mailing List Subject: Re: Re: [PATCH] media: vsp1: Fix runtime PM imbalance in vsp1_probe Message-ID: <20200608115457.GA5896@pendragon.ideasonboard.com> References: <20200523115426.19285-1-dinghao.liu@zju.edu.cn> <20200608015456.GJ22208@pendragon.ideasonboard.com> <20200608015753.GK22208@pendragon.ideasonboard.com> <7b79863f.f636d.17291e1ff94.Coremail.dinghao.liu@zju.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, On Mon, Jun 08, 2020 at 09:39:51AM +0200, Geert Uytterhoeven wrote: > Hi Dinghao, > > On Mon, Jun 8, 2020 at 5:03 AM wrote: > > > > I wonder how many bugs we have today, and how many bugs will keep > > > > appearing in the future, due to this historical design mistake :-( > > > > Good question. It's hard to say if this is a design mistake (some use > > of this API does not check its return value and expects it always to > > increment the usage counter). But it does make developers misuse it easier. > > On Renesas SoCs, I believe these can only fail if there's something > seriously wrong, which means the system could never have gotten this far > in the boot sequence anyway. That's why I tend not to check the result > of pm_runtime_get_sync() at all (on drivers for Renesas SoCs). There are lots of return paths from rpm_resume() that return an error, more than just rpm_callback(). Do you consider that none of them are valid errors that drivers need to handle ? -- Regards, Laurent Pinchart