lkml.org 
[lkml]   [2007]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [git patches] IDE updates (part 2)
> Comment in pmac_ide_init_hwif_ports() is highly misleading as this function
> returns early only for "normal" IDE PCI devices (pmac_ide_init_hwif_ports()
> can be called outside ide-pmac driver through ppc_ide_md).

Follow the code you pasted

> pmif->regbase = (unsigned long) base + 0x2000;
> ...
> rc = pmac_ide_setup_device(pmif, hwif);

Ok so regbase is set

> ...
> }
>
> static int
> pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
> {
> ...
> pmac_ide_init_hwif_ports(&hwif->hw, pmif->regbase, 0, &hwif->irq);

Now we pass a honking great zero for the ctrl_port
> ...
> }
>
> void
> pmac_ide_init_hwif_ports(hw_regs_t *hw,
> unsigned long data_port, unsigned long ctrl_port,
> int *irq)
> {
> ...
> for (ix = 0; ix < MAX_HWIFS; ++ix)
> if (data_port == pmac_ide[ix].regbase)
> break;
> ---> since pmif->regbase was set earlier ix will be < MAX_HWIFS

> if (ix >= MAX_HWIFS) {
> /* Probably a PCI interface... */
> for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; ++i)
> hw->io_ports[i] = data_port + i - IDE_DATA_OFFSET;
> hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;

Which is zero..


See the problem ?

Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-10-13 23:45    [W:0.054 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site