From patchwork Thu Aug 30 06:40:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lu X-Patchwork-Id: 1386641 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id B646C3FC33 for ; Thu, 30 Aug 2012 06:42:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752334Ab2H3GmG (ORCPT ); Thu, 30 Aug 2012 02:42:06 -0400 Received: from mga14.intel.com ([143.182.124.37]:59606 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752278Ab2H3GmD (ORCPT ); Thu, 30 Aug 2012 02:42:03 -0400 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 29 Aug 2012 23:42:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,337,1344236400"; d="scan'208";a="139586814" Received: from aaronlu.sh.intel.com ([10.239.36.123]) by AZSMGA002.ch.intel.com with ESMTP; 29 Aug 2012 23:41:59 -0700 From: Aaron Lu To: Jeff Garzik , "James E.J. Bottomley" Cc: linux-ide@vger.kernel.org, linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, Aaron Lu , Aaron Lu Subject: [PATCH 4/4] libata: acpi: respect may_power_off flag Date: Thu, 30 Aug 2012 14:40:18 +0800 Message-Id: <1346308818-27039-5-git-send-email-aaron.lu@intel.com> X-Mailer: git-send-email 1.7.11.5 In-Reply-To: <1346308818-27039-1-git-send-email-aaron.lu@intel.com> References: <1346308818-27039-1-git-send-email-aaron.lu@intel.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org If user does not want the device being powered off when runtime suspended by setting may_power_off flag to 0, we will not choose D3 cold ACPI D-State for it in sata_acpi_set_state. Signed-off-by: Aaron Lu --- drivers/ata/libata-acpi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 67a696f..90c42a0 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -848,7 +848,9 @@ static void sata_acpi_set_state(struct ata_port *ap, pm_message_t state) if (state.event == PM_EVENT_AUTO_SUSPEND) { acpi_state = acpi_pm_device_sleep_state( - &dev->sdev->sdev_gendev, NULL, ACPI_STATE_D3); + &dev->sdev->sdev_gendev, NULL, + dev->sdev->may_power_off ? + ACPI_STATE_D3_COLD : ACPI_STATE_D3_HOT); if (acpi_state > 0) acpi_bus_set_power(handle, acpi_state); acpi_pm_device_run_wake(&dev->sdev->sdev_gendev, true);