* PATCH: Add fixup functionality to the PCI drivers
@ 2004-11-05 16:40 Alan Cox
2004-11-05 22:13 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2004-11-05 16:40 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz, linux-ide
Using the ->fixup field that was added we propogate the fixup
functionality into PCI interfaces. The fixup needs to be in the data
structure really as interfaces may be hotplugged/unplugged [plugged only
in base kernel].
The PCI interfaces stay the same so no driver changes are needed except
to use the fixup hook.
diff --exclude-from /usr/src/exclude -u --new-file --recursive linux.vanilla-2.6.10rc1/drivers/ide/setup-pci.c linux-2.6.10rc1/drivers/ide/setup-pci.c
--- linux.vanilla-2.6.10rc1/drivers/ide/setup-pci.c 2004-11-05 15:34:46.000000000 +0000
+++ linux-2.6.10rc1/drivers/ide/setup-pci.c 2004-11-05 16:27:33.000000000 +0000
@@ -729,14 +729,26 @@
return index;
}
+/**
+ * probe_pci_hwif_init - probe the hwif then allow fixups
+ * @hwif: interface to probe
+ * @d: PCI device
+ *
+ * Perform the generic probe and if it is successful invoke any
+ * remaining post probe fixup logic in the driver itself.
+ */
+static void probe_pci_hwif_init(ide_hwif_t *hwif, ide_pci_device_t *d) {
+ probe_hwif_init_with_fixup(hwif, d->fixup);
+}
+
void ide_setup_pci_device (struct pci_dev *dev, ide_pci_device_t *d)
{
ata_index_t index_list = do_ide_setup_pci_device(dev, d, 1);
if ((index_list.b.low & 0xf0) != 0xf0)
- probe_hwif_init(&ide_hwifs[index_list.b.low]);
+ probe_pci_hwif_init(&ide_hwifs[index_list.b.low], d);
if ((index_list.b.high & 0xf0) != 0xf0)
- probe_hwif_init(&ide_hwifs[index_list.b.high]);
+ probe_pci_hwif_init(&ide_hwifs[index_list.b.high], d);
create_proc_ide_interfaces();
}
@@ -749,13 +761,13 @@
ata_index_t index_list2 = do_ide_setup_pci_device(dev2, d, 0);
if ((index_list.b.low & 0xf0) != 0xf0)
- probe_hwif_init(&ide_hwifs[index_list.b.low]);
+ probe_pci_hwif_init(&ide_hwifs[index_list.b.low], d);
if ((index_list.b.high & 0xf0) != 0xf0)
- probe_hwif_init(&ide_hwifs[index_list.b.high]);
+ probe_pci_hwif_init(&ide_hwifs[index_list.b.high], d);
if ((index_list2.b.low & 0xf0) != 0xf0)
- probe_hwif_init(&ide_hwifs[index_list2.b.low]);
+ probe_pci_hwif_init(&ide_hwifs[index_list2.b.low], d);
if ((index_list2.b.high & 0xf0) != 0xf0)
- probe_hwif_init(&ide_hwifs[index_list2.b.high]);
+ probe_pci_hwif_init(&ide_hwifs[index_list2.b.high], d);
create_proc_ide_interfaces();
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Add fixup functionality to the PCI drivers
2004-11-05 16:40 PATCH: Add fixup functionality to the PCI drivers Alan Cox
@ 2004-11-05 22:13 ` Bartlomiej Zolnierkiewicz
2004-11-05 23:29 ` Alan Cox
0 siblings, 1 reply; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-11-05 22:13 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-ide
On Friday 05 November 2004 17:40, Alan Cox wrote:
> Using the ->fixup field that was added we propogate the fixup
> functionality into PCI interfaces. The fixup needs to be in the data
> structure really as interfaces may be hotplugged/unplugged [plugged only
> in base kernel].
> The PCI interfaces stay the same so no driver changes are needed except
> to use the fixup hook.
>
> diff --exclude-from /usr/src/exclude -u --new-file --recursive linux.vanilla-2.6.10rc1/drivers/ide/setup-pci.c linux-2.6.10rc1/drivers/ide/setup-pci.c
> --- linux.vanilla-2.6.10rc1/drivers/ide/setup-pci.c 2004-11-05 15:34:46.000000000 +0000
> +++ linux-2.6.10rc1/drivers/ide/setup-pci.c 2004-11-05 16:27:33.000000000 +0000
> @@ -729,14 +729,26 @@
> return index;
> }
>
> +/**
> + * probe_pci_hwif_init - probe the hwif then allow fixups
> + * @hwif: interface to probe
> + * @d: PCI device
> + *
> + * Perform the generic probe and if it is successful invoke any
> + * remaining post probe fixup logic in the driver itself.
> + */
> +static void probe_pci_hwif_init(ide_hwif_t *hwif, ide_pci_device_t *d) {
> + probe_hwif_init_with_fixup(hwif, d->fixup);
> +}
this wrapper is not needed
> @@ -749,13 +761,13 @@
> ata_index_t index_list2 = do_ide_setup_pci_device(dev2, d, 0);
>
> if ((index_list.b.low & 0xf0) != 0xf0)
> - probe_hwif_init(&ide_hwifs[index_list.b.low]);
> + probe_pci_hwif_init(&ide_hwifs[index_list.b.low], d);
> if ((index_list.b.high & 0xf0) != 0xf0)
> - probe_hwif_init(&ide_hwifs[index_list.b.high]);
> + probe_pci_hwif_init(&ide_hwifs[index_list.b.high], d);
> if ((index_list2.b.low & 0xf0) != 0xf0)
> - probe_hwif_init(&ide_hwifs[index_list2.b.low]);
> + probe_pci_hwif_init(&ide_hwifs[index_list2.b.low], d);
> if ((index_list2.b.high & 0xf0) != 0xf0)
> - probe_hwif_init(&ide_hwifs[index_list2.b.high]);
> + probe_pci_hwif_init(&ide_hwifs[index_list2.b.high], d);
>
> create_proc_ide_interfaces();
> }
this chunk is not needed
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Add fixup functionality to the PCI drivers
2004-11-05 22:13 ` Bartlomiej Zolnierkiewicz
@ 2004-11-05 23:29 ` Alan Cox
2004-11-06 0:44 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2004-11-05 23:29 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide
On Gwe, 2004-11-05 at 22:13, Bartlomiej Zolnierkiewicz wrote:
> > + * Perform the generic probe and if it is successful invoke any
> > + * remaining post probe fixup logic in the driver itself.
> > + */
> > +static void probe_pci_hwif_init(ide_hwif_t *hwif, ide_pci_device_t *d) {
> > + probe_hwif_init_with_fixup(hwif, d->fixup);
> > +}
>
> this wrapper is not needed
True
> > @@ -749,13 +761,13 @@
> > ata_index_t index_list2 = do_ide_setup_pci_device(dev2, d, 0);
> >
> > if ((index_list.b.low & 0xf0) != 0xf0)
> > - probe_hwif_init(&ide_hwifs[index_list.b.low]);
> > + probe_pci_hwif_init(&ide_hwifs[index_list.b.low], d);
> > if ((index_list.b.high & 0xf0) != 0xf0)
> > - probe_hwif_init(&ide_hwifs[index_list.b.high]);
> > + probe_pci_hwif_init(&ide_hwifs[index_list.b.high], d);
> > if ((index_list2.b.low & 0xf0) != 0xf0)
> > - probe_hwif_init(&ide_hwifs[index_list2.b.low]);
> > + probe_pci_hwif_init(&ide_hwifs[index_list2.b.low], d);
> > if ((index_list2.b.high & 0xf0) != 0xf0)
> > - probe_hwif_init(&ide_hwifs[index_list2.b.high]);
> > + probe_pci_hwif_init(&ide_hwifs[index_list2.b.high], d);
> >
> > create_proc_ide_interfaces();
> > }
>
> this chunk is not needed
Disagree. Look more carefully - we always need to pass d so we can pass
d->fixup
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Add fixup functionality to the PCI drivers
2004-11-06 0:44 ` Bartlomiej Zolnierkiewicz
@ 2004-11-05 23:43 ` Alan Cox
2004-11-06 16:05 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2004-11-05 23:43 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide
On Sad, 2004-11-06 at 00:44, Bartlomiej Zolnierkiewicz wrote:
> > > this chunk is not needed
> >
> > Disagree. Look more carefully - we always need to pass d so we can pass
> > d->fixup
>
> siimage is the only user of d->fixup right now,
> it doesn't use ide_setup_pci_devices()
If you think having the two API's differ in whether d->fixup is honoured
is good then I must disagree strongly with your taste in API's - you are
asking for the first person expecting it to work to get burned
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Add fixup functionality to the PCI drivers
2004-11-05 23:29 ` Alan Cox
@ 2004-11-06 0:44 ` Bartlomiej Zolnierkiewicz
2004-11-05 23:43 ` Alan Cox
0 siblings, 1 reply; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-11-06 0:44 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-ide
On Saturday 06 November 2004 00:29, Alan Cox wrote:
> On Gwe, 2004-11-05 at 22:13, Bartlomiej Zolnierkiewicz wrote:
> > > + * Perform the generic probe and if it is successful invoke any
> > > + * remaining post probe fixup logic in the driver itself.
> > > + */
> > > +static void probe_pci_hwif_init(ide_hwif_t *hwif, ide_pci_device_t *d) {
> > > + probe_hwif_init_with_fixup(hwif, d->fixup);
> > > +}
> >
> > this wrapper is not needed
>
> True
>
> > > @@ -749,13 +761,13 @@
> > > ata_index_t index_list2 = do_ide_setup_pci_device(dev2, d, 0);
> > >
> > > if ((index_list.b.low & 0xf0) != 0xf0)
> > > - probe_hwif_init(&ide_hwifs[index_list.b.low]);
> > > + probe_pci_hwif_init(&ide_hwifs[index_list.b.low], d);
> > > if ((index_list.b.high & 0xf0) != 0xf0)
> > > - probe_hwif_init(&ide_hwifs[index_list.b.high]);
> > > + probe_pci_hwif_init(&ide_hwifs[index_list.b.high], d);
> > > if ((index_list2.b.low & 0xf0) != 0xf0)
> > > - probe_hwif_init(&ide_hwifs[index_list2.b.low]);
> > > + probe_pci_hwif_init(&ide_hwifs[index_list2.b.low], d);
> > > if ((index_list2.b.high & 0xf0) != 0xf0)
> > > - probe_hwif_init(&ide_hwifs[index_list2.b.high]);
> > > + probe_pci_hwif_init(&ide_hwifs[index_list2.b.high], d);
> > >
> > > create_proc_ide_interfaces();
> > > }
> >
> > this chunk is not needed
>
> Disagree. Look more carefully - we always need to pass d so we can pass
> d->fixup
siimage is the only user of d->fixup right now,
it doesn't use ide_setup_pci_devices()
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Add fixup functionality to the PCI drivers
2004-11-05 23:43 ` Alan Cox
@ 2004-11-06 16:05 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-11-06 16:05 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-ide
On Fri, 05 Nov 2004 23:43:56 +0000, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> On Sad, 2004-11-06 at 00:44, Bartlomiej Zolnierkiewicz wrote:
> > > > this chunk is not needed
> > >
> > > Disagree. Look more carefully - we always need to pass d so we can pass
> > > d->fixup
> >
> > siimage is the only user of d->fixup right now,
> > it doesn't use ide_setup_pci_devices()
>
> If you think having the two API's differ in whether d->fixup is honoured
> is good then I must disagree strongly with your taste in API's - you are
> asking for the first person expecting it to work to get burned
OK, I agree and I will fix that.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-11-06 16:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-05 16:40 PATCH: Add fixup functionality to the PCI drivers Alan Cox
2004-11-05 22:13 ` Bartlomiej Zolnierkiewicz
2004-11-05 23:29 ` Alan Cox
2004-11-06 0:44 ` Bartlomiej Zolnierkiewicz
2004-11-05 23:43 ` Alan Cox
2004-11-06 16:05 ` Bartlomiej Zolnierkiewicz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).