All of lore.kernel.org
 help / color / mirror / Atom feed
* IDE 2.5.69 possible bogosity...
@ 2003-05-22 22:24 Ian Molton
  2003-05-22 22:52 ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Molton @ 2003-05-22 22:24 UTC (permalink / raw)
  To: linux-kernel

Hi.

Im wondering if this is correct. is the test for initializing in the
second for loop correct?

Im building an IDE driver into my kernel that calls ide_register_hw()
twice to register its primary and secondary ports, but only the
secondary port is recognised. the first fails, since the test in the
first for loop fails and so does the second, so it then 'unregisters'
it, despite never having been registered. somehow, this puts my drive
INTO the hwif array, so the secondary interface registers OK, passing
the other tests.

a hack that allowed the primary interface to register was to register it
twice, but that sucks.

int ide_register_hw (hw_regs_t *hw, ide_hwif_t **hwifp)
{
        int index, retry = 1;
        ide_hwif_t *hwif;

        do {
                for (index = 0; index < MAX_HWIFS; ++index) {
                        hwif = &ide_hwifs[index];
                        if (hwif->hw.io_ports[IDE_DATA_OFFSET] ==
hw->io_ports[IDE_DATA_OFFSET])
                                goto found;
                }
                for (index = 0; index < MAX_HWIFS; ++index) {
                        hwif = &ide_hwifs[index];

*** is the test for initialising (not the !initialising one) here ok?
***

                    if ((!hwif->present && !hwif->mate && !initializing)
||
                        (!hwif->hw.io_ports[IDE_DATA_OFFSET] &&
initializing))
                                goto found;
                }
                for (index = 0; index < MAX_HWIFS; index++)
                        ide_unregister(index);
        } while (retry--);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: IDE 2.5.69 possible bogosity...
  2003-05-22 22:24 IDE 2.5.69 possible bogosity Ian Molton
@ 2003-05-22 22:52 ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2003-05-22 22:52 UTC (permalink / raw)
  To: Ian Molton; +Cc: linux-kernel


On Thu, 22 May 2003, Ian Molton wrote:

> Hi.
>
> Im wondering if this is correct. is the test for initializing in the
> second for loop correct?

Unfortunately, yes.

> Im building an IDE driver into my kernel that calls ide_register_hw()
> twice to register its primary and secondary ports, but only the
> secondary port is recognised. the first fails, since the test in the
> first for loop fails and so does the second, so it then 'unregisters'

Too little information, your MAX_HWIFS and default io ports?

> it, despite never having been registered. somehow, this puts my drive
> INTO the hwif array, so the secondary interface registers OK, passing
> the other tests.

Where is your driver?

> a hack that allowed the primary interface to register was to register it
> twice, but that sucks.
>
> int ide_register_hw (hw_regs_t *hw, ide_hwif_t **hwifp)
> {
>         int index, retry = 1;
>         ide_hwif_t *hwif;
>
>         do {
>                 for (index = 0; index < MAX_HWIFS; ++index) {
>                         hwif = &ide_hwifs[index];
>                         if (hwif->hw.io_ports[IDE_DATA_OFFSET] ==
> hw->io_ports[IDE_DATA_OFFSET])
>                                 goto found;
>                 }
>                 for (index = 0; index < MAX_HWIFS; ++index) {
>                         hwif = &ide_hwifs[index];
>
> *** is the test for initialising (not the !initialising one) here ok?
> ***
>
>                     if ((!hwif->present && !hwif->mate && !initializing)
> ||
>                         (!hwif->hw.io_ports[IDE_DATA_OFFSET] &&
> initializing))
>                                 goto found;
>                 }
>                 for (index = 0; index < MAX_HWIFS; index++)
>                         ide_unregister(index);
>         } while (retry--);



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-22 22:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-22 22:24 IDE 2.5.69 possible bogosity Ian Molton
2003-05-22 22:52 ` Bartlomiej Zolnierkiewicz

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.