* [PATCH] Incorrect device link for ide-cs
@ 2005-11-03 9:21 Hannes Reinecke
2005-11-03 9:57 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 5+ messages in thread
From: Hannes Reinecke @ 2005-11-03 9:21 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, Linux Kernel, Jens Axboe
[-- Attachment #1: Type: text/plain, Size: 628 bytes --]
Hi Bartlomiej,
I just came across a patch which appearently never made it anywhere near
mainline. It is, however, still valid.
Problem is that devices driven by ide-cs will appear under /sys/devices
instead of the appropriate PCMCIA device. To fix this I had to extend
the hw_regs_t structure with a 'struct device' field, which allows us to
set the parent link for the appropriate hwif.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke hare@suse.de
SuSE Linux Products GmbH S390 & zSeries
Maxfeldstraße 5 +49 911 74053 688
90409 Nürnberg http://www.suse.de
[-- Attachment #2: ide-cs-correct-device-link --]
[-- Type: text/plain, Size: 2340 bytes --]
From: Hannes Reinecke <hare@suse.de>
Subject: Incorrect device link for ide-cs
Devices driven by ide-cs will appear under /sys/devices instead of the
appropriate PCMCIA device. To fix this I had to extend the hw_regs_t
structure with a 'struct device' field, which allows us to set the
parent link for the appropriate hwif.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jens Axboe <axboe@suse.com>
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -803,6 +803,7 @@ found:
hwif->irq = hw->irq;
hwif->noprobe = 0;
hwif->chipset = hw->chipset;
+ hwif->gendev.parent = hw->dev;
if (!initializing) {
probe_hwif_init_with_fixup(hwif, fixup);
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -182,13 +182,14 @@ static void ide_detach(dev_link_t *link)
} /* ide_detach */
-static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq)
+static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle)
{
hw_regs_t hw;
memset(&hw, 0, sizeof(hw));
- ide_init_hwif_ports(&hw, io, ctl, NULL);
+ ide_std_init_ports(&hw, io, ctl);
hw.irq = irq;
hw.chipset = ide_pci;
+ hw.dev = &handle->dev;
return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
}
@@ -328,12 +329,12 @@ static void ide_config(dev_link_t *link)
/* retry registration in case device is still spinning up */
for (hd = -1, i = 0; i < 10; i++) {
- hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ);
+ hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, handle);
if (hd >= 0) break;
if (link->io.NumPorts1 == 0x20) {
outb(0x02, ctl_base + 0x10);
hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
- link->irq.AssignedIRQ);
+ link->irq.AssignedIRQ, handle);
if (hd >= 0) {
io_base += 0x10;
ctl_base += 0x10;
diff --git a/include/linux/ide.h b/include/linux/ide.h
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -230,6 +230,7 @@ typedef struct hw_regs_s {
int dma; /* our dma entry */
ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
hwif_chipset_t chipset;
+ struct device *dev;
} hw_regs_t;
/*
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Incorrect device link for ide-cs
2005-11-03 9:21 [PATCH] Incorrect device link for ide-cs Hannes Reinecke
@ 2005-11-03 9:57 ` Bartlomiej Zolnierkiewicz
2005-11-03 10:21 ` Hannes Reinecke
0 siblings, 1 reply; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2005-11-03 9:57 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: linux-ide, Linux Kernel, Jens Axboe
Hi,
> hw_regs_t hw;
> memset(&hw, 0, sizeof(hw));
> - ide_init_hwif_ports(&hw, io, ctl, NULL);
> + ide_std_init_ports(&hw, io, ctl);
Could you separate this into another patch?
This change fixes ide-cs for some archs but OTOH we should verify that
there are no ide-cs specific hacks in ide_init_hwif_ports() on other archs.
Otherwise patch looks fine.
Thanks,
Bartlomiej
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Incorrect device link for ide-cs
2005-11-03 9:57 ` Bartlomiej Zolnierkiewicz
@ 2005-11-03 10:21 ` Hannes Reinecke
2005-11-03 10:59 ` Bartlomiej Zolnierkiewicz
2005-11-09 21:40 ` Bartlomiej Zolnierkiewicz
0 siblings, 2 replies; 5+ messages in thread
From: Hannes Reinecke @ 2005-11-03 10:21 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, Linux Kernel, Jens Axboe
[-- Attachment #1: Type: text/plain, Size: 971 bytes --]
Bartlomiej Zolnierkiewicz wrote:
> Hi,
>
>> hw_regs_t hw;
>> memset(&hw, 0, sizeof(hw));
>> - ide_init_hwif_ports(&hw, io, ctl, NULL);
>> + ide_std_init_ports(&hw, io, ctl);
>
> Could you separate this into another patch?
>
> This change fixes ide-cs for some archs but OTOH we should verify that
> there are no ide-cs specific hacks in ide_init_hwif_ports() on other archs.
>
Oops, you are correct. The main reason why I did this is this comment in
include/linux/ide.h:
* ide_init_hwif_ports() is OBSOLETE and will be removed in 2.7 series.
Arch specific codes are in:
cris/v10
arm/sa1100
arch-m68knommu
Neither of which is using the irq parameter anyway, so it would make
sense to remove that interface completely.
Updated patch attached.
Cheers,
Hannes
--
Dr. Hannes Reinecke hare@suse.de
SuSE Linux Products GmbH S390 & zSeries
Maxfeldstraße 5 +49 911 74053 688
90409 Nürnberg http://www.suse.de
[-- Attachment #2: ide-cs-correct-device-link --]
[-- Type: text/plain, Size: 2301 bytes --]
From: Hannes Reinecke <hare@suse.de>
Subject: Incorrect device link for ide-cs
Devices driven by ide-cs will appear under /sys/devices instead of the
appropriate PCMCIA device. To fix this I had to extend the hw_regs_t
structure with a 'struct device' field, which allows us to set the
parent link for the appropriate hwif.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jens Axboe <axboe@suse.com>
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -803,6 +803,7 @@ found:
hwif->irq = hw->irq;
hwif->noprobe = 0;
hwif->chipset = hw->chipset;
+ hwif->gendev.parent = hw->dev;
if (!initializing) {
probe_hwif_init_with_fixup(hwif, fixup);
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -182,13 +182,14 @@ static void ide_detach(dev_link_t *link)
} /* ide_detach */
-static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq)
+static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle)
{
hw_regs_t hw;
memset(&hw, 0, sizeof(hw));
ide_init_hwif_ports(&hw, io, ctl, NULL);
hw.irq = irq;
hw.chipset = ide_pci;
+ hw.dev = &handle->dev;
return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
}
@@ -328,12 +329,12 @@ static void ide_config(dev_link_t *link)
/* retry registration in case device is still spinning up */
for (hd = -1, i = 0; i < 10; i++) {
- hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ);
+ hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, handle);
if (hd >= 0) break;
if (link->io.NumPorts1 == 0x20) {
outb(0x02, ctl_base + 0x10);
hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
- link->irq.AssignedIRQ);
+ link->irq.AssignedIRQ, handle);
if (hd >= 0) {
io_base += 0x10;
ctl_base += 0x10;
diff --git a/include/linux/ide.h b/include/linux/ide.h
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -230,6 +230,7 @@ typedef struct hw_regs_s {
int dma; /* our dma entry */
ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
hwif_chipset_t chipset;
+ struct device *dev;
} hw_regs_t;
/*
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Incorrect device link for ide-cs
2005-11-03 10:21 ` Hannes Reinecke
@ 2005-11-03 10:59 ` Bartlomiej Zolnierkiewicz
2005-11-09 21:40 ` Bartlomiej Zolnierkiewicz
1 sibling, 0 replies; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2005-11-03 10:59 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: linux-ide, Linux Kernel, Jens Axboe
On 11/3/05, Hannes Reinecke <hare@suse.de> wrote:
> Bartlomiej Zolnierkiewicz wrote:
> > Hi,
> >
> >> hw_regs_t hw;
> >> memset(&hw, 0, sizeof(hw));
> >> - ide_init_hwif_ports(&hw, io, ctl, NULL);
> >> + ide_std_init_ports(&hw, io, ctl);
> >
> > Could you separate this into another patch?
> >
> > This change fixes ide-cs for some archs but OTOH we should verify that
> > there are no ide-cs specific hacks in ide_init_hwif_ports() on other archs.
> >
> Oops, you are correct. The main reason why I did this is this comment in
> include/linux/ide.h:
> * ide_init_hwif_ports() is OBSOLETE and will be removed in 2.7 series.
>
> Arch specific codes are in:
> cris/v10
> arm/sa1100
> arch-m68knommu
I'm more worried about indirect PPC32 hacks...
...
#ifdef CONFIG_PPC32
if (ppc_ide_md.ide_init_hwif)
ppc_ide_md.ide_init_hwif(hw, io_addr, ctl_addr, irq);
#endif
...
> Neither of which is using the irq parameter anyway, so it would make
> sense to remove that interface completely.
>
> Updated patch attached.
Thanks,
Bartlomiej
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Incorrect device link for ide-cs
2005-11-03 10:21 ` Hannes Reinecke
2005-11-03 10:59 ` Bartlomiej Zolnierkiewicz
@ 2005-11-09 21:40 ` Bartlomiej Zolnierkiewicz
1 sibling, 0 replies; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2005-11-09 21:40 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: linux-ide, Linux Kernel, Jens Axboe
On 11/3/05, Hannes Reinecke <hare@suse.de> wrote:
> Updated patch attached.
applied
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-11-09 21:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-03 9:21 [PATCH] Incorrect device link for ide-cs Hannes Reinecke
2005-11-03 9:57 ` Bartlomiej Zolnierkiewicz
2005-11-03 10:21 ` Hannes Reinecke
2005-11-03 10:59 ` Bartlomiej Zolnierkiewicz
2005-11-09 21:40 ` 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.