Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5439238imb; Thu, 7 Mar 2019 16:05:33 -0800 (PST) X-Google-Smtp-Source: APXvYqxlwBeV1ED1NQx0Cey0d9EJgVJLyj2W69W5QlQCBuKFNZwYAw2KTd0vIn5FdDtbCb2UcXv9 X-Received: by 2002:aa7:85cc:: with SMTP id z12mr15516246pfn.196.1552003533621; Thu, 07 Mar 2019 16:05:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552003533; cv=none; d=google.com; s=arc-20160816; b=TstVts3EkSb6sSrPFyIEc2qlqgHC1UeTX21FQoMHurC+lDr04JM0OIN1kpMdxmexp8 tg5q6s1OTT83x0voK0Fp1cu38eUHgIX0H2cUp345Tb9hqznZUByd6qtFCvm40an6ttLH FFiueW/jewwoeF+YfK4Wn2y8G0WueynZxUEyFTIqCPDsspOyxZQh7Oso/RmOVx7x1hay AbKeKzYaBSfNcLBLL8mi8n9C8bUBBSpmbQoWcGFwdrKHay71Tny7AN6Z6Txu+HywlwdW J3gwqJOLrc8LJuSbUk+7UGN1clqKn9aOjXO26pJMlXviyPUP2Ty9KyQg1sQqyyuuiaXL wv0g== 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:date:cc:to:from:subject:message-id; bh=6WDLvD44U+rmCQToIDebmeXkUwqzz9/Z9iCvBbHCkjg=; b=yw6haUmUvwzUFj3fHhkeDDPRliHI6koEPznMDss2r6V4yGlyk493IvUj1UyjPwOJAR M2VXSKEjuO1Gd+KbcMoVbS7Ntk0bV1qnsTof66UCkl5s/Way9Dbh8wBipjckLhrF0nS/ FMo9HVG1UIWNGOkXwzZndS/7HmqmRP5G6FV4ARJ8/xy3Aq5vpXy8IEHtZNfC7d0r8o2W yT8RdltbO7roPLS4voIptDrQkRx0s1KKKPk4ziPo2vg5S7AUvbJ1AUowgoIo5IKVsfF7 Aml7AuKaKH4hSFtqlORVsgFR6Bn0kPcTUaHV8NHhPvlrGE9ACfqaoeY2wzf/+Ne+GS+Z FZPA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v24si1858341pgl.334.2019.03.07.16.05.17; Thu, 07 Mar 2019 16:05:33 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726364AbfCHAEb (ORCPT + 99 others); Thu, 7 Mar 2019 19:04:31 -0500 Received: from mga09.intel.com ([134.134.136.24]:52050 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726234AbfCHAEa (ORCPT ); Thu, 7 Mar 2019 19:04:30 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2019 16:04:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,453,1544515200"; d="scan'208";a="153058463" Received: from spandruv-mobl3.jf.intel.com ([10.252.200.83]) by fmsmga001.fm.intel.com with ESMTP; 07 Mar 2019 16:04:29 -0800 Message-ID: <3914af3f82d8aad8c22d814a20af4be654f8ad43.camel@linux.intel.com> Subject: Re: [PATCH 0/2] ata: libahci: devslp fixes From: Srinivas Pandruvada To: Rajat Jain , Hans de Goede Cc: Gwendal Grignou , Tejun Heo , "Rafael J. Wysocki" , alan.cox@intel.com, IDE/ATA development list , Linux Kernel , Rajat Jain Date: Thu, 07 Mar 2019 16:04:28 -0800 In-Reply-To: References: <20180702190154.6864-1-srinivas.pandruvada@linux.intel.com> <9712316ab62bef25953c523bce02e260a9ea40fe.camel@linux.intel.com> <20180730152256.GF1206094@devbig004.ftw2.facebook.com> <20180730173345.GI1206094@devbig004.ftw2.facebook.com> <54d2b8e6-332b-117a-b982-77a535152246@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-1.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-03-07 at 15:07 -0800, Rajat Jain wrote: > Hello, > > On Thu, Mar 7, 2019 at 12:37 PM Hans de Goede > wrote: > > > > Hi, > > > > On 07-03-19 21:27, Gwendal Grignou wrote: > > > Srinivas, > > > > > > I am looking at problem on a laptop machine that suspends to > > > S01x, but > > > link_management is set to max_performance, because the machine is > > > connected to a charger. > > > > What is setting it to max_performance when charging? I assume > > chrome-os is > > running something in userspace to do this (like TLP, but I guess > > you are not > > using TLP) ? > > Yes, we have a udev script that does this. > > > > > Have you run benchmarks with max_performance vs the default? > > I seriously doubt there will be a significant difference, esp. > > with a chrome-os style workload. > > > > > Given DVLSP must be set before the laptop suspends ["""One of the > > > requirement for modern x86 system to enter lowest power > > > mode (SLP_S0) > > > is SATA IP block to be off."""], the machine never reaches S01x. > > > Does it make sense to change the target_lpm_policy at suspend > > > (ata_port_suspend()) to min_power and bring it back to the > > > original > > > value on resume? > > > > If userspace messes with the setting, then userspace should also > > put it back before suspending... > > > > The upstream kernel's default behavior is to have the target level > > set > > to a fixed level independent of the charging state. Could it be > > this > > fixed level is actually max-performance ? If that is the default > > the > > kernel comes up with, that would indicate a kernel bug. > > Side note: max-performance indeed can be the default forced by the > kernel for some (broken) SATA devices: > > if (dev->horkage & ATA_HORKAGE_NOLPM) { > ata_dev_warn(dev, "LPM support broken, forcing > max_power\n"); > dev->link->ap->target_lpm_policy = ATA_LPM_MAX_POWER; > } > > So definitely these systems won't be able to go into S0ix today. > > But I think the main idea that we are asking is: > > 1) Yes, we acknowledge that the userspace has set it max-performance. > > 2) However, given that the kernel already knows that: > - while in suspend, there is no real value in retaining the > max-performance. > - On the contrary, we know system will fail to go into lower > power mode because of max-suspend. > > 3) Does it not make sense to use this knowledge and switch to > min_power when we are actually going to suspend (even if user > specified max-performance), and restore max-performance on resume? It is all about regressions. Hence we added multiple conditions for setting default to min power. It may cause issues for some SATAs, which may not recover once enters slumber or DEVSLP. There is also case where user having issues with default LPM policy hence he changed policy to max performance. We can't detect that. So it will be much safer if user space change policy to default before calling suspend. Thanks, Srinivas > > Or may be there are issues that this causes, that we're not aware of? > Can you please provide us some pointers? > > Thanks, > > Rajat > > > > > Regards, > > > > Hans > > > > > > > > > > > > Gwendal. > > > > > > > > > On Mon, Jul 30, 2018 at 10:33 AM Tejun Heo wrote: > > > > > > > > On Mon, Jul 30, 2018 at 05:26:45PM +0200, Hans de Goede wrote: > > > > > Hi, > > > > > > > > > > On 30-07-18 17:22, Tejun Heo wrote: > > > > > > On Mon, Jul 30, 2018 at 08:15:47AM -0700, Srinivas > > > > > > Pandruvada wrote: > > > > > > > Hi Tejan, > > > > > > > > > > > > > > On Mon, 2018-07-02 at 12:01 -0700, Srinivas Pandruvada > > > > > > > wrote: > > > > > > > > Some minor fixes to be able to correctly set devslp > > > > > > > > register > > > > > > > > to optimize power. > > > > > > > > > > > > > > > > Srinivas Pandruvada (2): > > > > > > > > ata: libahci: Correct setting of DEVSLP register > > > > > > > > ata: libahci: Allow reconfigure of DEVSLP register > > > > > > > > > > > > > > > > > > > > > > Are you applying this series? > > > > > > > > > > > > I was waiting for Hans's reviews. Hans, what do you think? > > > > > > > > > > Ah I missed that this was another series. With the caveat > > > > > that > > > > > I do not really know that much about devslp, both patches > > > > > seem sensible to me, so both are: > > > > > > > > > > Reviewed-by: Hans de Goede > > > > > > > > Applied 1-2 to libata/for-4.19. > > > > > > > > Thanks. > > > > > > > > -- > > > > tejun > > > > -- > > > > To unsubscribe from this list: send the line "unsubscribe > > > > linux-ide" in > > > > the body of a message to majordomo@vger.kernel.org > > > > More majordomo info at > > > > http://vger.kernel.org/majordomo-info.html