* [PATCH 2.6.13] ide: ide-dma.c should always check hwif->cds before hwif->cds->foo
@ 2005-09-08 15:15 Tom Rini
2005-09-08 15:47 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 3+ messages in thread
From: Tom Rini @ 2005-09-08 15:15 UTC (permalink / raw)
To: Andrew Morton, Kernel Mailing List, Bartlomiej Zolnierkiewicz
Cc: IDE Mailing List
In some cases (such as the mips Toshiba TX4939 w/ onboard IDE, not PCI
IDE), hwif->cds can be NULL, so test that prior to testing
hwif->cds->foo
Signed-off-by: Hiroshi DOYU <hdoyu@mvista.com>
Signed-off-by: Tom Rini <trini@kernel.crashing.org>
Index: linux-2.6/drivers/ide/ide-dma.c
===================================================================
--- linux-2.6.orig/drivers/ide/ide-dma.c
+++ linux-2.6/drivers/ide/ide-dma.c
@@ -846,7 +846,7 @@ static int ide_mapped_mmio_dma(ide_hwif_
printk(KERN_INFO " %s: MMIO-DMA ", hwif->name);
hwif->dma_base = base;
- if (hwif->cds->extra && hwif->channel == 0)
+ if (hwif->cds && hwif->cds->extra && hwif->channel == 0)
hwif->dma_extra = hwif->cds->extra;
if(hwif->mate)
@@ -865,7 +865,7 @@ static int ide_iomio_dma(ide_hwif_t *hwi
return 1;
}
hwif->dma_base = base;
- if ((hwif->cds->extra) && (hwif->channel == 0)) {
+ if (hwif->cds && hwif->cds->extra && (hwif->channel == 0)) {
request_region(base+16, hwif->cds->extra, hwif->cds->name);
hwif->dma_extra = hwif->cds->extra;
}
--
Tom Rini
http://gate.crashing.org/~trini/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2.6.13] ide: ide-dma.c should always check hwif->cds before hwif->cds->foo
2005-09-08 15:15 [PATCH 2.6.13] ide: ide-dma.c should always check hwif->cds before hwif->cds->foo Tom Rini
@ 2005-09-08 15:47 ` Bartlomiej Zolnierkiewicz
2005-09-08 15:56 ` Tom Rini
0 siblings, 1 reply; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2005-09-08 15:47 UTC (permalink / raw)
To: Tom Rini; +Cc: Andrew Morton, Kernel Mailing List, IDE Mailing List
Hi,
On 9/8/05, Tom Rini <trini@kernel.crashing.org> wrote:
> In some cases (such as the mips Toshiba TX4939 w/ onboard IDE, not PCI
> IDE), hwif->cds can be NULL, so test that prior to testing
> hwif->cds->foo
Both ide_iomio_dma() and ide_mapped_mmio_dma() are only called from
ide_dma_iobase(). ide_setup_dma() is the only user of ide_dma_iobase()
and it is supposed to be used only by IDE PCI drivers.
What is the reason for this change?
Bartlomiej
> Signed-off-by: Hiroshi DOYU <hdoyu@mvista.com>
> Signed-off-by: Tom Rini <trini@kernel.crashing.org>
>
> Index: linux-2.6/drivers/ide/ide-dma.c
> ===================================================================
> --- linux-2.6.orig/drivers/ide/ide-dma.c
> +++ linux-2.6/drivers/ide/ide-dma.c
> @@ -846,7 +846,7 @@ static int ide_mapped_mmio_dma(ide_hwif_
> printk(KERN_INFO " %s: MMIO-DMA ", hwif->name);
>
> hwif->dma_base = base;
> - if (hwif->cds->extra && hwif->channel == 0)
> + if (hwif->cds && hwif->cds->extra && hwif->channel == 0)
> hwif->dma_extra = hwif->cds->extra;
>
> if(hwif->mate)
> @@ -865,7 +865,7 @@ static int ide_iomio_dma(ide_hwif_t *hwi
> return 1;
> }
> hwif->dma_base = base;
> - if ((hwif->cds->extra) && (hwif->channel == 0)) {
> + if (hwif->cds && hwif->cds->extra && (hwif->channel == 0)) {
> request_region(base+16, hwif->cds->extra, hwif->cds->name);
> hwif->dma_extra = hwif->cds->extra;
> }
>
> --
> Tom Rini
> http://gate.crashing.org/~trini/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2.6.13] ide: ide-dma.c should always check hwif->cds before hwif->cds->foo
2005-09-08 15:47 ` Bartlomiej Zolnierkiewicz
@ 2005-09-08 15:56 ` Tom Rini
0 siblings, 0 replies; 3+ messages in thread
From: Tom Rini @ 2005-09-08 15:56 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz, Hiroshi DOYU
Cc: Andrew Morton, Kernel Mailing List, IDE Mailing List
On Thu, Sep 08, 2005 at 05:47:38PM +0200, Bartlomiej Zolnierkiewicz wrote:
> On 9/8/05, Tom Rini <trini@kernel.crashing.org> wrote:
> > In some cases (such as the mips Toshiba TX4939 w/ onboard IDE, not PCI
> > IDE), hwif->cds can be NULL, so test that prior to testing
> > hwif->cds->foo
>
> Both ide_iomio_dma() and ide_mapped_mmio_dma() are only called from
> ide_dma_iobase(). ide_setup_dma() is the only user of ide_dma_iobase()
> and it is supposed to be used only by IDE PCI drivers.
>
> What is the reason for this change?
I'll try and explain for Hiroshi DOYU, but the IDE driver for the tx4939
(overall port still need a little bit more review before being sent to
linux-mips, so the ide driver hasn't been submitted yet either) calls
ide_setup_dma(), and has hwif->cds == NULL.
--
Tom Rini
http://gate.crashing.org/~trini/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-09-08 15:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-08 15:15 [PATCH 2.6.13] ide: ide-dma.c should always check hwif->cds before hwif->cds->foo Tom Rini
2005-09-08 15:47 ` Bartlomiej Zolnierkiewicz
2005-09-08 15:56 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.