From patchwork Tue Sep 18 07:00:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lu X-Patchwork-Id: 1470981 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 14E54400EC for ; Tue, 18 Sep 2012 07:01:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757099Ab2IRHBN (ORCPT ); Tue, 18 Sep 2012 03:01:13 -0400 Received: from mga14.intel.com ([143.182.124.37]:32964 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757060Ab2IRHBD (ORCPT ); Tue, 18 Sep 2012 03:01:03 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 18 Sep 2012 00:01:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,441,1344236400"; d="scan'208";a="193966083" Received: from mint-spring.sh.intel.com ([10.239.36.120]) by azsmga001.ch.intel.com with ESMTP; 18 Sep 2012 00:01:00 -0700 From: Aaron Lu To: Alan Stern , Jeff Garzik , James Bottomley , Oliver Neukum Cc: Aaron Lu , Jack Wang , Shane Huang , linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org, linux-pm@vger.kernel.org, Aaron Lu Subject: [PATCH v2 3/4] scsi: sd: set ready_to_power_off for scsi disk Date: Tue, 18 Sep 2012 15:00:30 +0800 Message-Id: <1347951631-1592-4-git-send-email-aaron.lu@intel.com> X-Mailer: git-send-email 1.7.12.21.g871e293 In-Reply-To: <1347951631-1592-1-git-send-email-aaron.lu@intel.com> References: <1347951631-1592-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 after runtime suspended from the perspective of scsi driver. It is introduced to support zero power ODD. When ODD is runtime suspended, it may not be OK to remove its power. But for disk, there doesn't exist a scenario that when the disk is runtime suspended, it can't be powered off. 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 7b0f07a..009d30c 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); }