Skip to contentSkip to conversation

helper for device list traversal

PATCH Geert Uytterhoeven 2 participants 5 messages Sep 27, 2003 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 8 lines · Linux Kernel Mailing List

ChangeSet 1.1217.10.16, 2003/09/25 12:10:17-05:00, [email protected]

[PATCH] helper for device list traversal

This patch adds shost_for_each_device(). It's used to abstract out scsi_host.my_devices traversal. The next step will be to replace the current simple implementation with one that's fully locked down an reference counted.

Is this what we should use to fix the currently broken list traversal[*] in drivers/scsi/{a2091,gvp11,53c7xx}.c?

Currently ut uses

    struct Scsi_Host *instance;
    for (instance = first_instance; instance &&
	 instance->hostt == xxx_template; instance = instance->next)

bust Scsi_Host.next was removed a while ago...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#2 lore raw
Quoted 2 lines · Geert Uytterhoeven

Is this what we should use to fix the currently broken list traversal[*] in drivers/scsi/{a2091,gvp11,53c7xx}.c?

where does that [*] refere to?

Quoted 7 lines

Currently ut uses

    struct Scsi_Host *instance;
    for (instance = first_instance; instance &&
	 instance->hostt == xxx_template; instance = instance->next)

bust Scsi_Host.next was removed a while ago...

Most users of that construct want to use scsi_lookup_host (if they looked for a specific host struct).

Above patch is for scsi_device list traversal, not Scsi_Host.

#3 lore raw
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · Geert Uytterhoeven

Is this what we should use to fix the currently broken list traversal[*] in drivers/scsi/{a2091,gvp11,53c7xx}.c?

where does that [*] refere to?

To the part below. Sorry, I changed the structure of the mail but forgot to remove the [*].

Quoted 10 lines
Quoted 7 lines

Currently ut uses

    struct Scsi_Host *instance;
    for (instance = first_instance; instance &&
	 instance->hostt == xxx_template; instance = instance->next)

bust Scsi_Host.next was removed a while ago...

Most users of that construct want to use scsi_lookup_host (if they looked for a specific host struct).

The A2091 and GVP-II drivers want to traverse the list of SCSI host adapters in their interrupt handler, to find their Scsi_Host instances and check whether the (shared) interrupt was meant for one of them.

An alternative would be to register the interrupt handler multiple times and use the Scsi_Host instance pointer as the interrupt handler data pointer.

For 53c7xx it's a bit more complex, I don't know anything about its internals.

In all 3 cases, I don't have the hardware...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#4 lore raw
Quoted 6 lines · Geert Uytterhoeven

The A2091 and GVP-II drivers want to traverse the list of SCSI host adapters in their interrupt handler, to find their Scsi_Host instances and check whether the (shared) interrupt was meant for one of them.

An alternative would be to register the interrupt handler multiple times and use the Scsi_Host instance pointer as the interrupt handler data pointer.

Yes, they should do that.

Quoted 1 line

For 53c7xx it's a bit more complex, I don't know anything about its internals.

The occurance in #if 0 code should probably use scsi_lookup_host. process_issue_queue needs to be rewritten to be per-host.

#5 lore raw
In reply to Geert Uytterhoeven
Quoted 13 lines · Geert Uytterhoeven
Quoted 8 lines · Linux Kernel Mailing List

ChangeSet 1.1217.10.16, 2003/09/25 12:10:17-05:00, [email protected]

[PATCH] helper for device list traversal

This patch adds shost_for_each_device(). It's used to abstract out scsi_host.my_devices traversal. The next step will be to replace the current simple implementation with one that's fully locked down an reference counted.

Is this what we should use to fix the currently broken list traversal[*] in drivers/scsi/{a2091,gvp11,53c7xx}.c?

Quoted 7 lines

Currently ut uses

    struct Scsi_Host *instance;
    for (instance = first_instance; instance &&
	 instance->hostt == xxx_template; instance = instance->next)

bust Scsi_Host.next was removed a while ago...

Urgg. This is totally hosed. The drivers should be fixed up to pass the right host to request_irq and the only handle the right one in the isr instead of walking a lits of all hosts of that template..