All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCMCIA bug fix
@ 2004-06-29 15:38 Andrey Ulanov
  2004-06-29 15:48 ` Russell King
  0 siblings, 1 reply; 3+ messages in thread
From: Andrey Ulanov @ 2004-06-29 15:38 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 193 bytes --]

I tested with one of ieee1394+usb2.0 PCMCIA adapters. Worked fine.
Without this patch only first device (ieee1394 controller) was
detected.

Please apply.
-- 
with best regards, Andrey Ulanov.

[-- Attachment #2: pcmcia-multi.patch --]
[-- Type: text/plain, Size: 918 bytes --]

--- linux/drivers/pcmcia/cardbus.c.pcmcia	2004-06-29 18:37:27.000000000 +0400
+++ linux/drivers/pcmcia/cardbus.c	2004-06-29 18:39:37.000000000 +0400
@@ -435,12 +435,12 @@
 	pci_readb(&tmp, PCI_HEADER_TYPE, &hdr);
 	fn = 1;
 	if (hdr & 0x80) {
-		do {
-			tmp.devfn = fn;
+		for (i = 0; i < 8; i++) {
+			tmp.devfn = i;
 			if (pci_readw(&tmp, PCI_VENDOR_ID, &v) || !v || v == 0xffff)
-				break;
+				continue;
 			fn++;
-		} while (fn < 8);
+		};
 	}
 	s->functions = fn;
 
@@ -450,11 +450,17 @@
 	memset(c, 0, fn * sizeof(struct cb_config_t));
 
 	irq = s->cap.pci_irq;
-	for (i = 0; i < fn; i++) {
-		struct pci_dev *dev = &c[i].dev;
+	for (i = 0, fn = 0; i < 8; i++) {
+		struct pci_dev *dev = &c[fn].dev;
 		u8 irq_pin;
 		int r;
 
+		tmp.devfn = i;
+		if(pci_readw(&tmp, PCI_VENDOR_ID, &v) || !v || v == 0xffff)
+		    continue;
+
+		fn++;
+
 		dev->bus = bus;
 		dev->sysdata = bus->sysdata;
 		dev->devfn = i;

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

* Re: [PATCH] PCMCIA bug fix
  2004-06-29 15:38 [PATCH] PCMCIA bug fix Andrey Ulanov
@ 2004-06-29 15:48 ` Russell King
  2004-06-30  5:39   ` Andrey Ulanov
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King @ 2004-06-29 15:48 UTC (permalink / raw)
  To: Andrey Ulanov; +Cc: linux-kernel

On Tue, Jun 29, 2004 at 07:38:09PM +0400, Andrey Ulanov wrote:
> I tested with one of ieee1394+usb2.0 PCMCIA adapters. Worked fine.
> Without this patch only first device (ieee1394 controller) was
> detected.

Can you provide the lspci output, and a better description of the
problem you're trying to solve please?

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

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

* Re: [PATCH] PCMCIA bug fix
  2004-06-29 15:48 ` Russell King
@ 2004-06-30  5:39   ` Andrey Ulanov
  0 siblings, 0 replies; 3+ messages in thread
From: Andrey Ulanov @ 2004-06-30  5:39 UTC (permalink / raw)
  To: Russell King; +Cc: linux-kernel

Hi, Russell!

On Tue, Jun 29, 2004 at 04:48:32PM +0100, Russell King wrote:
> On Tue, Jun 29, 2004 at 07:38:09PM +0400, Andrey Ulanov wrote:
>> I tested with one of ieee1394+usb2.0 PCMCIA adapters. Worked fine.
>> Without this patch only first device (ieee1394 controller) was
>> detected.
> Can you provide the lspci output, and a better description of the
> problem you're trying to solve please?

OK. Sorry.

This PCMCIA has four devices:

  Bus  6, device   0, function  0:
    Class 0c00: PCI device 104c:8024 (rev 0).
      IRQ 10.
      Master Capable.  Latency=16.  
      Non-prefetchable 32 bit memory at 0x11000000 [0x110007ff].
      Non-prefetchable 32 bit memory at 0x11004000 [0x11007fff].
  Bus  6, device   0, function  4:
    Class 0c03: PCI device 104c:0035 (rev 67).
      IRQ 10.
      Master Capable.  Latency=64.  
      Non-prefetchable 32 bit memory at 0x11001000 [0x11001fff].
  Bus  6, device   0, function  5:
    Class 0c03: PCI device 104c:0035 (rev 67).
      IRQ 10.
      Master Capable.  Latency=64.  
      Non-prefetchable 32 bit memory at 0x11002000 [0x11002fff].
  Bus  6, device   0, function  6:
    Class 0c03: PCI device 104c:00e0 (rev 4).
      IRQ 10.
      Master Capable.  Latency=68.  
      Non-prefetchable 32 bit memory at 0x11000800 [0x110008ff].

As you can see functions numbers do not form continual sequence
beginning with zero. That's why current implementation do not work for
me. Here is the part of old code:

fn = 1;
if (hdr & 0x80) {
  do {
    tmp.devfn = fn;
    if (pci_readw(&tmp, PCI_VENDOR_ID, &v) || !v || v == 0xffff)
      break;
    fn++;
  } while (fn < 8);
}
s->functions = fn;

I hope now it is obvious that it detects only first one in my case.

-- 
with best regards, Andrey Ulanov.

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

end of thread, other threads:[~2004-06-30  5:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-29 15:38 [PATCH] PCMCIA bug fix Andrey Ulanov
2004-06-29 15:48 ` Russell King
2004-06-30  5:39   ` Andrey Ulanov

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.