[PATCH] virtio_scsi: fix memory leak on full queue condition.

2012-11-08 Thread Eric Northup
virtscsi_queuecommand was leaking memory when the virtio queue was full. Tested: Guest operates correctly even with very small queue sizes, validated we're not leaking kmalloc-192 sized allocations anymore. Signed-off-by: Eric Northup digitale...@google.com --- drivers/scsi/virtio_scsi.c |2

Re: scsi target, likely GPL violation

2012-11-08 Thread Andy Grover
On 11/07/2012 05:02 PM, Jon Mason wrote: On Wed, Nov 7, 2012 at 9:50 AM, Andy Grover agro...@redhat.com wrote: Your company appears to be shipping kernel features in RTS OS that are not made available under the GPL, specifically support for the EXTENDED_COPY and COMPARE_AND_WRITE SCSI

Re: scsi target, likely GPL violation

2012-11-08 Thread Andy Grover
On 11/07/2012 05:57 PM, Chris Friesen wrote: On 11/07/2012 07:02 PM, Jon Mason wrote: I'm not a lawyer, nor do I play one on TV, but if I understand the GPL correctly, RTS only needs to provide the relevant source to their customers upon request. Not quite. Assuming the GPL applies, and

Re: scsi target, likely GPL violation

2012-11-08 Thread Nicholas A. Bellinger
On Thu, 2012-11-08 at 08:57 -0800, Andy Grover wrote: On 11/07/2012 05:57 PM, Chris Friesen wrote: On 11/07/2012 07:02 PM, Jon Mason wrote: I'm not a lawyer, nor do I play one on TV, but if I understand the GPL correctly, RTS only needs to provide the relevant source to their customers

[PATCH] target/iblock: Fix double iblock_complete_cmd callback bug

2012-11-08 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch fixes a double completion bug where ibr-pending = 2 usage plus the extra callback to iblock_complete_cmd() invoked after bio submission in iblock_execute_rw() can interfere with the normal bio-bi_done() - iblock_bio_done() -

[PATCH 0/3] target/iblock: Add WRITE_SAME w/ UNMAP=0 emulation

2012-11-08 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org Hi folks, This series for-3.8 adds support for proper WRITE_SAME w/ UNMAP=0 emulation for IBLOCK device backends to follow MKP's WRITE_SAME patches that have been merged for v3.7-rc1. Currently it uses a bio_add_page() call for each sector in order

[PATCH 1/3] target/sbc: Make WRITE_SAME check differentiate between UNMAP=[1,0]

2012-11-08 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch updates sbc_write_same_supported() to set SCF_WRITE_SAME_DISCARD to signal when WRITE_SAME w/ UNMAP=1 is requested. Also, allow WRITE_SAME w/ UNMAP=0 to be passed to backend driver logic. Cc: Christoph Hellwig h...@lst.de Cc: Martin K.

[PATCH 3/3] target/iblock: Add WRITE_SAME w/ UNMAP=0 emulation support

2012-11-08 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch adds support for emulation of WRITE_SAME w/ UNMAP=0 within iblock_execute_write_same() backend code. The emulation uses a bio_add_page() call for each sector, and by default enforces a limit of max_write_same_len=0x (65536) sectors

[PATCH 2/3] target: Add max_write_same_len device attribute

2012-11-08 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch adds a new max_write_same_len device attribute for use with WRITE_SAME w/ UNMAP=0 backend emulation. Also, update block limits VPD emulation code in spc_emulate_evpd_b0() to set the default MAXIMUM WRITE SAME LENGTH value of zero. Cc:

Re: scsi target, likely GPL violation

2012-11-08 Thread Dave Airlie
...and then turn around and submit it to Nick since he's the target subsystem maintainer? Nick is probably the one who wrote it! I'm happy to do that, but we should recognize something is seriously skewed when the person nominally in charge of the in-kernel code also has a vested interest in

[patch 1/2] drivers/message/fusion/mptscsih.c: missing break

2012-11-08 Thread akpm
From: Alan Cox a...@linux.intel.com Subject: drivers/message/fusion/mptscsih.c: missing break This happens to do the right thing in all cases on fibre channel but not on other media types Signed-off-by: Alan Cox a...@linux.intel.com Cc: James Bottomley james.bottom...@hansenpartnership.com Cc:

[patch 2/2] drivers/scsi/hptiop: support HighPoint RR4520/RR4522 HBA

2012-11-08 Thread akpm
From: HighPoint Linux Team li...@highpoint-tech.com Subject: drivers/scsi/hptiop: support HighPoint RR4520/RR4522 HBA Support IOP RR4520/RR4522 which are based on Marvell frey. Signed-off-by: HighPoint Linux Team li...@highpoint-tech.com Signed-off-by: Andrew Morton a...@linux-foundation.org ---

Re: scsi target, likely GPL violation

2012-11-08 Thread Nicholas A. Bellinger
On Thu, 2012-11-08 at 13:22 -0800, Andy Grover wrote: On 11/08/2012 12:05 PM, Nicholas A. Bellinger wrote: Accusing us of violating GPL is a serious legal claim. In fact, we are not violating GPL. In short, this is because we wrote the code you are referring to (the SCSI target core

[PATCH] virtio-scsi: Fix incorrect lock release order in virtscsi_kick_cmd

2012-11-08 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch fixes a regression bug in virtscsi_kick_cmd() that relinquishes the acquired spinlocks in the incorrect order using the wrong spin_unlock macros, namely releasing vq-vq_lock before tgt-tgt_lock while invoking the calls to

[PATCH v9 00/10] ZPODD Patches

2012-11-08 Thread Aaron Lu
v9: Build ZPODD as part of libata instead of another standalone module as it is tightly related to other libata files. Identify and init ZPODD during probe time instead of after SCSI device is created as suggested by Tejun Heo. Make use of pm qos flag to give ACPI hint when choosing ACPI state.

[PATCH v9 01/10] scsi: sr: support runtime pm

2012-11-08 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 v9 02/10] ata: zpodd: Add CONFIG_SATA_ZPODD

2012-11-08 Thread Aaron Lu
Added a new config CONFIG_SATA_ZPODD, which is used to support SATA based zero power ODD. It depends on ATA_ACPI, and selects BLK_DEV_SR as the implementation of ZPODD depends on SCSI sr driver. A new file libata-zpodd.c is added, which will be used to host ZPODD related code. It is empty for

[PATCH v9 03/10] ata: zpodd: identify and init ZPODD devices

2012-11-08 Thread Aaron Lu
The ODD can be enabled for ZPODD if the following three conditions are satisfied: 1 The ODD supports device attention; 2 The platform can runtime power off the ODD through ACPI; 3 The ODD is either slot type or drawer type. For such ODDs, zpodd_init is called and a new structure is allocated for

[PATCH v9 04/10] libata: acpi: move acpi notification code to zpodd

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

[PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-08 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 v9 05/10] libata: separate ATAPI code

2012-11-08 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, and the Makefile is modified accordingly. No functional changes should result from this commit. Signed-off-by: Aaron Lu aaron...@intel.com --- drivers/ata/Makefile

[PATCH v9 08/10] scsi: sr: support (un)block events

2012-11-08 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

[PATCH v9 09/10] ata: zpodd: handle power transition of ODD

2012-11-08 Thread Aaron Lu
When ata port is runtime suspended, it will check if the ODD attched to it is in zero power ready state by checking the zp_ready field. And if this field indicates it is not ready to be powered off, NO_POWEROFF qos flag will be set to avoid choosing ACPI_STATE_D3_COLD for it. Once powered off,

[PATCH v9 10/10] ata: expose pm qos flags to user space for ata device

2012-11-08 Thread Aaron Lu
Expose pm qos flags to user space so that user has a chance to disable pm features like power off, if he/she has a broken platform or devices or simply does not like this pm feature. This flag is exposed to user space only for ata device or atapi device that is zero power capable. For normal

[PATCH v9 07/10] block: add a new interface to block events

2012-11-08 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 RESEND v4 0/5] Migrate SCSI drivers to use dev_pm_ops

2012-11-08 Thread Aaron Lu
This patchset has been quiet for a while, so resend them. v4: Only Patch 4 is modified: Fixed a line over 80 characters warning by checkpatch.pl; Update the changelog so that it is no more a try :-) v3: Only patch 4 is modified: Remove the special case for system freeze in

[PATCH v4 1/5] sd: put to stopped power state when runtime suspend

2012-11-08 Thread Aaron Lu
When device is runtime suspended, put it to stopped power state to save some power. This will also make the behaviour consistent with what the scsi_pm.c thinks about sd as the comment says: sd treats runtime suspend, system suspend and system hibernate identical. With this patch, it is now

[PATCH v4 2/5] Revert [SCSI] scsi_pm: set device runtime state before parent suspended

2012-11-08 Thread Aaron Lu
This reverts commit 33a2285d96b5e7b9500612ec623bf4313397bb53. With commit 88d26136a256576e444db312179e17af6dd0ea87 (PM: Prevent runtime suspend during system resume), this patch is no longer needed. Signed-off-by: Aaron Lu aaron...@intel.com Acked-by: Alan Stern st...@rowland.harvard.edu

[PATCH v4 3/5] Revert [SCSI] runtime resume parent for child's system-resume

2012-11-08 Thread Aaron Lu
This reverts commit 28fd00d42cca178638f51c08efa986a777c24a4b. With commit 88d26136a256576e444db312179e17af6dd0ea87 (PM: Prevent runtime suspend during system resume), this patch is no longer needed. Signed-off-by: Aaron Lu aaron...@intel.com Acked-by: Alan Stern st...@rowland.harvard.edu

[PATCH v4 4/5] pm: use callbacks from dev_pm_ops for scsi devices

2012-11-08 Thread Aaron Lu
Use of pm_message_t is deprecated and device driver is not supposed to use that. This patch migrates the SCSI bus level pm callbacks to call device's pm callbacks defined in its driver's dev_pm_ops. This is achieved by finding out which device pm callback should be used in bus callback function,

[PATCH v4 5/5] sd: update sd to use the new pm callbacks

2012-11-08 Thread Aaron Lu
Update sd driver to use the callbacks defined in dev_pm_ops. sd_freeze is NULL, the bus level callback has taken care of quiescing the device so there should be nothing needs to be done here. Consequently, sd_thaw is not needed here either. suspend, poweroff and runtime suspend share the same

RE: [PATCH 2/3] [SCSI] mvsas: fix shift in mvs_94xx_free_reg_set()

2012-11-08 Thread Xiangliang Yu
On 11/6/12 7:06 AM, James Bottomley wrote: Why is this necessary? As I read the reg set assignment code, it finds a free bit in the 64 bit register and uses that ... which can never be greater than 64 so there's no need for the check. This patch just tries to be more defensive for

Re: [PATCH] virtio-scsi: Fix incorrect lock release order in virtscsi_kick_cmd

2012-11-08 Thread Wanlong Gao
On 11/09/2012 02:29 PM, Nicholas A. Bellinger wrote: From: Nicholas Bellinger n...@linux-iscsi.org This patch fixes a regression bug in virtscsi_kick_cmd() that relinquishes the acquired spinlocks in the incorrect order using the wrong spin_unlock macros, namely releasing vq-vq_lock before