From: James Bottomley <James.Bottomley@suse.de>
To: su henry <henry.su.ati@gmail.com>
Cc: axboe@kernel.dk, linux-scsi@vger.kernel.org, htejun <htejun@gmail.com>
Subject: Re: [PATCH RFC] support sata odd zero power
Date: Fri, 25 Jun 2010 10:01:18 -0400 [thread overview]
Message-ID: <1277474478.5234.98.camel@mulgrave.site> (raw)
In-Reply-To: <AANLkTimajvNh3frP9LcytXUhFAGk1gB52wa0LlGe0ZS0@mail.gmail.com>
On Fri, 2010-06-25 at 18:15 +0800, su henry wrote:
> From b221e73b802ccfe5338b575dc0ff3b687acdd6fa Mon Sep 17 00:00:00 2001
> From: henry su <henry.su.ati@gmail.com>
> Date: Fri, 25 Jun 2010 00:08:42 +0800
> Subject: [PATCH RFC] support sata odd zero power
>
> In order to extend the battery life of Mobile PC system, the host should remove
> the power supply to the Optical Disc Drive (logical unit) when it detects the
> logical unit with no media and tray closed, and the host starts the power
> supply to the logical unit when it detects user action to the logical unit that
> the power supply is omitted.
> The patch evaluates the _PS3 method to remove the power supply to the ODD if
> the host detects MEDIUM NOT PRESENT - TRAY CLOSED is reported by REQUEST SENSE
> command for a Drawer, Tray or Pop-up type drive, or MEDIUM NOT PRESENT -
> TRAY CLOSED for a slot/caddy type drive; on the other hand, the patch evaluates
> the _PS0 method to restart the power supply to the ODD when the user
> presses the
> button on a tray type drive or inserts a CD to a slot/caddy type drive.
>
> PLDS DS-8A5S, pansonic UJ892 and UJ897 are the ODD samples used to test
> the patch on AMD SB800 platforms.
>
> Signed-off-by: Henry Su <henry.su.ati@gmail.com>
The first observation I'd have is a big meta one: This all needs to
work on non ACPI systems ... given that it relies on unstubbed ACPI
functions, I don't think it does, does it?
What I'd suggest is confining it all to sr_acpi.c and hooking it in to
the test unit ready and init/exit ... that way the code only need be
present if ACPI is.
[...]
> @@ -786,6 +853,7 @@ static void get_capabilities(struct scsi_cd *cd)
> }
>
> n = data.header_length + data.block_descriptor_length;
> + sr_zpodd_device.mechtype = buffer[n + 6] >> 5;
> cd->cdi.speed = ((buffer[n + 8] << 8) + buffer[n + 9]) / 176;
> cd->readcd_known = 1;
> cd->readcd_cdda = buffer[n + 5] & 0x01;
This piece of data should probably be added to struct scsi_cd .. we
already use it in the routine anyway for printing out the tray type.
James
next prev parent reply other threads:[~2010-06-25 14:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-25 10:15 [PATCH RFC] support sata odd zero power su henry
2010-06-25 13:39 ` Tejun Heo
2010-06-28 8:43 ` su henry
2010-06-28 9:04 ` Tejun Heo
2010-06-28 10:42 ` su henry
2010-06-28 12:45 ` Tejun Heo
2010-06-25 14:01 ` James Bottomley [this message]
2010-06-28 7:35 ` su henry
2010-06-28 13:42 ` James Bottomley
2010-06-29 1:26 ` su henry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1277474478.5234.98.camel@mulgrave.site \
--to=james.bottomley@suse.de \
--cc=axboe@kernel.dk \
--cc=henry.su.ati@gmail.com \
--cc=htejun@gmail.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox