[PATCH v8 00/11] ZPODD Patches

2012-10-29 Thread Aaron Lu
v8: This version is a redesign, it doesn't have much to do with previous versions. The ZPODD implementation is done almost entirely in ATA layer now, except 2 helper functions from SCSI sr driver to block disk events. The basic idea is that, when ata port is runtime suspended, it will check if

[PATCH v8 01/11] scsi: sr: support runtime pm

2012-10-29 Thread Aaron Lu
This patch adds runtime pm support for sr. It did this by increasing the runtime usage_count of the device when: - its block device is opened; - the events checking is to run. And decreasing the runtime usage_count of the device when: - its block device is closed; - After the events checking is

[PATCH v8 02/11] ata: zpodd: Add CONFIG_SATA_ZPODD

2012-10-29 Thread Aaron Lu
Added a new config CONFIG_SATA_ZPODD, which is ued to support SATA based zero power ODD. It depends on ACPI, and selects BLK_DEV_SR as the implementation of ZPODD depends on SCSI sr driver. 2 new files are added, which will be used to host ZPODD related code. They are empty for this commit.

[PATCH v8 03/11] ata: zpodd: identify and init ZPODD devices

2012-10-29 Thread Aaron Lu
If the ODD supports device attention and the platform can runtime power off it through ACPI, it means this ODD together with this platform is ZPODD capable. For this case, zpodd_init is called and a new structure is allocated for the device to store ZPODD related stuffs. And the zpodd_dev_enabled

[PATCH v8 04/11] libata: acpi: move acpi notification code to sata_zpodd

2012-10-29 Thread Aaron Lu
Since the ata acpi notification code introduced in commit 3bd46600a7a7e938c54df8cdbac9910668c7dfb0 is solely for zero power ODD, and we now have a dedicated place for ZPODD, move these code there. And the add/remove_pm_notifier code is simplified a little bit that it does not check things like if

[PATCH v8 05/11] libata-eh: allow defer in ata_exec_internal

2012-10-29 Thread Aaron Lu
ata_exec_internal will preempt the ata link's active_tag and ata port's qc_active flags, this is OK for error recovery, but if normal code path wants to use ata_exec_internal, there is a problem: we need to check if it is OK to issue a new command with the help of port_ops-defer. In ZPODD, I'll

[PATCH v8 07/11] libata: separate ATAPI code

2012-10-29 Thread Aaron Lu
The atapi_eh_tur and atapi_eh_request_sense can be reused by ZPODD code, so separate them out to a file named libata-atapi.c. A header file libata-atapi.h is added and the Makefile is modified accordingly. Signed-off-by: Aaron Lu aaron...@intel.com --- drivers/ata/Makefile | 2 +-

[PATCH v8 09/11] block: add a new interface to block events

2012-10-29 Thread Aaron Lu
A new interface to block disk events is added, this interface is meant to eliminate a race between PM runtime callback and disk events checking. Suppose the following device tree: device_sata_port (the parent) device_ODD (the child) When ODD is runtime suspended, sata port will have a

[PATCH v8 06/11] ata: zpodd: check loading mechanism for ODD

2012-10-29 Thread Aaron Lu
Per the Mount Fuji spec on SATA ZPODD, only slot type or drawer type ODD can support ZPODD. So add a function to check this, and if fails, skip setting of dev-private_data so that zpodd_dev_enabled will return false. Signed-off-by: Aaron Lu aaron...@intel.com --- drivers/ata/sata_zpodd.c | 87

[PATCH v8 08/11] ata: zpodd: check zero power ready status

2012-10-29 Thread Aaron Lu
Per the Mount Fuji spec, the ODD is considered zero power ready when: - For slot type ODD, no media inside; - For tray type ODD, no media inside and tray closed. The information can be retrieved by either the returned information of command GET_EVENT_STATUS_NOTIFICATION(the command is used to

[PATCH v8 11/11] ata: zpodd: handle power transition of ODD

2012-10-29 Thread Aaron Lu
The implementation of ZPODD aligns with runtime pm, which means the ODD will only be runtime powered off after it is runtime suspended. And each time in ata port's suspend callback, a check is made to see if the ODD is ready to be powered off: 1 zp_ready is true; 2 events is successfully blocked.

[PATCH v8 10/11] scsi: sr: support (un)block events

2012-10-29 Thread Aaron Lu
2 interfaces are added to block/unblock events for the disk sr manages. This is used by SATA ZPODD, when ODD is runtime powered off, the events poll is no longer needed so better be blocked. And once powered on, events poll will be unblocked. These 2 interfaces are needed here because SATA layer

Re: [PATCH] aic7xxx_old: silence GCC warnings

2012-10-29 Thread Paul Bolle
On Fri, 2012-09-21 at 11:28 +0200, Paul Bolle wrote: Building the aic7xxx_old driver triggers these GCC warnings: drivers/scsi/aic7xxx_old.c:7901:5: warning: case value '257' not in enumerated type 'ahc_chip' [-Wswitch] drivers/scsi/aic7xxx_old.c:7898:5: warning: case value '513' not

Re: [PATCH] aic94xx: fix handling of default CTRL-A settings

2012-10-29 Thread Paul Bolle
On Tue, 2012-09-25 at 14:07 +0200, Paul Bolle wrote: Compiling aic94xx_sds.o (part of the aic94xx driver) triggers this GCC warning: drivers/scsi/aic94xx/aic94xx_sds.c: In function 'asd_read_flash': drivers/scsi/aic94xx/aic94xx_sds.c:597:21: warning: 'offs' may be used uninitialized

Re: megaraid_sas: which patches are needed for 2.6.32.y?

2012-10-29 Thread Jonathan Nieder
Hi, In June, adam radford wrote: On Thu, Jun 28, 2012 at 1:27 PM, Jonathan Nieder jrnie...@gmail.com wrote: If someone makes a backport of the patches marked [3] as well, would you be able to look over or test the combination? That would be much appreciated. If that's not possible, your

Re: [PATCH] aic7xxx_old: silence GCC warnings

2012-10-29 Thread James Bottomley
On Mon, 2012-10-29 at 11:36 +0100, Paul Bolle wrote: On Fri, 2012-09-21 at 11:28 +0200, Paul Bolle wrote: Building the aic7xxx_old driver triggers these GCC warnings: drivers/scsi/aic7xxx_old.c:7901:5: warning: case value '257' not in enumerated type 'ahc_chip' [-Wswitch]

Re: [PATCH] aic7xxx_old: silence GCC warnings

2012-10-29 Thread Paul Bolle
On Mon, 2012-10-29 at 12:17 +, James Bottomley wrote: the aic7xxx_old driver is in deep maintenance; I don't think anyone can actually test changes to it anymore, so we just keep it around unchanged for the odd really old card that can't be driven by the current driver. For this reason, we

Re: [PATCH 6/7] Fix race between starved list processing and device removal

2012-10-29 Thread Bart Van Assche
On 10/28/12 19:01, Zhuang, Jin Can wrote: I recently ran into the same issue The test I did is plug/unplug u-disk in an interval of 1 second. And I found when sdev1 is being removed, scsi_run_queue is triggered by sdev2, which then accesses all the starving scsi device including sdev1. I

Re: [PATCH 1/7] block: Avoid that blk_drain_queue() finishes early

2012-10-29 Thread Bart Van Assche
On 10/29/12 02:52, Tejun Heo wrote: On Sun, Oct 28, 2012 at 06:47:22PM -0700, Tejun Heo wrote: On Fri, Oct 26, 2012 at 02:01:23PM +0200, Bart Van Assche wrote: Code like drain |= q-nr_rqs[i] might result in blk_drain_queue() to finish early if the expression at the RHS is a multiple of 256

Re: [PATCH v8 05/11] libata-eh: allow defer in ata_exec_internal

2012-10-29 Thread Tejun Heo
On Mon, Oct 29, 2012 at 05:01:32PM +0800, Aaron Lu wrote: ata_exec_internal will preempt the ata link's active_tag and ata port's qc_active flags, this is OK for error recovery, but if normal code path wants to use ata_exec_internal, there is a problem: we need to check if it is OK to issue a

Re: [PATCH v8 09/11] block: add a new interface to block events

2012-10-29 Thread Tejun Heo
Hello, On Mon, Oct 29, 2012 at 05:01:36PM +0800, Aaron Lu wrote: ODD_suspenddisk_events_workfn ata_port_suspend check_events disk_block_events resume ODD cancel_delayed_work_sync resume parent (waiting for

Re: WARNING: at fs/sysfs/inode.c:324 sysfs_hash_and_remove+0xa9/0xb0()

2012-10-29 Thread richard -rw- weinberger
On Sat, Oct 20, 2012 at 7:00 PM, Richard Weinberger rich...@nod.at wrote: Hi! I can reliably trigger the following warning by physically detaching my disk array after stopping md1. ---cut--- [ 149.780554] md: md1 stopped. [ 149.780559] md: unbindsdh1 [ 149.782025] md:

Re: WARNING: at fs/sysfs/inode.c:324 sysfs_hash_and_remove+0xa9/0xb0()

2012-10-29 Thread Greg KH
On Mon, Oct 29, 2012 at 06:08:22PM +0100, richard -rw- weinberger wrote: On Sat, Oct 20, 2012 at 7:00 PM, Richard Weinberger rich...@nod.at wrote: Hi! I can reliably trigger the following warning by physically detaching my disk array after stopping md1. Does this show up in 3.7-rc3?

Re: [PATCH v8 02/11] ata: zpodd: Add CONFIG_SATA_ZPODD

2012-10-29 Thread James Bottomley
On Mon, 2012-10-29 at 17:01 +0800, Aaron Lu wrote: Added a new config CONFIG_SATA_ZPODD, which is ued to support SATA based zero power ODD. It depends on ACPI, and selects BLK_DEV_SR as the implementation of ZPODD depends on SCSI sr driver. 2 new files are added, which will be used to host

Re: [PATCH v8 10/11] scsi: sr: support (un)block events

2012-10-29 Thread James Bottomley
On Mon, 2012-10-29 at 17:01 +0800, Aaron Lu wrote: 2 interfaces are added to block/unblock events for the disk sr manages. This is used by SATA ZPODD, when ODD is runtime powered off, the events poll is no longer needed so better be blocked. And once powered on, events poll will be unblocked.

Re: [PATCH v8 10/11] scsi: sr: support (un)block events

2012-10-29 Thread Alan Stern
On Mon, 29 Oct 2012, James Bottomley wrote: On Mon, 2012-10-29 at 17:01 +0800, Aaron Lu wrote: 2 interfaces are added to block/unblock events for the disk sr manages. This is used by SATA ZPODD, when ODD is runtime powered off, the events poll is no longer needed so better be blocked. And

Re: [PATCH v8 05/11] libata-eh: allow defer in ata_exec_internal

2012-10-29 Thread Tejun Heo
Hello, On Tue, Oct 30, 2012 at 11:00:16AM +0800, Aaron Lu wrote: Why not do the discovery from EH? Do you mean set a device level EH flag and then schedule EH to do the discovery? Yeah, something like that or why can't it be done while probing the device in the first place? Thanks. --

Re: [PATCH v8 05/11] libata-eh: allow defer in ata_exec_internal

2012-10-29 Thread Aaron Lu
On 10/30/2012 11:01 AM, Tejun Heo wrote: Hello, On Tue, Oct 30, 2012 at 11:00:16AM +0800, Aaron Lu wrote: Why not do the discovery from EH? Do you mean set a device level EH flag and then schedule EH to do the discovery? Yeah, something like that or why can't it be done while probing

Re: [PATCH v8 02/11] ata: zpodd: Add CONFIG_SATA_ZPODD

2012-10-29 Thread Aaron Lu
On 10/30/2012 02:11 AM, James Bottomley wrote: On Mon, 2012-10-29 at 17:01 +0800, Aaron Lu wrote: Added a new config CONFIG_SATA_ZPODD, which is ued to support SATA based zero power ODD. It depends on ACPI, and selects BLK_DEV_SR as the implementation of ZPODD depends on SCSI sr driver. 2

Re: scsi:sd: provisioning_mode not being set to unmap

2012-10-29 Thread Martin K. Petersen
John == John Washer johnkwas...@gmail.com writes: John Provisioning mode is not being set to unmap even though it seems John that device firmware provides all the required information to SD. I instrumented scsi_debug to provide the same values as your device (LBPME=1, identical Block Limits

Re: [PATCH v8 10/11] scsi: sr: support (un)block events

2012-10-29 Thread James Bottomley
On Mon, 2012-10-29 at 18:22 -0400, Alan Stern wrote: On Mon, 29 Oct 2012, James Bottomley wrote: On Mon, 2012-10-29 at 17:01 +0800, Aaron Lu wrote: 2 interfaces are added to block/unblock events for the disk sr manages. This is used by SATA ZPODD, when ODD is runtime powered off, the

Re: [PATCH v8 10/11] scsi: sr: support (un)block events

2012-10-29 Thread Aaron Lu
On 10/30/2012 02:11 AM, James Bottomley wrote: On Mon, 2012-10-29 at 17:01 +0800, Aaron Lu wrote: 2 interfaces are added to block/unblock events for the disk sr manages. This is used by SATA ZPODD, when ODD is runtime powered off, the events poll is no longer needed so better be blocked. And

RE: [PATCH 6/7] Fix race between starved list processing and device removal

2012-10-29 Thread Zhuang, Jin Can
Hi Bart, Yes. Here's the warning. For the trace below, I used scsi_device_get/scsi_device_put() in scsi_run_queue(). (A little different from your patch). But I think it's the same. 10-23 18:15:53.309 8 8 I KERNEL : [ 268.994556] BUG: sleeping function called from invalid context