From patchwork Tue Sep 4 14:24:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lu X-Patchwork-Id: 1402551 Return-Path: X-Original-To: patchwork-linux-acpi@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 B9F283FC71 for ; Tue, 4 Sep 2012 14:26:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932244Ab2IDO0G (ORCPT ); Tue, 4 Sep 2012 10:26:06 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:44458 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932277Ab2IDO0D (ORCPT ); Tue, 4 Sep 2012 10:26:03 -0400 Received: by mail-pb0-f46.google.com with SMTP id rr13so9559178pbb.19 for ; Tue, 04 Sep 2012 07:26:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=pmFgPic7m2h9KzecHp3cIXeFmVTc68vaZdARV8VACrM=; b=QxjrRF5vj1oTimROgzMN5W6G42UbuRZbYJFdsF01rHX5VGYtgQQDqJpe80/ljnSkA2 Xp8YiDRsdHe/pYwOPhFZv0fO+khKSTEfSMOlkcH/y152royP22wk3EAsXMu+zkElRVhs SXozgz+eRryK+OFeECLK8XMVvvGiflSdctquVRY9Dm/1nCzsMxl+2e6JTzIsbYRL4/6p UxVRg+JCaVqpsrkVyL6geRVbUZmloY09Klc7+jHhuVnU8RlndnEb5gq/S3WcBAIoPuee JjI4DxHAxTChtAF1R0r3N4j3ELUiogwR93yY2nX8Rvz8h6FCahZamKfj0xhcQ0oqgnjU vNRQ== Received: by 10.66.84.6 with SMTP id u6mr41488185pay.75.1346768763004; Tue, 04 Sep 2012 07:26:03 -0700 (PDT) Received: from localhost.localdomain.localdomain ([180.157.93.243]) by mx.google.com with ESMTPS id lb1sm12311440pbc.47.2012.09.04.07.25.56 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Sep 2012 07:26:02 -0700 (PDT) From: Aaron Lu To: Alan Stern , James Bottomley , Jeff Garzik Cc: linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org, linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, Aaron Lu , Aaron Lu Subject: [PATCH v6 7/7] libata: acpi: respect may_power_off flag Date: Tue, 4 Sep 2012 22:24:40 +0800 Message-Id: <1346768680-7287-8-git-send-email-aaron.lwe@gmail.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1346768680-7287-1-git-send-email-aaron.lwe@gmail.com> References: <1346768680-7287-1-git-send-email-aaron.lwe@gmail.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Aaron Lu 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. Signed-off-by: Aaron Lu Acked-by: Jeff Garzik --- 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 6c8f89c..774180d 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -869,7 +869,9 @@ void ata_acpi_set_state(struct ata_port *ap, pm_message_t state) if (state.event != PM_EVENT_ON) { 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); /* TBD: need to check if it's runtime pm request */