With a custom driver, my 16bit PCCARD shows poor performance. I'd like to
know how can I increase the speed. The PCMCIA spec says that IO mode should
reach 7.84MB/s, but I only see 0.18MB/s.

The PcCard under development supports both IO and memory modes. With IO
mode, each read is spaced 2 us apart. The actual read itself only takes
300ns, but there is a gap of no activity on the bus. I presume that this gap
may be the result of the PCMCIA to PCI bridge that's involved.

I have found that I can issue a READ_PORT_ULONG and get the bus to show two
16bit reads that are only ns apart. The next pair again comes only after a
1.7us wait. How can I have that kind of bus turnaround all the time?

What can I do to reduce the time between reads? Is there a way to tune the
PCMCIA driver? Are there a set of CIS tuples that would make a difference?

The saddest part is the fact that on the same PC system, the Linux driver is
able to go 5 to 6 times faster than the Windows driver. The main difference
between the two is the way they setup and perhaps use the PCMCIA bridge. In
either case, we want more performance.

Any help would be greatly appreciated,
Eric

RE: PCMCIA PCCARD Performance by pavel_a

pavel_a
Tue Mar 13 13:07:11 CDT 2007

Do you install your "custom driver" using an INF file?
Are there resource overrides?
Please review the PCCARDConfig options for i/o wait states - maybe
using zero wait states will help.
( INF LogConfig section in the WDK docum)

Regards,
--PA


"EricH" wrote:
> With a custom driver, my 16bit PCCARD shows poor performance. I'd like to
> know how can I increase the speed. The PCMCIA spec says that IO mode should
> reach 7.84MB/s, but I only see 0.18MB/s.
>
> The PcCard under development supports both IO and memory modes. With IO
> mode, each read is spaced 2 us apart. The actual read itself only takes
> 300ns, but there is a gap of no activity on the bus. I presume that this gap
> may be the result of the PCMCIA to PCI bridge that's involved.
>
> I have found that I can issue a READ_PORT_ULONG and get the bus to show two
> 16bit reads that are only ns apart. The next pair again comes only after a
> 1.7us wait. How can I have that kind of bus turnaround all the time?
>
> What can I do to reduce the time between reads? Is there a way to tune the
> PCMCIA driver? Are there a set of CIS tuples that would make a difference?
>
> The saddest part is the fact that on the same PC system, the Linux driver is
> able to go 5 to 6 times faster than the Windows driver. The main difference
> between the two is the way they setup and perhaps use the PCMCIA bridge. In
> either case, we want more performance.
>
> Any help would be greatly appreciated,
> Eric
>
>

RE: PCMCIA PCCARD Performance by EricH

EricH
Tue Mar 13 17:52:10 CDT 2007

Dear Pavel,

I did use an inf file. The original file had a LogConfig section which did
not specify the wait states. The DDK says that a wait state of 1 for IO or 3
for Memory is used as default. When I changed the inf and reinstalled, the
changes did not make a difference.

Here's an exerpt from the new inf:

[al_pcmcia.Dev.LogConfigOverride]
LogConfig = al_pcmcia.Dev.SetResources

[al_pcmcia.Dev.SetResources]
; 256 byte IO Port starting at any address
; Level and Shared IRQ from 3-15
; 12K byte Attribute Memory starting at any address
; 12K byte Common Memory starting at any address
; Set COR to 47; use 16 bit Memory; Zero IO or memory wait states
ConfigPriority = NORMAL
IOConfig = 100@0-FFFFFFFF
IRQConfig = LS:3,4,5,6,7,8,9,10,11,12,13,14,15
MemConfig = 3000@0-FFFFFFFF
MemConfig = 3000@0-FFFFFFFF
PcCardConfig = 47(W AC M XI0 XM0)

After uninstalling the driver. I removed all copies of the inf/pnf file and
re-installed the driver with this new inf. The reads are still 2us apart. A
typical example of the read is as follows:

for(i=0; i<16; i+=2)
READ_PORT_USHORT( pDeviceContext->io_base);

How do I know what the current PcCardConfig string is in effect? Where is
this stored? Perhaps the change did not take.

Eric


"Pavel A." wrote:

> Do you install your "custom driver" using an INF file?
> Are there resource overrides?
> Please review the PCCARDConfig options for i/o wait states - maybe
> using zero wait states will help.
> ( INF LogConfig section in the WDK docum)
>
> Regards,
> --PA
>
>
> "EricH" wrote:
> > With a custom driver, my 16bit PCCARD shows poor performance. I'd like to
> > know how can I increase the speed. The PCMCIA spec says that IO mode should
> > reach 7.84MB/s, but I only see 0.18MB/s.
> >
> > The PcCard under development supports both IO and memory modes. With IO
> > mode, each read is spaced 2 us apart. The actual read itself only takes
> > 300ns, but there is a gap of no activity on the bus. I presume that this gap
> > may be the result of the PCMCIA to PCI bridge that's involved.
> >
> > I have found that I can issue a READ_PORT_ULONG and get the bus to show two
> > 16bit reads that are only ns apart. The next pair again comes only after a
> > 1.7us wait. How can I have that kind of bus turnaround all the time?
> >
> > What can I do to reduce the time between reads? Is there a way to tune the
> > PCMCIA driver? Are there a set of CIS tuples that would make a difference?
> >
> > The saddest part is the fact that on the same PC system, the Linux driver is
> > able to go 5 to 6 times faster than the Windows driver. The main difference
> > between the two is the way they setup and perhaps use the PCMCIA bridge. In
> > either case, we want more performance.
> >
> > Any help would be greatly appreciated,
> > Eric
> >
> >

RE: PCMCIA PCCARD Performance by pavel_a

pavel_a
Wed Mar 14 08:25:33 CDT 2007

Eric, try also Z0 (zero i/o wait states - this is independent from XI0 )

--PA


"EricH" wrote:
> Dear Pavel,
>
> I did use an inf file. The original file had a LogConfig section which did
> not specify the wait states. The DDK says that a wait state of 1 for IO or 3
> for Memory is used as default. When I changed the inf and reinstalled, the
> changes did not make a difference.
>
> Here's an exerpt from the new inf:
>
> [al_pcmcia.Dev.LogConfigOverride]
> LogConfig = al_pcmcia.Dev.SetResources
>
> [al_pcmcia.Dev.SetResources]
> ; 256 byte IO Port starting at any address
> ; Level and Shared IRQ from 3-15
> ; 12K byte Attribute Memory starting at any address
> ; 12K byte Common Memory starting at any address
> ; Set COR to 47; use 16 bit Memory; Zero IO or memory wait states
> ConfigPriority = NORMAL
> IOConfig = 100@0-FFFFFFFF
> IRQConfig = LS:3,4,5,6,7,8,9,10,11,12,13,14,15
> MemConfig = 3000@0-FFFFFFFF
> MemConfig = 3000@0-FFFFFFFF
> PcCardConfig = 47(W AC M XI0 XM0)
>
> After uninstalling the driver. I removed all copies of the inf/pnf file and
> re-installed the driver with this new inf. The reads are still 2us apart. A
> typical example of the read is as follows:
>
> for(i=0; i<16; i+=2)
> READ_PORT_USHORT( pDeviceContext->io_base);
>
> How do I know what the current PcCardConfig string is in effect? Where is
> this stored? Perhaps the change did not take.
>
> Eric
>
>
> "Pavel A." wrote:
>
> > Do you install your "custom driver" using an INF file?
> > Are there resource overrides?
> > Please review the PCCARDConfig options for i/o wait states - maybe
> > using zero wait states will help.
> > ( INF LogConfig section in the WDK docum)
> >
> > Regards,
> > --PA
> >
> >
> > "EricH" wrote:
> > > With a custom driver, my 16bit PCCARD shows poor performance. I'd like to
> > > know how can I increase the speed. The PCMCIA spec says that IO mode should
> > > reach 7.84MB/s, but I only see 0.18MB/s.
> > >
> > > The PcCard under development supports both IO and memory modes. With IO
> > > mode, each read is spaced 2 us apart. The actual read itself only takes
> > > 300ns, but there is a gap of no activity on the bus. I presume that this gap
> > > may be the result of the PCMCIA to PCI bridge that's involved.
> > >
> > > I have found that I can issue a READ_PORT_ULONG and get the bus to show two
> > > 16bit reads that are only ns apart. The next pair again comes only after a
> > > 1.7us wait. How can I have that kind of bus turnaround all the time?
> > >
> > > What can I do to reduce the time between reads? Is there a way to tune the
> > > PCMCIA driver? Are there a set of CIS tuples that would make a difference?
> > >
> > > The saddest part is the fact that on the same PC system, the Linux driver is
> > > able to go 5 to 6 times faster than the Windows driver. The main difference
> > > between the two is the way they setup and perhaps use the PCMCIA bridge. In
> > > either case, we want more performance.
> > >
> > > Any help would be greatly appreciated,
> > > Eric
> > >
> > >

RE: PCMCIA PCCARD Performance by EricH

EricH
Thu Mar 15 13:50:42 CDT 2007

Dear Pavel,

Adding Z0 did not change the fundamental timing between reads. They are
still stuck at 2us. What are other options?

BTW, while trying out the PcCardConfig change you recommended, I did
discover a fundamental problem in my driver. The core algorithm for the
driver comes from another OS platform, and I had made an error during the
port which introduced a 10ms delay between every device transaction. Once
that bug was fixed, I can now demonstrate ~12 Mbps.

But 12 Mbps is still much smaller than the theoretical 7.84MB/s. How can
we remove this last bottleneck?

I tried using a few other devices, such as as CF memory with a PCMCIA 16bit
adapter and a 10/100 Ethernet 16bit adapter. All of these devices used the
stick Windows drivers, and they all showed a 2us delay between reads. They
are not using DMA which my device doesn't support. Could this just be the
actual limit of the bridge chip or is this a limit imposed so the pcmcia.sys
driver works with the widest number of periphreals?

Eric