Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2079367ybg; Fri, 5 Jun 2020 05:12:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz10uAH425HHsl/CHoECzoXKUt9Sr5MW5bRHb7BEiMISuuEz1ECVHI73EfAglhgTdNL74qN X-Received: by 2002:aa7:d48f:: with SMTP id b15mr9543883edr.8.1591359177122; Fri, 05 Jun 2020 05:12:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591359177; cv=none; d=google.com; s=arc-20160816; b=0xZRR92qnGh3jjDd3AX7Vy0ase34aTIfkcF39u5y5yVNuF65tB5BVnlX/8Xoo1tM4p Qbd3tBRMmLHvNKz9/W+KMC+3dNAJwVjpAtIUtkHs4LuhEemS3ojJBez40y8SVmvoR8fJ xVINQS7SHsoDQGjZEsakMQDBwEEmNzzGNEipWMfeFsl28lbJwoHQ0Ew8xB2qH2WQWyYy U45RcHM8ZVeBMrDgNwxer1wN6A26FVwqI9kh+6qQuG1pvyxfx5gO5ifYxfgJVKx4tYj5 4VhmoGhqY12NxyjayO95maJxLmzJ/u21UzAAFhgQXDp1SrRcNGOqJgQNRW4D4L85lCun YtJw== 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; bh=ki0XRRt/3xylS2T7+BudBy+Y2/q2g6zhA3yfCqfbxE0=; b=bXYy7ZjFzECwmatbsnGY0m5gFpoY37SusBO0bsfsF+OSMdDGy6a8WBPLJAsZFtLTXg WFBBQSTkJk2FanBBv6+GgW/ZaMsdHIG3KI4NvQv6cq8dqSSfk/aCDWorywoPx/WwdRwS txflcZOE3kb0yvSSBLE0vmWx438FmFlkjEt+GKp3bqWGCbh45Io0NDjDtMx5E2QdUs3s VI3K9Nnrxz7zgCjwu/cd4KWnBAkrBLiSVn9eIR4bxQXlPEIfAwR/fFtObJaTbDXPGCqu 4x+Oez3qp6vHO+645EJUr/2On8HeoGJKhCoM/v4x9fNoJqbkG3u6lHv+KdxoDjW+z3+I vHCw== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e20si3412293ejx.262.2020.06.05.05.12.32; Fri, 05 Jun 2020 05:12:57 -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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726429AbgFEMKm (ORCPT + 99 others); Fri, 5 Jun 2020 08:10:42 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:43725 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726054AbgFEMKm (ORCPT ); Fri, 5 Jun 2020 08:10:42 -0400 Received: by mail-ot1-f66.google.com with SMTP id u23so7389317otq.10; Fri, 05 Jun 2020 05:10:41 -0700 (PDT) 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=ki0XRRt/3xylS2T7+BudBy+Y2/q2g6zhA3yfCqfbxE0=; b=dk2Dm4C267jEc5CVqmcRgY5RJGl9lBjbH8fVkw+UC5HzpPfhH+zLkoN3QAv7wRgNH5 R5sJpxY7acyw0pTQNaRcE0WzJFJh9L3YYJLQveLSXU0MxqgsZIk0qV4bzBRtaoyzJP/z o8wnOVHfZBxJhj7G3hg4hBhefAN8tpVTUWPFZP9tSrh8LwpuTjA2Uov2j0xcuUgYRmyY z3bQ5Pl0SAwcJJHsB2hjrXdM9hlRxCqvTsb3SUzwZOo8OkDXzfh44dyPYONRtn/4fi25 mQ4xxVe68noj/T4zzL8xxMYH2VJNoWfdw55vwWq0eZRo7WnkUsBQyJTL9b79THCa/cWv x1AQ== X-Gm-Message-State: AOAM531R1OWfyNArvf0qkZAImgGIebTk7YPOZ2MFSTN9u7tvlINv5m4v lNN9B1nUyjcYb4LV77tqXX4on7X5wK0E/8f5bh4= X-Received: by 2002:a9d:5185:: with SMTP id y5mr6958142otg.118.1591359041284; Fri, 05 Jun 2020 05:10:41 -0700 (PDT) MIME-Version: 1.0 References: <94fe944c-c528-9459-fc75-7c94273dd2b1@gmail.com> In-Reply-To: <94fe944c-c528-9459-fc75-7c94273dd2b1@gmail.com> From: "Rafael J. Wysocki" Date: Fri, 5 Jun 2020 14:10:30 +0200 Message-ID: Subject: Re: [PATCH] PM: runtime: add RPM_IDLE_SUSPEND / RPM_IDLE_NO_SUSPEND constants To: Heiner Kallweit Cc: "Rafael J. Wysocki" , Pavel Machek , Len Brown , Greg Kroah-Hartman , Linux PM , Linux Kernel Mailing List 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 On Sat, May 30, 2020 at 6:33 PM Heiner Kallweit wrote: > > runtime_idle() callback implementations have to return a non-zero value > if they don't intend to suspend now. Several drivers use an errno like > -EBUSY for this purpose. This can be problematic because the return > value is propagated up the call chain, from rpm_idle() to > __pm_runtime_idle(), and from there to callers like > pm_runtime_put_sync(). A driver author checking the return value of > e.g. pm_runtime_put_sync() may as usual check for retval < 0 and > bail out. Which would be a bug anyway, because rpm_idle() may return -EAGAIN or -EINPROGRESS due to concurrency and -EBUSY should be treated similarly. > Therefore a positive value should be returned. While it is recommended to return a positive value then, returning -EBUSY or -EAGAIN should still work if the callers are careful enough (and they should be). Thanks!