Re: PCI bus operations and driver design
From: Mark Roddy (markr_at_hollistech.com)
Date: 10/04/04
- Next message: Polaris: "Tools to install a driver ?"
- Previous message: Neptune: "Re: Printing message on boot time"
- In reply to: Dwight Holman: "PCI bus operations and driver design"
- Next in thread: RonM: "Re: PCI bus operations and driver design"
- Reply: RonM: "Re: PCI bus operations and driver design"
- Reply: Dwight Holman: "Re: PCI bus operations and driver design"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 4 Oct 2004 19:36:48 -0400
In article <#$MhvXlqEHA.3760@TK2MSFTNGP09.phx.gbl>,
dwight.holman.SPAM@xtra.co.nz says...
> Yes, this is another question from a newbie :-)
>
> I have been investigating an issue relating to our 'working' PCI
> device driver (part of the product developed by my company). This NT
> device driver uses memory mapped IO to read/write to DPRAM on a PCI card.
>
> The existing code assumes that such writes to this memory (over the
> PCI bus) will always succeed.
>
> Coming from a background including lots of things *other* than writing
> device drivers, I am suspicious that this assumption may not be the
> case... and that writes may sometimes fail.
>
> So, is it possible for a write to memory mapped DPRAM to occasionally
> fail?
>
Yes, but on most platforms these failures are catastrophic and global and not
the concern of individual device drivers. On some platforms you could
experience a 'hot unplug' (aka surprise removal) of your pci device as a result
of such a catastrophic event, so it is a good idea to correctly implement your
surprise removal path and to prevent endless loops in your hardware access
routines. There is a white paper on driver hardening on the microsoft web site.
It was by a certain Simon Graham and it was presented at winhec a few years
back and it covers the basics.
> Can anybody out there share their experience of the possible failure
> scenarios when performing such operations over a PCI bus?
>
> What strategies are required to ensure that writes to such memory
> (over a PCI bus) occur reliably?
It is up to the platform hardware to manage the bus and its reliability, not
your device driver.
>
> I guess the answer is 'it depends', so ok... Lets assume that we must
> either succeed in writing the memory, or know clearly that the
> operation failed.
>
> To me the simple (intuitive) answer is that after writing the memory,
> the driver should read it back to verify the operation worked.
>
Don't do that unless you have gobs of excess bandwidth that you desperately
need to consume :-)
Assume that the transaction succeeded. If it doesn't either the system will
crash (standard PC architecture) or your device will suddenly disappear (high
end HA server platforms.)
-- ===================== Mark Roddy DDK MVP Windows 2003/XP/2000 Consulting Hollis Technology Solutions 603-321-1032 www.hollistech.com markr@hollistech.com
- Next message: Polaris: "Tools to install a driver ?"
- Previous message: Neptune: "Re: Printing message on boot time"
- In reply to: Dwight Holman: "PCI bus operations and driver design"
- Next in thread: RonM: "Re: PCI bus operations and driver design"
- Reply: RonM: "Re: PCI bus operations and driver design"
- Reply: Dwight Holman: "Re: PCI bus operations and driver design"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|