[PATCH] Marvell 6440 SAS/SATA driver (rough draft)

2007-09-25 Thread Jeff Garzik
Same disclaimer as with broadsas... it's better to go ahead and get this work-in-progress out there for people to comment on. The chip: the 6440 has per-HBA rings for TX (delivery) and RX (completions, events). You build a DMA command descriptor describing the SSP, SMP, STP or SATA command,

question on SDEV_BLOCK vs. SDEV_QUIESCE

2007-09-25 Thread Oliver Neukum
Hi, what is the difference between these states? What function should I call to block a device in order to securely flush the caches? Regards Oliver - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More

Re: question on SDEV_BLOCK vs. SDEV_QUIESCE

2007-09-25 Thread Hannes Reinecke
Oliver Neukum wrote: Hi, what is the difference between these states? What function should I call to block a device in order to securely flush the caches? SDEV_BLOCK blocks _any_ commands from the midlayer; eg. if the LLDD is doing some internal recovery. SDEV_QUIESCE only blocks 'normal'

Re: [linux-usb-devel] question on flushing buffers and spinning down disk

2007-09-25 Thread Oliver Neukum
Am Montag 24 September 2007 schrieb Alan Stern: On Mon, 24 Sep 2007, Oliver Neukum wrote: subsystem implements its own form of runtime PM support, then you'll be able to use it properly. But until then, there isn't anything much you can do. Well, we can't simply cut power.

Re: question on SDEV_BLOCK vs. SDEV_QUIESCE

2007-09-25 Thread Oliver Neukum
Am Dienstag 25 September 2007 schrieb Hannes Reinecke: Oliver Neukum wrote: Hi, what is the difference between these states? What function should I call to block a device in order to securely flush the caches? SDEV_BLOCK blocks _any_ commands from the midlayer; eg. if the LLDD is

Re: [PATCH 0/4] more gdth patches for your amusement

2007-09-25 Thread Christoph Hellwig
On Mon, Sep 24, 2007 at 08:25:28PM -0400, Jeff Garzik wrote: OK, we've had these competing patch sets floating around for two months now. Christoph and Jeff, can we get agreement on which is going in? Well, my opinion is 1) When judging by total amount of positive improvement, Christoph's

Re: [PATCH 0/4] more gdth patches for your amusement

2007-09-25 Thread Boaz Harrosh
On Tue, Sep 25 2007 at 10:20 +0200, Christoph Hellwig [EMAIL PROTECTED] wrote: On Mon, Sep 24, 2007 at 08:25:28PM -0400, Jeff Garzik wrote: OK, we've had these competing patch sets floating around for two months now. Christoph and Jeff, can we get agreement on which is going in? Well, my

Re: [PATCH 0/4] more gdth patches for your amusement

2007-09-25 Thread Matthew Wilcox
On Tue, Sep 25, 2007 at 11:51:13AM +0200, Boaz Harrosh wrote: On top of that I have my own agenda of cleaning the !use_sg code paths and getting rid of scsi_cmnd abuse, so there is also that. This seems like a good time to post my own patch that removes the use of -scsi_done from gdth. I

Re: [PATCH 0/4] more gdth patches for your amusement

2007-09-25 Thread Boaz Harrosh
On Tue, Sep 25 2007 at 13:56 +0200, Matthew Wilcox [EMAIL PROTECTED] wrote: On Tue, Sep 25, 2007 at 11:51:13AM +0200, Boaz Harrosh wrote: On top of that I have my own agenda of cleaning the !use_sg code paths and getting rid of scsi_cmnd abuse, so there is also that. This seems like a good

Re: [PATCH 0/4] more gdth patches for your amusement

2007-09-25 Thread Matthew Wilcox
On Tue, Sep 25, 2007 at 02:17:44PM +0200, Boaz Harrosh wrote: This patch looks grate, Thanks. It is very good for the direction I'm going to. However it does have a smallish conflict with One of Jeff's patches where he completely removes the 2.4.x support. If it is OK with you I will add

Some plans for scsi_cmnd

2007-09-25 Thread Matthew Wilcox
Christoph grabbed me on IRC and we debated some of my plans for scsi_cmnd; with his permission I'm summarising the result of that debate for posterity. There's four main things discussed: 1. I'm going to be writing and posting patches over the next week or so to kill all the (ab)uses of

Re: Some plans for scsi_cmnd

2007-09-25 Thread Christoph Hellwig
On Tue, Sep 25, 2007 at 07:37:33AM -0600, Matthew Wilcox wrote: 2. Thanks to a thinko, we also discussed the upper-layer -done. We think it should be feasible to move this from the scsi_cmnd to the scsi_device since sg doesn't use it. I suspect putting it into the scsi_driver would be even

RE: Patch added to scsi-pending-2.6: [SCSI] ips: Update version information

2007-09-25 Thread Salyzyn, Mark
ACK Sincerely -- Mark Salyzyn -Original Message- From: James Bottomley [mailto:[EMAIL PROTECTED] Sent: Sunday, September 23, 2007 10:45 AM To: AACRAID; Bernhard Walle; James Bottomley Subject: Patch added to scsi-pending-2.6: [SCSI] ips: Update version information Your commit:

Re: Some plans for scsi_cmnd

2007-09-25 Thread Matthew Wilcox
On Tue, Sep 25, 2007 at 02:47:50PM +0100, Christoph Hellwig wrote: On Tue, Sep 25, 2007 at 07:37:33AM -0600, Matthew Wilcox wrote: 2. Thanks to a thinko, we also discussed the upper-layer -done. We think it should be feasible to move this from the scsi_cmnd to the scsi_device since sg

Re: [linux-usb-devel] question on flushing buffers and spinning down disk

2007-09-25 Thread Alan Stern
On Mon, 24 Sep 2007, Oliver Neukum wrote: Am Montag 24 September 2007 schrieb Alan Stern: On Mon, 24 Sep 2007, Oliver Neukum wrote: subsystem implements its own form of runtime PM support, then you'll be able to use it properly.  But until then, there isn't anything much you can

Re: Some plans for scsi_cmnd

2007-09-25 Thread Boaz Harrosh
On Tue, Sep 25 2007 at 15:37 +0200, Matthew Wilcox [EMAIL PROTECTED] wrote: Christoph grabbed me on IRC and we debated some of my plans for scsi_cmnd; with his permission I'm summarising the result of that debate for posterity. There's four main things discussed: 1. I'm going to be writing

Re: [linux-usb-devel] question on flushing buffers and spinning down disk

2007-09-25 Thread Alan Stern
On Tue, 25 Sep 2007, Oliver Neukum wrote: Am Montag 24 September 2007 schrieb Alan Stern: On Mon, 24 Sep 2007, Oliver Neukum wrote: subsystem implements its own form of runtime PM support, then you'll be able to use it properly. But until then, there isn't anything much you can

Re: [linux-usb-devel] question on flushing buffers and spinning down disk

2007-09-25 Thread Oliver Neukum
Am Dienstag 25 September 2007 schrieb Alan Stern: Furthermore for many devices it will take real user intervention to determine what is in the enclosure. This isn't very good. I think we can do better. If by we you mean the Linux kernel in general, then I agree.  If by we you mean the

Re: Some plans for scsi_cmnd

2007-09-25 Thread Matthew Wilcox
On Tue, Sep 25, 2007 at 04:51:06PM +0200, Boaz Harrosh wrote: As I said, it's ambitious. But it'll let us get rid of scsi_pointer and host_scribble entirely. This all is an excellent idea and you will find that in the patchset to gdth, I have made the work of one driver a bit easier for

[PATCH] pluto: Don't abuse -done for internal commands

2007-09-25 Thread Matthew Wilcox
From: Matthew Wilcox [EMAIL PROTECTED] We can simply call the internal done function directly Signed-off-by: Matthew Wilcox [EMAIL PROTECTED] --- drivers/scsi/pluto.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c index

Remove -done from scsi_cmnd

2007-09-25 Thread Matthew Wilcox
This series of four patches gets rid of -done from scsi_cmnd. It applies on top of the patch I sent earlier today to improve gdth's abuse of scsi_done. Sorry, Boaz. I'd like to thank Christoph for talking me through some of the bits of the block layer I didn't grok. - To unsubscribe from this

[PATCH] Fix mistaken uses of -done

2007-09-25 Thread Matthew Wilcox
From: Matthew Wilcox [EMAIL PROTECTED] All these drivers meant to call -scsi_done() but got confused. Signed-off-by: Matthew Wilcox [EMAIL PROTECTED] --- drivers/scsi/NCR5380.c |8 drivers/scsi/NCR53C9x.c |2 +- drivers/scsi/atari_NCR5380.c |4 ++--

[PATCH] gdth: Stop abusing -done for internal commands

2007-09-25 Thread Matthew Wilcox
From: Matthew Wilcox [EMAIL PROTECTED] The -done member was being used to mark commands as being internal. I decided to put a magic number in -underflow instead. I believe this to be safe as no current user of -underflow has any of the bottom 9 bits set. Signed-off-by: Matthew Wilcox [EMAIL

[PATCH] Get rid of scsi_cmnd-done

2007-09-25 Thread Matthew Wilcox
From: Matthew Wilcox [EMAIL PROTECTED] The ULD -done callback moves into the scsi_driver. By moving the call to scsi_io_completion() from scsi_blk_pc_done() to scsi_finish_command(), we can eliminate the latter entirely. By returning 'good_bytes' from the -done callback (rather than invoking

Re: [PATCH] Get rid of scsi_cmnd-done

2007-09-25 Thread Boaz Harrosh
On Tue, Sep 25 2007 at 18:42 +0200, Matthew Wilcox [EMAIL PROTECTED] wrote: From: Matthew Wilcox [EMAIL PROTECTED] The ULD -done callback moves into the scsi_driver. By moving the call to scsi_io_completion() from scsi_blk_pc_done() to scsi_finish_command(), we can eliminate the latter

Re: [PATCH] Get rid of scsi_cmnd-done

2007-09-25 Thread Matthew Wilcox
On Tue, Sep 25, 2007 at 07:05:09PM +0200, Boaz Harrosh wrote: @@ -694,7 +702,13 @@ void scsi_finish_command(struct scsi_cmnd *cmd) Notifying upper driver of completion (result %x)\n, cmd-result)); - cmd-done(cmd); +

Re: [PATCH] gdth: Stop abusing -done for internal commands

2007-09-25 Thread Boaz Harrosh
On Tue, Sep 25 2007 at 18:42 +0200, Matthew Wilcox [EMAIL PROTECTED] wrote: From: Matthew Wilcox [EMAIL PROTECTED] The -done member was being used to mark commands as being internal. I decided to put a magic number in -underflow instead. I believe this to be safe as no current user of

RE: [PATCH 6/9] mpt fusion: error recovery improvements, andsynchronizing internal commands

2007-09-25 Thread James Bottomley
On Mon, 2007-09-24 at 19:26 -0600, Moore, Eric wrote: On Saturday, September 22, 2007 10:23 AM, James Bottomley wrote: OK, I thought I'd wait here for the breakout, but in the meantime I tried to compile the first five patches, but they don't: CC [M]

Re: [PATCH] gdth: Stop abusing -done for internal commands

2007-09-25 Thread Matthew Wilcox
On Tue, Sep 25, 2007 at 07:30:29PM +0200, Boaz Harrosh wrote: OK This is on top of the first patch that I will take care of, right? (http://www.spinics.net/lists/linux-scsi/msg19470.html) That's right. Here 2 it will not merge with my patchset. So I'll take it off your hands and rebase it to

RE: [PATCH 4/9] mpt fusion: error recovery improvements, andsynchronizing internal commands

2007-09-25 Thread James Bottomley
On Mon, 2007-09-24 at 19:26 -0600, Moore, Eric wrote: On Saturday, September 22, 2007 9:39 AM, James Bottomley wrote: Well, I'll put this in this time. However, it contains a whole slew of pointless changes like this: - mdelay (10); +

RE: [PATCH 6/9] mpt fusion: error recovery improvements, andsynchronizing internal commands

2007-09-25 Thread James Bottomley
On Mon, 2007-09-24 at 19:35 -0600, Moore, Eric wrote: On Saturday, September 22, 2007 10:02 AM, James Bottomley wrote: What fixes? The object of a change log is to preserve the history of a particular change (as per the Developer Certificate of Origin). This means if you get a

RE: [PATCH 6/9] mpt fusion: error recovery improvements,andsynchronizing internal commands

2007-09-25 Thread Moore, Eric
On Tuesday, September 25, 2007 11:32 AM, James Bottomley wrote: Youve rejected the error recovery patchs, which is fair enough. Just the separation ... the actual patch looks OK. I'll will continue working to separate the error recovery improvements: into smaller feature add, but

Re: [PATCH 6/9] mpt fusion: error recovery improvements,andsynchronizing internal commands

2007-09-25 Thread Jeff Garzik
Moore, Eric wrote: On Tuesday, September 25, 2007 11:32 AM, James Bottomley wrote: Youve rejected the error recovery patchs, which is fair enough. Just the separation ... the actual patch looks OK. I'll will continue working to separate the error recovery improvements: into smaller

Re: [PATCH 6/9] mpt fusion: error recovery improvements,andsynchronizing internal commands

2007-09-25 Thread Michael Reed
Jeff Garzik wrote: Moore, Eric wrote: On Tuesday, September 25, 2007 11:32 AM, James Bottomley wrote: Youve rejected the error recovery patchs, which is fair enough. Just the separation ... the actual patch looks OK. I'll will continue working to separate the error recovery

Re: [PATCH 6/9] mpt fusion: error recovery improvements,andsynchronizing internal commands

2007-09-25 Thread James Bottomley
On Tue, 2007-09-25 at 17:38 -0500, Michael Reed wrote: Jeff Garzik wrote: Moore, Eric wrote: On Tuesday, September 25, 2007 11:32 AM, James Bottomley wrote: Youve rejected the error recovery patchs, which is fair enough. Just the separation ... the actual patch looks OK.

Re: [PATCH 6/9] mpt fusion: error recovery improvements,andsynchronizing internal commands

2007-09-25 Thread Jeff Garzik
Michael Reed wrote: Jeff Garzik wrote: Moore, Eric wrote: On Tuesday, September 25, 2007 11:32 AM, James Bottomley wrote: Youve rejected the error recovery patchs, which is fair enough. Just the separation ... the actual patch looks OK. I'll will continue working to separate the error

queued patches for SCSI for 2.6.24

2007-09-25 Thread James Bottomley
Andrew asked that I provide a status report of pending updates. The list is attached below. It's pretty much driver updates and minor bug fixes. The main functionality changes are Kay's sysfs updates and the shift of the ULD attachement towards the block prep function. James --- Adrian Bunk

Re: queued patches for SCSI for 2.6.24

2007-09-25 Thread David Miller
From: James Bottomley [EMAIL PROTECTED] Date: Tue, 25 Sep 2007 20:00:02 -0500 David Miller (1): esp: fix instance numbering. I'd like to request that this one goes into 2.6.23 as it is a bug fix and the bug confuses users. Thanks. - To unsubscribe from this list: send the line

Re: queued patches for SCSI for 2.6.24

2007-09-25 Thread Boaz Harrosh
On Wed, Sep 26 2007 at 3:00 +0200, James Bottomley [EMAIL PROTECTED] wrote: Andrew asked that I provide a status report of pending updates. The list is attached below. It's pretty much driver updates and minor bug fixes. The main functionality changes are Kay's sysfs updates and the shift

Re: queued patches for SCSI for 2.6.24

2007-09-25 Thread James Bottomley
On Wed, 2007-09-26 at 10:28 +0900, FUJITA Tomonori wrote: On Tue, 25 Sep 2007 20:00:02 -0500 James Bottomley [EMAIL PROTECTED] wrote: Andrew asked that I provide a status report of pending updates. The list is attached below. It's pretty much driver updates and minor bug fixes. The

Re: [GIT PATCH] SCSI bug fix for 2.6.23-rc8

2007-09-25 Thread James Bottomley
On Tue, 2007-09-25 at 12:55 -0500, James Bottomley wrote: This is, unfortunately, not a recent regression but it's only been recently diagnosed. Apparently the SCSI Parallel transport class domain validation cable width detection wasn't working, leading to cases where controllers with damaged

Re: queued patches for SCSI for 2.6.24

2007-09-25 Thread FUJITA Tomonori
On Tue, 25 Sep 2007 20:42:35 -0500 James Bottomley [EMAIL PROTECTED] wrote: On Wed, 2007-09-26 at 10:28 +0900, FUJITA Tomonori wrote: On Tue, 25 Sep 2007 20:00:02 -0500 James Bottomley [EMAIL PROTECTED] wrote: Andrew asked that I provide a status report of pending updates. The list

Re: queued patches for SCSI for 2.6.24

2007-09-25 Thread Jeff Garzik
FUJITA Tomonori wrote: diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index adc9559..694015d 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -342,6 +342,10 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)

Re: queued patches for SCSI for 2.6.24

2007-09-25 Thread Matthew Wilcox
On Tue, Sep 25, 2007 at 10:37:33PM -0400, Jeff Garzik wrote: Are there any const-ness worries for scsi_host_template, or plans for the future? I do not see any other examples of the host template members getting modified. Goodness, Jeff, you haven't looked too hard. There's dozens of

Re: queued patches for SCSI for 2.6.24

2007-09-25 Thread Jeff Garzik
Matthew Wilcox wrote: On Tue, Sep 25, 2007 at 10:37:33PM -0400, Jeff Garzik wrote: Are there any const-ness worries for scsi_host_template, or plans for the future? I do not see any other examples of the host template members getting modified. Goodness, Jeff, you haven't looked too hard.

Re: queued patches for SCSI for 2.6.24

2007-09-25 Thread Matthew Wilcox
On Tue, Sep 25, 2007 at 11:34:00PM -0400, Jeff Garzik wrote: Well, sure, the driver is the owner of that memory. We're talking about common code. If everybody agrees SHT is R/W in the core, Fujita-san's patch is fine. Oh ... harder to find, but scsi_module.c does that, as does

Re: queued patches for SCSI for 2.6.24

2007-09-25 Thread FUJITA Tomonori
On Tue, 25 Sep 2007 22:37:33 -0400 Jeff Garzik [EMAIL PROTECTED] wrote: FUJITA Tomonori wrote: diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index adc9559..694015d 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -342,6 +342,10 @@ struct Scsi_Host

Re: queued patches for SCSI for 2.6.24

2007-09-25 Thread James Bottomley
On Tue, 2007-09-25 at 23:34 -0400, Jeff Garzik wrote: Matthew Wilcox wrote: On Tue, Sep 25, 2007 at 10:37:33PM -0400, Jeff Garzik wrote: Are there any const-ness worries for scsi_host_template, or plans for the future? I do not see any other examples of the host template members

Re: queued patches for SCSI for 2.6.24

2007-09-25 Thread Jeff Garzik
James Bottomley wrote: This whole mess is generated basically because the zero default of the template should be treated as initiator. How about this, which makes that manifest? James diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index adc9559..7e26440 100644 ---

Re: queued patches for SCSI for 2.6.24

2007-09-25 Thread FUJITA Tomonori
On Tue, 25 Sep 2007 22:45:53 -0500 James Bottomley [EMAIL PROTECTED] wrote: On Tue, 2007-09-25 at 23:34 -0400, Jeff Garzik wrote: Matthew Wilcox wrote: On Tue, Sep 25, 2007 at 10:37:33PM -0400, Jeff Garzik wrote: Are there any const-ness worries for scsi_host_template, or plans for

Re: queued patches for SCSI for 2.6.24

2007-09-25 Thread James Bottomley
On Wed, 2007-09-26 at 12:55 +0900, FUJITA Tomonori wrote: On Tue, 25 Sep 2007 22:45:53 -0500 James Bottomley [EMAIL PROTECTED] wrote: On Tue, 2007-09-25 at 23:34 -0400, Jeff Garzik wrote: Matthew Wilcox wrote: On Tue, Sep 25, 2007 at 10:37:33PM -0400, Jeff Garzik wrote: Are there

Re: queued patches for SCSI for 2.6.24

2007-09-25 Thread FUJITA Tomonori
On Tue, 25 Sep 2007 23:01:53 -0500 James Bottomley [EMAIL PROTECTED] wrote: On Wed, 2007-09-26 at 12:55 +0900, FUJITA Tomonori wrote: On Tue, 25 Sep 2007 22:45:53 -0500 James Bottomley [EMAIL PROTECTED] wrote: On Tue, 2007-09-25 at 23:34 -0400, Jeff Garzik wrote: Matthew Wilcox

[PATCH 1/8] gdth: Split out EISA and ISA register into separate functions

2007-09-25 Thread Jeff Garzik
An equivalent-transformation change. No functional changes beyond those necessary to call the new, split-out functions. Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index b20c188..f330d34 100644 --- a/drivers/scsi/gdth.c +++

[PATCH 2/8] gdth: Split out PCI register into separate function

2007-09-25 Thread Jeff Garzik
An equivalent-transformation change. No functional changes beyond those necessary to call the new function. Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index f330d34..840bdf6 100644 --- a/drivers/scsi/gdth.c +++

[PATCH 3/8] gdth: Remove 2.4.x support, in-kernel changelog

2007-09-25 Thread Jeff Garzik
* Remove in-source changelog. It's archived permanently in git and various kernel archives, and changelogs should exist purely in git. * Remove 2.4.x kernel support. It is an active obstacle to modernizing this driver, at this point. This includes killing gdth_kcompat.h which is 100%

[PATCH 4/8] gdth: Isolate driver-global variables using helpers

2007-09-25 Thread Jeff Garzik
Sanitizes access to some driver-global variables, in preparation for making them dynamic rather than statically-sized. This equivalent-transform style change blissfully ignores the fact that gdth_ctr_vtab[] is never used (only assigned), and that the driver itself seems to get a bit confused

[PATCH 6/8] gdth: Move probe-time error handling code to end of each function

2007-09-25 Thread Jeff Garzik
Use standard laddered-goto error handling approach in three probe-time functions. Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index d7ef159..89ac155 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c @@ -3964,13 +3964,11 @@

[PATCH 8/8] gdth: convert to modern SCSI host alloc/scan

2007-09-25 Thread Jeff Garzik
Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index f382664..3f3ef4b 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c @@ -3960,7 +3960,7 @@ static int __init gdth_register_virt(struct scsi_host_template *shtp, { struct

[PATCH 5/8] gdth: kill gdth_{read,write}[bwl] wrappers

2007-09-25 Thread Jeff Garzik
They are direct equivalents to {read,write}[bwl]. Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index b9d1f69..d7ef159 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c @@ -294,13 +294,6 @@ static struct timer_list gdth_timer;

Re: queued patches for SCSI for 2.6.24

2007-09-25 Thread FUJITA Tomonori
On Tue, 25 Sep 2007 22:45:53 -0500 James Bottomley [EMAIL PROTECTED] wrote: On Tue, 2007-09-25 at 23:34 -0400, Jeff Garzik wrote: Matthew Wilcox wrote: On Tue, Sep 25, 2007 at 10:37:33PM -0400, Jeff Garzik wrote: Are there any const-ness worries for scsi_host_template, or plans for