Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-28 Thread Benjamin Herrenschmidt
> We could have done it for interrupts too. A "struct irqnum" that has a bit > that specifies "valid". That would work. But it tends to be painful, so it > really has to give you something more than "zero is disabled". > > It's just not worth it. > > And it's why I decreed, that the ONLY SANE

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-28 Thread Benjamin Herrenschmidt
> However, in all honesty, we have triggered bugs in that area too, simply > because some driver code "knew" that PIO addresses could fit in 16 bits, > and used u16 or "unsigned short" to remember the PIO address. Both ARM and > Sparc was bitten by this, although usually the issue is trivial to

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-28 Thread Benjamin Herrenschmidt
> On sparc64, for example, after I pointed this out to DaveM, he was able > to implement the new iomap interface without the 'if (pio-mem-area)' > branch present on x86. Yup, we did that from day 1 on powerpc :-) However, I don't totally agree with adding some other remapping layer here, I

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-28 Thread Benjamin Herrenschmidt
> Indeed. Zero means "not in use". It really is that simple. I tried to avoid stepping into that specific flamewar as I don't have strong opinions either way, but I've been asked to so ... and there are a few things in your statement that I do like to argue about a bit :-) > And I'm sorry,

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-28 Thread Benjamin Herrenschmidt
Indeed. Zero means not in use. It really is that simple. I tried to avoid stepping into that specific flamewar as I don't have strong opinions either way, but I've been asked to so ... and there are a few things in your statement that I do like to argue about a bit :-) And I'm sorry, David,

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-28 Thread Benjamin Herrenschmidt
On sparc64, for example, after I pointed this out to DaveM, he was able to implement the new iomap interface without the 'if (pio-mem-area)' branch present on x86. Yup, we did that from day 1 on powerpc :-) However, I don't totally agree with adding some other remapping layer here, I think

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-28 Thread Benjamin Herrenschmidt
However, in all honesty, we have triggered bugs in that area too, simply because some driver code knew that PIO addresses could fit in 16 bits, and used u16 or unsigned short to remember the PIO address. Both ARM and Sparc was bitten by this, although usually the issue is trivial to fix

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-28 Thread Benjamin Herrenschmidt
We could have done it for interrupts too. A struct irqnum that has a bit that specifies valid. That would work. But it tends to be painful, so it really has to give you something more than zero is disabled. It's just not worth it. And it's why I decreed, that the ONLY SANE THING is to

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-26 Thread Mark Lord
It's not as if people should be pulling 'raw' IRQ numbers out of a hat or even module parameters these days, except for ISA drivers.. Err.. in the embedded space, this is exceptionally common today, on the most modern of chips, too. Lots of magic hard(ware)-coded IRQ numbers. Cheers - To

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-26 Thread Mark Lord
(Yeah, mmap() has taught some people about MAP_FAIL, but that's pretty unusual too. It's so unusual, that I regularly find buggy code checking for NULL instead of MAP_FAILED. Just about every program I look at has it wrong in at least one place. Ditto for the result value from wait() -- lots

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-26 Thread Alan
> Also, many ISA-only drivers actually have hardcoded PIO numbers (eg > "0x1f0"). Bad example - 0x1F0 is one of those that leaked into the PCI world as well 8) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-26 Thread David Miller
From: David Woodhouse <[EMAIL PROTECTED]> Date: Fri, 26 Jan 2007 13:09:40 +0800 > My question was about _how_ you think this should be achieved in this > particular case. You didn't like the suggestion that we should put your > new special-case hack into the resource code... where/how _do_ you >

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-26 Thread David Miller
From: Linus Torvalds <[EMAIL PROTECTED]> Date: Thu, 25 Jan 2007 22:18:21 -0800 (PST) > So on sparc64, "ioport_resource" really is just a container for the actual > per-domain resource buckets that the hardware (within that domain) will > then do the resource allocation from. Afaik. > > But you

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-26 Thread David Miller
From: Linus Torvalds [EMAIL PROTECTED] Date: Thu, 25 Jan 2007 22:18:21 -0800 (PST) So on sparc64, ioport_resource really is just a container for the actual per-domain resource buckets that the hardware (within that domain) will then do the resource allocation from. Afaik. But you should

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-26 Thread David Miller
From: David Woodhouse [EMAIL PROTECTED] Date: Fri, 26 Jan 2007 13:09:40 +0800 My question was about _how_ you think this should be achieved in this particular case. You didn't like the suggestion that we should put your new special-case hack into the resource code... where/how _do_ you

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-26 Thread Alan
Also, many ISA-only drivers actually have hardcoded PIO numbers (eg 0x1f0). Bad example - 0x1F0 is one of those that leaked into the PCI world as well 8) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-26 Thread Mark Lord
(Yeah, mmap() has taught some people about MAP_FAIL, but that's pretty unusual too. It's so unusual, that I regularly find buggy code checking for NULL instead of MAP_FAILED. Just about every program I look at has it wrong in at least one place. Ditto for the result value from wait() -- lots

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-26 Thread Mark Lord
It's not as if people should be pulling 'raw' IRQ numbers out of a hat or even module parameters these days, except for ISA drivers.. Err.. in the embedded space, this is exceptionally common today, on the most modern of chips, too. Lots of magic hard(ware)-coded IRQ numbers. Cheers - To

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Thu, 25 Jan 2007, Linus Torvalds wrote: > > Have you noticed that the resource-allocation code _already_ never returns > zero on sparc64? Btw, that was a rhetorical question, and I'm not actually sure what the heck sparc64 will _really_ do ;) I picked sparc64 as an example, because I

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Fri, 26 Jan 2007, David Woodhouse wrote: > > My question was about _how_ you think this should be achieved in this > particular case. I already told you. Have you noticed that the resource-allocation code _already_ never returns zero on a PC? Have you noticed that the resource-allocation

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 20:48 -0800, Linus Torvalds wrote: > Irq0 may _exist_. IO Port 0 may _exist_. Virtual address 0 may > _exist_. > > Got it? > > But they ARE NOT VALID THINGS FOR DRIVERS TO WORRY ABOUT. I do understand what you're saying; there's no need to shout. I think it's very

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Jeff Garzik
David Woodhouse wrote: When I eventually get to go home, which will hopefully still be some time this month, I'll give some more coherent thought to the idea of just using a (struct irq_desc *) directly instead of an integer. Then Tejun beat you to it with devres. devres makes all sorts of

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Fri, 26 Jan 2007, David Woodhouse wrote: > > Of course it could, but then again why shouldn't we special-case zero in > _all_ of those use cases, just to make life easier for those poor driver > authors who presumably can't manage to write userspace code using stdin > or open() either.

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 20:00 -0800, Linus Torvalds wrote: > The resource code really is totally agnostic, and you're barking up the > wrong tree there. In many ways, the resource code isn't even about "IO > resources", it could do other things too. Of course it could, but then again why

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Fri, 26 Jan 2007, David Woodhouse wrote: > > It's not just "my laptop", I believe. It's the generic resource code, > which is happy to assign address zero since it's never been taught that > zero is now a special case. If we're not going to ask for the bug I > observed to be fixed -- if

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 18:58 -0800, Linus Torvalds wrote: > And it's why I decreed, that the ONLY SANE THING is to just let people do > the obvious thing: > > if (!dev->irq) > return -ENODEV; > > you don't have to know ANYTHING, and that code just works, and just looks >

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Fri, 26 Jan 2007, David Woodhouse wrote: > > The quality of our drivers is low; I'm fully aware that trying to > improve driver quality is a quixotic task. This is an important point. I actually hold things like the kernel VM layer to _much_ higher standards than I would ever hold a driver

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 17:28 -0800, Linus Torvalds wrote: > > On Fri, 26 Jan 2007, David Woodhouse wrote: > > > > You're thinking of MMIO, while the case we were discussing was PIO. My > > laptop is perfectly happy to assign PIO resources from zero. > > I was indeed thinking MMIO, but I really

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Jeff Garzik
Linus Torvalds wrote: So *if* you use the new "iomap" interfaces, and the new "pci_iomap()" things, that should actually not just allow drivers (like the ATA layer) to share much more code between the PIO and MMIO cases, but it hopefully actually makes it easier for strange architectures to do

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Thu, 25 Jan 2007, Jeff Garzik wrote: > > On sparc64, for example, after I pointed this out to DaveM, he was able to > implement the new iomap interface without the 'if (pio-mem-area)' branch > present on x86. However, in all honesty, we have triggered bugs in that area too, simply because

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Jeff Garzik
Linus Torvalds wrote: On Fri, 26 Jan 2007, David Woodhouse wrote: You're thinking of MMIO, while the case we were discussing was PIO. My laptop is perfectly happy to assign PIO resources from zero. I was indeed thinking MMIO, but I really think it should extend to PIO also. It certainly is

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Fri, 26 Jan 2007, David Woodhouse wrote: > > You're thinking of MMIO, while the case we were discussing was PIO. My > laptop is perfectly happy to assign PIO resources from zero. I was indeed thinking MMIO, but I really think it should extend to PIO also. It certainly is (again) true on

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 09:56 -0800, Linus Torvalds wrote: > Broken architectures that put PCI things at some "PCI physical address > zero" need to map their PCI addresses to something else. It's part of why > we have the whole infrastructure for doing things like > >

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Jeff Garzik
Alan wrote: Fixes bogus accesses to ports 0-15 with a non DMA capable controller. This I think should go in for 2.6.20 applied to #upstream-fixes, but it's a hack based on a misunderstanding. See comments below for further work needed. Arguably it shouldn't be called for PIO commands at

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Thu, 25 Jan 2007, Alan wrote: > > If you want to put your bmdma address at zero then libata-sff won't help > you at the moment, and assumes zero is a safe "not in use" value because > the PCI layer also takes a similar view in places. Indeed. Zero means "not in use". It really is that

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Alan
> > void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc) > > { > > - ata_bmdma_stop(qc); > > + if (qc->ap->ioaddr.bmdma_addr) > > + ata_bmdma_stop(qc); > > } > > But what if the bmdma_addr _is_ zero? Please, let's not allow the "zero > is not a valid number"

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 16:22 +, Russell King wrote: > The zero DMA address is absolutely and totally valid. It might not > correspond with physical address zero on platforms. > > Also, DMA address zero is not the same as NULL. This isn't actually "DMA address" in that context -- it's the

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Russell King
On Thu, Jan 25, 2007 at 11:17:20AM -0500, Jeff Garzik wrote: > David Woodhouse wrote: > >On Thu, 2007-01-25 at 15:09 +, Alan wrote: > >>diff -u --new-file --recursive --exclude-from /usr/src/exclude > >>linux.vanilla-2.6.20-rc4-mm1/drivers/ata/libata-sff.c >

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 11:17 -0500, Jeff Garzik wrote: > Read the code... This test is already widely in use in libata. That doesn't make it correct; it just means it's your fault not Alan's, right? :) -- dwmw2 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Jeff Garzik
David Woodhouse wrote: On Thu, 2007-01-25 at 15:09 +, Alan wrote: diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-rc4-mm1/drivers/ata/libata-sff.c linux-2.6.20-rc4-mm1/drivers/ata/libata-sff.c --- linux.vanilla-2.6.20-rc4-mm1/drivers/ata/libata-sff.c

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 15:09 +, Alan wrote: > > diff -u --new-file --recursive --exclude-from /usr/src/exclude > linux.vanilla-2.6.20-rc4-mm1/drivers/ata/libata-sff.c > linux-2.6.20-rc4-mm1/drivers/ata/libata-sff.c > --- linux.vanilla-2.6.20-rc4-mm1/drivers/ata/libata-sff.c 2007-01-22

[PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Alan
Fixes bogus accesses to ports 0-15 with a non DMA capable controller. This I think should go in for 2.6.20 Arguably it shouldn't be called for PIO commands at all but thats a matter for Jeff to decide Signed-off-by: Alan Cox <[EMAIL PROTECTED]> diff -u --new-file --recursive --exclude-from

[PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Alan
Fixes bogus accesses to ports 0-15 with a non DMA capable controller. This I think should go in for 2.6.20 Arguably it shouldn't be called for PIO commands at all but thats a matter for Jeff to decide Signed-off-by: Alan Cox [EMAIL PROTECTED] diff -u --new-file --recursive --exclude-from

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 15:09 +, Alan wrote: diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-rc4-mm1/drivers/ata/libata-sff.c linux-2.6.20-rc4-mm1/drivers/ata/libata-sff.c --- linux.vanilla-2.6.20-rc4-mm1/drivers/ata/libata-sff.c 2007-01-22

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Jeff Garzik
David Woodhouse wrote: On Thu, 2007-01-25 at 15:09 +, Alan wrote: diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-rc4-mm1/drivers/ata/libata-sff.c linux-2.6.20-rc4-mm1/drivers/ata/libata-sff.c --- linux.vanilla-2.6.20-rc4-mm1/drivers/ata/libata-sff.c

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 11:17 -0500, Jeff Garzik wrote: Read the code... This test is already widely in use in libata. That doesn't make it correct; it just means it's your fault not Alan's, right? :) -- dwmw2 - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Russell King
On Thu, Jan 25, 2007 at 11:17:20AM -0500, Jeff Garzik wrote: David Woodhouse wrote: On Thu, 2007-01-25 at 15:09 +, Alan wrote: diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-rc4-mm1/drivers/ata/libata-sff.c

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 16:22 +, Russell King wrote: The zero DMA address is absolutely and totally valid. It might not correspond with physical address zero on platforms. Also, DMA address zero is not the same as NULL. This isn't actually DMA address in that context -- it's the I/O port

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Alan
void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc) { - ata_bmdma_stop(qc); + if (qc-ap-ioaddr.bmdma_addr) + ata_bmdma_stop(qc); } But what if the bmdma_addr _is_ zero? Please, let's not allow the zero is not a valid number braindamage to spread

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Thu, 25 Jan 2007, Alan wrote: If you want to put your bmdma address at zero then libata-sff won't help you at the moment, and assumes zero is a safe not in use value because the PCI layer also takes a similar view in places. Indeed. Zero means not in use. It really is that simple. And

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 09:56 -0800, Linus Torvalds wrote: Broken architectures that put PCI things at some PCI physical address zero need to map their PCI addresses to something else. It's part of why we have the whole infrastructure for doing things like pcibios_bus_to_resource()

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Fri, 26 Jan 2007, David Woodhouse wrote: You're thinking of MMIO, while the case we were discussing was PIO. My laptop is perfectly happy to assign PIO resources from zero. I was indeed thinking MMIO, but I really think it should extend to PIO also. It certainly is (again) true on PC's,

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Jeff Garzik
Linus Torvalds wrote: On Fri, 26 Jan 2007, David Woodhouse wrote: You're thinking of MMIO, while the case we were discussing was PIO. My laptop is perfectly happy to assign PIO resources from zero. I was indeed thinking MMIO, but I really think it should extend to PIO also. It certainly is

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Thu, 25 Jan 2007, Jeff Garzik wrote: On sparc64, for example, after I pointed this out to DaveM, he was able to implement the new iomap interface without the 'if (pio-mem-area)' branch present on x86. However, in all honesty, we have triggered bugs in that area too, simply because some

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Jeff Garzik
Linus Torvalds wrote: So *if* you use the new iomap interfaces, and the new pci_iomap() things, that should actually not just allow drivers (like the ATA layer) to share much more code between the PIO and MMIO cases, but it hopefully actually makes it easier for strange architectures to do it

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 17:28 -0800, Linus Torvalds wrote: On Fri, 26 Jan 2007, David Woodhouse wrote: You're thinking of MMIO, while the case we were discussing was PIO. My laptop is perfectly happy to assign PIO resources from zero. I was indeed thinking MMIO, but I really think it

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Fri, 26 Jan 2007, David Woodhouse wrote: The quality of our drivers is low; I'm fully aware that trying to improve driver quality is a quixotic task. This is an important point. I actually hold things like the kernel VM layer to _much_ higher standards than I would ever hold a driver

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 18:58 -0800, Linus Torvalds wrote: And it's why I decreed, that the ONLY SANE THING is to just let people do the obvious thing: if (!dev-irq) return -ENODEV; you don't have to know ANYTHING, and that code just works, and just looks obvious.

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Fri, 26 Jan 2007, David Woodhouse wrote: It's not just my laptop, I believe. It's the generic resource code, which is happy to assign address zero since it's never been taught that zero is now a special case. If we're not going to ask for the bug I observed to be fixed -- if we're going

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Jeff Garzik
Alan wrote: Fixes bogus accesses to ports 0-15 with a non DMA capable controller. This I think should go in for 2.6.20 applied to #upstream-fixes, but it's a hack based on a misunderstanding. See comments below for further work needed. Arguably it shouldn't be called for PIO commands at

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 20:00 -0800, Linus Torvalds wrote: The resource code really is totally agnostic, and you're barking up the wrong tree there. In many ways, the resource code isn't even about IO resources, it could do other things too. Of course it could, but then again why shouldn't we

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Fri, 26 Jan 2007, David Woodhouse wrote: Of course it could, but then again why shouldn't we special-case zero in _all_ of those use cases, just to make life easier for those poor driver authors who presumably can't manage to write userspace code using stdin or open() either. You're not

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Jeff Garzik
David Woodhouse wrote: When I eventually get to go home, which will hopefully still be some time this month, I'll give some more coherent thought to the idea of just using a (struct irq_desc *) directly instead of an integer. Then Tejun beat you to it with devres. devres makes all sorts of

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread David Woodhouse
On Thu, 2007-01-25 at 20:48 -0800, Linus Torvalds wrote: Irq0 may _exist_. IO Port 0 may _exist_. Virtual address 0 may _exist_. Got it? But they ARE NOT VALID THINGS FOR DRIVERS TO WORRY ABOUT. I do understand what you're saying; there's no need to shout. I think it's very misguided and

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Fri, 26 Jan 2007, David Woodhouse wrote: My question was about _how_ you think this should be achieved in this particular case. I already told you. Have you noticed that the resource-allocation code _already_ never returns zero on a PC? Have you noticed that the resource-allocation

Re: [PATCH] libata-sff: Don't call bmdma_stop on non DMA capable controllers

2007-01-25 Thread Linus Torvalds
On Thu, 25 Jan 2007, Linus Torvalds wrote: Have you noticed that the resource-allocation code _already_ never returns zero on sparc64? Btw, that was a rhetorical question, and I'm not actually sure what the heck sparc64 will _really_ do ;) I picked sparc64 as an example, because I