Re: [RFC] disable PCIE 'Enable No Snoop' bit by default



On Thu, 2007-09-06 at 05:57 -0600, Matthew Wilcox wrote:
On Thu, Sep 06, 2007 at 01:35:08PM +0800, Shaohua Li wrote:
PCIE 'Enable No Snoop' bit is set by default per PCIE spec, but OS
assumes PCI DMA is snooped, which is legacy PCI device does. Enabling no
snoop might cause potential DMA issues. This patch disables it, if a
driver can work with no snoop, we can provide a helper to enable it.

I'm not sure your analysis is correct. Here's what my draft copy of
the pcie 2.0 spec says:

Enble No Snoop ­ If this bit is Set, the Function is permitted to
Set the No Snoop bit in the Requester Attributes of transactions it
initiates that do not require hardware enforced cache coherency (see
Section 2.2.6.5). Note that setting this bit to 1b should not cause
a Function to Set the No Snoop attribute on all transactions that it
initiates. Even when this bit is Set, a Function is only permitted
to Set the No Snoop attribute on a transaction when it can guarantee
that the address of the transaction is not stored in any cache in
the system. This bit permitted to be hardwired to 0b if a Function
would never Set the No Snoop attribute in transactions it initiates.
Default value of this bit is 1b.

That implies that devices are only allowed to set it when it's safe to
do so ... and we don't need to turn it off.
Yes, I saw this in spec too. Devices don't know how OS handle DMA, so
it's possible the bit is wrongly set. My point is setting the bit can be
done by driver based. If a driver thinks it's really safe to do so, it
can set the bit.

Thanks,
Shaohua
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Danis 183 driver
    ... I read the question to your response about using this on the install ... driver on the install diskette for OS/2? ... don't you have to change the Snoop List in the floppy ... Those devices that don't conform to the PCI specification need to have ...
    (comp.os.os2.apps)
  • Re: [PATCH] tty_ioctl: Soft carrier handling
    ... core code. ... One or two drivers still needed to snoop these functions to ... Instead make TIOCSSOFTCAR generate the same ... driver calls as other termios ioctls changing the clocal flag. ...
    (Linux-Kernel)
  • Re: [PATCH] tty_ioctl: Soft carrier handling
    ... One or two drivers still needed to snoop these functions to ... Instead make TIOCSSOFTCAR generate the same ... driver calls as other termios ioctls changing the clocal flag. ...
    (Linux-Kernel)
  • Re: [PATCH] PCI: Add pci shutdown ability
    ... >> spin with irqs off for a couple of seconds so the DMA and IRQs stop. ... > This is the main reason the longhaul cpufreq driver is currently busted. ... ->start - begins transactions ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: [RFC] disable PCIE Enable No Snoop bit by default
    ... Enble No Snoop? ... Set the No Snoop bit in the Requester Attributes of transactions it ... initiates that do not require hardware enforced cache coherency (see ...
    (Linux-Kernel)