From patchwork Mon Sep 16 15:56:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanley Chu X-Patchwork-Id: 11147493 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A57AC1708 for ; Mon, 16 Sep 2019 15:57:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8362B214AF for ; Mon, 16 Sep 2019 15:57:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="O0CmS0aC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8362B214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=eLVYydYpdotL4uMKEzVRg45R4nrYGmpYy++28Y2iqww=; b=O0CmS0aCLhevWb WOA8HGdi8ahdjOMbzumwAqRHLt8I3VSjdNbK1VGKxHPqXUyqhhisGzH7lrYfj0DXj+XJ2PP1PPK0V cTQAt+6qPXXINer7gxCOy9MDKTU/nfCRfjlsuoMAH7Uwc8eHCL7E5on1GDW5P3IT+iZI4sT5HOEaQ txiuViV+NJdz6hY8AecIHfx3rnj6gbCPNJEXxhweyQvfptCxbf4pwYawnadgQQ/C83BLZ+COYcRgD JPanJ23arDVFIOQ0ATjCEAE+/Kua9VlJZ9o15Rtji3l1NBCJuxuxI1KsfasMYJO36/rVNP0cPHN8X E7eZ3kF977jTbEDDPU5Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1i9tNH-00046I-U0; Mon, 16 Sep 2019 15:57:11 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1i9tN1-0003sR-OH; Mon, 16 Sep 2019 15:56:56 +0000 X-UUID: cfd34608519f4de1b6a7b878aeb7653f-20190916 X-UUID: cfd34608519f4de1b6a7b878aeb7653f-20190916 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 435281571; Mon, 16 Sep 2019 07:56:54 -0800 Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 16 Sep 2019 08:56:53 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 16 Sep 2019 23:56:52 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 16 Sep 2019 23:56:51 +0800 From: Stanley Chu To: , , , , , , , Subject: [PATCH v4 0/3] scsi: core: allow auto suspend override by low-level driver Date: Mon, 16 Sep 2019 23:56:48 +0800 Message-ID: <1568649411-5127-1-git-send-email-stanley.chu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190916_085655_793666_621FEB3E X-CRM114-Status: UNSURE ( 7.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [216.200.240.184 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marc.w.gonzalez@free.fr, andy.teng@mediatek.com, chun-hung.wu@mediatek.com, kuohong.wang@mediatek.com, evgreen@chromium.org, subhashj@codeaurora.org, linux-mediatek@lists.infradead.org, peter.wang@mediatek.com, vivek.gautam@codeaurora.org, matthias.bgg@gmail.com, Stanley Chu , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, beanhuo@micron.com Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org Until now the scsi mid-layer forbids runtime suspend till userspace enables it. This is mainly to quarantine some disks with broken runtime power management or have high latencies executing suspend resume callbacks. If the userspace doesn't enable the runtime suspend the underlying hardware will be always on even when it is not doing any useful work and thus wasting power. Some low-level drivers for the controllers can efficiently use runtime power management to reduce power consumption and improve battery life. This patchset allows runtime suspend parameters override within the LLD itself instead of waiting for userspace to control the power management, and make UFS as the first user of this capability. v3 => v4: - Change scsi_device->rpm_autosuspend_on to scsi_device->rpm_autosuspend (Bart) - Make the comment of scsi_device->rpm_autosuspend more elaborate (Bart) v2 => v3: - Create a member indicating autosuspend delay for the same SCSI host in SCSI host template (Bart) - Use separate variables to control different things, (Bart) (a) Whether or not runtime suspend is enabled at device creation time (b) The power management autosuspend delay v1 => v2: - Allow "zero" sdev->rpm_autosuspend_delay (Avri) - Fix format of some lines (Avri) Stanley Chu (3): scsi: core: allow auto suspend override by low-level driver scsi: ufs: override auto suspend tunables for ufs scsi: ufs-mediatek: enable auto suspend capability drivers/scsi/scsi_sysfs.c | 3 ++- drivers/scsi/sd.c | 4 ++++ drivers/scsi/ufs/ufs-mediatek.c | 3 +++ drivers/scsi/ufs/ufshcd.c | 9 +++++++++ drivers/scsi/ufs/ufshcd.h | 10 ++++++++++ include/scsi/scsi_device.h | 3 ++- include/scsi/scsi_host.h | 3 +++ 7 files changed, 33 insertions(+), 2 deletions(-)