Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3533347imm; Thu, 17 May 2018 10:11:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrqRri8acVyA7+77+W9rZAIg/Eb81ZOCVQFZN3beGyh//mmiEO1gvGAnQ0OlDbJVl0+P4Ui X-Received: by 2002:a62:4589:: with SMTP id n9-v6mr5936325pfi.158.1526577095912; Thu, 17 May 2018 10:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526577095; cv=none; d=google.com; s=arc-20160816; b=GxH1ZDABkrsVoEKTUMFURX+eqS+tgax0dMRqYfLYYCEWDoQTJA45s4YZVla/HuTqL+ jHKVcK405t9WLyLe51F+L2rWiMdylvTcDO8vJlh6BhtGWz3rz2zHaFOqkPwC1U/BPaxj JGi+X+4bl+prte9dqS3tSyvseLsLS4wDuMLYWWHO/5sl9EZghS6uoi2rC3bUUoCsgo9v C2xzz9j4k5ut0fuAXuX8YGnP3JdfwuBFwx4LObywAbOsrJG5keJfj9Xc0xpFfA51tvo1 G44VEgiZtD5zfhNyvbIfD81hM5WNwvNEPGjFURGLOa+Co3XQXhECg64RABFO9oKRmJ5i ySSQ== 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=mgqNt6i56ZLSd8VpFLG2JOaoKXaUMus/bRRmwqy6sM0=; b=z5zGgJaesqfpAuvWRp28YYeXFXOp30qwQK5DBU2KODDsqO4c1Asx5p/VdCE2JonaOq +qYAH/cr6rPI1ioVR1FU8esjx72jiCnYb1+3OhInXM/jlK5dDtAoYCGi1oLKw0TvP+Ul 9+SS/FfYLQAjcUGNOKo6YsPAU2L8Bv1z/aMR3u5J61kkFgU/bxJupfAZnbVZl8gJTiat uOWeBfrmYNrQ/Cd0WhMd2fbYfvBuIYlX93DC5AwLLCrGhRIuoZQCRmFflPmRwUi+VOnY FD9QYh/oGaIJOU7TRUIPp/6rLRapl00Zr+WkrQelCcllRQ+cPNMMT1ncYmbLL6+JoGS3 qocg== 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 p2-v6si4315887pge.429.2018.05.17.10.11.20; Thu, 17 May 2018 10:11:35 -0700 (PDT) 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 S1752476AbeEQRKo (ORCPT + 99 others); Thu, 17 May 2018 13:10:44 -0400 Received: from muru.com ([72.249.23.125]:42682 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752454AbeEQRKm (ORCPT ); Thu, 17 May 2018 13:10:42 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id D9A0C801E; Thu, 17 May 2018 17:12:49 +0000 (UTC) Date: Thu, 17 May 2018 10:10:38 -0700 From: Tony Lindgren To: Johan Hovold Cc: Sebastian Reichel , "H. Nikolaus Schaller" , Andreas Kemnade , Mark Rutland , Arnd Bergmann , Pavel Machek , "linux-kernel@vger.kernel.org" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Greg Kroah-Hartman , Rob Herring , linux-serial@vger.kernel.org, linux-omap@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: OMAP serial runtime PM and autosuspend (was: Re: [PATCH 4/7] dt-bindings: gnss: add u-blox binding)) Message-ID: <20180517171038.GL98604@atomide.com> References: <20180507163439.GV2285@localhost> <20180507175032.GR98604@atomide.com> <20180508065852.GW2285@localhost> <20180508152228.GV98604@atomide.com> <20180508154756.GW98604@atomide.com> <20180508155405.GX98604@atomide.com> <20180508164904.GZ98604@atomide.com> <20180509131003.GC2285@localhost> <20180509135706.GB98604@atomide.com> <20180517100948.GI30172@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180517100948.GI30172@localhost> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Johan Hovold [180517 10:12]: > [ Sorry about the late reply. ] > > On Wed, May 09, 2018 at 06:57:06AM -0700, Tony Lindgren wrote: > > * Johan Hovold [180509 13:12]: > > > > It seems we really should not be using the negative autosuspend to > > > configure the RPM behaviour the way these drivers do. Perhaps a new > > > mechanism is needed. > > > > Hmm well simply defaulting to "on" instead of "auto" and setting the > > autosuspend_ms to 3000 by default might be doable. I think that way > > we can keep use_autosuspend() in probe. Let's hope there are no > > existing use cases that would break with that. > > No, defaulting to "on" (i.e. calling pm_runtime_forbid()) wouldn't work > either as that would also prevent the device from runtime suspending > just as the current negative autosuspend delay does. Well in that case we should just stick with -1 value for the autosuspend. And just do pm_runtime_put_sync_suspend() after probe and on close. > I fail to see how we can implement this using the current toolbox. What > you're after here is really a mechanism for selecting between two > different runtime PM schemes at runtime: > > 1. normal serial RPM, where the controller is active while the > port is open (this should be the safe default) Agreed. And that is the case already. > 2. aggressive serial RPM, where the controller is allowed to > suspend while the port is open even though this may result in > lost characters when waking up on incoming data In this case it seems that the only thing needed is to just configure the autosuspend delay for the parent port. The use of -1 has been around since the start of runtime PM AFAIK, so maybe we should just document it. I guess we could also introduce pm_runtime_block_autoidle_unless_configured() :) > For normal ttys, we need a user-space interface for selecting between > the two, and for serdev we may want a way to select the RPM scheme from > within the kernel. > > Note that with my serdev controller runtime PM patch, serdev core could > always opt for aggressive PM (as by default serdev core holds an RPM > reference for the controller while the port is open). So if your serdev controller was to set the parent autosuspend delay on open() and set it back on close() this should work? Regards, Tony