[parisc-linux] tulip DMA mapping
Richard Hirst
rhirst@linuxcare.com
Fri, 10 Nov 2000 11:12:20 +0000
I've quoted the whole of Grants message below, so you can see the
context. It looks like tulip is treating zero as meaning it
doesn't have anything to pci_unmap...
Grant Grundler wrote:
> Hi all,
> I see a "bug" in tulip's usage of mapping services.
> It's not the bug I was looking for unfortunately.
>
> In line 217 of drivers/net/tulip/interrupt.c:
>
> if (tp->tx_buffers[entry].mapping)
> pci_unmap_single(tp->pdev,
> tp->tx_buffers[entry].mapping,
> sizeof(tp->setup_frame),
> PCI_DMA_TODEVICE);
>
> 0 is a valid pci_map_single() return value when the system has an IO MMU.
>
> The system will panic before pci_map_single() will fail.
> The driver needs to remember some other way if a buffer was mapped or not.
> Or the Documentation/DMA-mapping.txt should be changed - ie add this
> to the interface definition and I can reserve the 1st mapping
> entry so no-one uses it.
Richard
On Fri, Nov 10, 2000 at 02:16:11AM -0800, David S. Miller wrote:
> Date: Fri, 10 Nov 2000 10:18:08 +0000
> From: Matthew Wilcox <matthew@wil.cx>
>
> > Should I be mailing Jeff Garzik <jgarzik@mandrakesoft.com> directly?
> > Or can someone who knows Jeff point this out to him?
>
> i've cc'd jeff & dave miller on this.
>
> In 2.4.x there is _NO_ error return from the PCI dma functions except
> the consistent DMA mapping ones.
>
> This was an explicit design decision, the dynamic mapping functions
> should never fail, and if they do it is a hard error.
>
> Therefore no drivers need to check for failure, as far as they are
> concerned, there is no failure.
>
> So what is the issue? In 2.5.x I'll add an error return facility
> (BTW: -1 ie. 0xfffffff would probably work as an error value on all
> platforms :-)
>
> Later,
> David S. Miller
> davem@redhat.com
>
> ---------------------------------------------------------------------------
> To unsubscribe: send e-mail to parisc-linux-request@thepuffingroup.com with
> `unsubscribe' as the subject.
>
>