> I'm concerned that this changes a resource that PCMCIA doesn't own,
> i.e., this struct resource actually lives in the pci_dev of an upstream
> bridge or in the host bridge data.

Oh yes, you're right -- my patch was badly broken. Brown paper-bag style.

> > +
> >                     if (res == &ioport_resource)
> >                             continue;
> 
> If you make PCMCIA smart enough to avoid these low ports, do we still
> need these &ioport_resource and &iomem_resource checks?  Having two
> mechanisms will lead to more complicated behavior and more special
> cases.

Well, it aren't only the low ports (<0x100) I'm concerned about, it's also
(and especially on pre-2008 systems) ports in higher areas
(0x100 < x < 0xffff). If we don't use _CRS, we need to be more careful to
avoid accidentally hitting wrong I/O-ports.

> > -                   dev_printk(KERN_INFO, &s->cb_dev->dev,
> > -                              "pcmcia: parent PCI bridge I/O "
> > -                              "window: 0x%llx - 0x%llx\n",
> > -                              (unsigned long long)res->start,
> > -                              (unsigned long long)res->end);
> > +                   dev_info(&s->cb_dev->dev, "pcmcia: parent PCI bridge "
> > +                           "window: %pR\n", res);
> 
> Jesse applied a patch from me to make this %pR change just a few days ago.

Okay, I'll leave that alone then.

Thanks,
        Dominik

From: Dominik Brodowski <[email protected]>
Date: Tue, 23 Mar 2010 16:05:00 +0100
Subject: [PATCH] pcmcia: do not use ioports < 0x100 on x86

On x86 systems using ACPI _CRS information -- now the default for
post-2008 systems -- the PCI root bus no longer pretends to be
offering the root ioport_resource. To avoid accidentally hitting
some platform / system device, use only I/O ports >= 0x100 for
PCMCIA devices on x86.

Reported-by: Komuro <[email protected]>
CC: Bjorn Helgaas <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>

diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 4663b3f..dcc6021 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -810,6 +810,13 @@ static int adjust_io(struct pcmcia_socket *s, unsigned int 
action, unsigned long
        unsigned long size = end - start + 1;
        int ret = 0;
 
+#if defined(CONFIG_X86)
+       /* on x86, avoid anything < 0x100 for it is often used for
+        * legacy platform devices */
+       if (start < 0x100)
+               start = 0x100;
+#endif
+
        if (end < start)
                return -EINVAL;
 

_______________________________________________
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia

Reply via email to