From patchwork Thu Sep 13 07:40:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lu X-Patchwork-Id: 1450771 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 462A3DF24C for ; Thu, 13 Sep 2012 07:41:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752665Ab2IMHlN (ORCPT ); Thu, 13 Sep 2012 03:41:13 -0400 Received: from mga14.intel.com ([143.182.124.37]:55472 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752146Ab2IMHlK (ORCPT ); Thu, 13 Sep 2012 03:41:10 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 13 Sep 2012 00:41:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,416,1344236400"; d="scan'208";a="192194065" Received: from mint-spring.sh.intel.com ([10.239.36.120]) by azsmga001.ch.intel.com with ESMTP; 13 Sep 2012 00:41:07 -0700 From: Aaron Lu To: Alan Stern , Jeff Garzik , James Bottomley Cc: Aaron Lu , Jack Wang , Shane Huang , Oliver Neukum , linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org, linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, Aaron Lu Subject: [PATCH 1/2] scsi: sd: set ready_to_power_off for scsi disk Date: Thu, 13 Sep 2012 15:40:48 +0800 Message-Id: <1347522049-1836-2-git-send-email-aaron.lu@intel.com> X-Mailer: git-send-email 1.7.12.21.g871e293 In-Reply-To: <1347522049-1836-1-git-send-email-aaron.lu@intel.com> References: <1347522049-1836-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 The ready_to_power_off flag is used to give indication to ATA layer if this device's power can be removed when runtime suspended. This flag is determined by individual SCSI driver like sr, sd. This flag is introduced to support zero power ODD. When ODD is runtime suspended, it may not be OK to remove its power. But for disk, it is always OK to be powered off, so set this flag. Signed-off-by: Aaron Lu --- drivers/scsi/sd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 4df73e5..de786cf 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2638,6 +2638,7 @@ static void sd_probe_async(void *data, async_cookie_t cookie) sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n", sdp->removable ? "removable " : ""); + sdp->ready_to_power_off = 1; scsi_autopm_put_device(sdp); put_device(&sdkp->dev); }