All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Sander Eikelenboom <linux@eikelenboom.it>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: xen-swiotlb
Date: Mon, 16 Aug 2010 10:43:53 -0400	[thread overview]
Message-ID: <20100816144353.GB29351@phenom.dumpdata.com> (raw)
In-Reply-To: <1045449371.20100815232839@eikelenboom.it>

On Sun, Aug 15, 2010 at 11:28:39PM +0200, Sander Eikelenboom wrote:
> Hi Konrad,
> 
> After i have exhausted all kernel debug options without getting a pointer to my freezes, i have added some printk's to all functions in swiotlb-xen.c
> I see a lot of calls to xen_swiotlb_dma_mapping_error, which doesn't seem to be good ?

The driver looks to be actually testing the value, which is great. Some
of the older drivers (r8169) don't even do that.
> 
> Although all the errors the device works fine (grabs video), but eventually the machine freezes, probably due to overwriting some mem it shouldn't.

Looking at the output, the physical addresses that DMA-ed are:

0x1f2962dc0
0x1f24f2e68

and they look to be called quite often. In fact, there looks to be a
loop that does something like this:

again:
  p = kmalloc(..)

  dma = pci_map_single(p)
  pci_dma_mapping_error(dma);
  /* get some data.. */
  /* parse the: (pipe 0x80000280): IN:  c0 00 00 00 0c 00 01 00 */
  pci_unmap_sg(dma);
  goto again;

As the virtual address sent to pci_map_single looks to be sequentially
increasing.

It might be:
 a). the pci_dma_mapping_error is used incorrectly, ie, it is used
     as !pci_dma_mapping_error,  but I doubt that - the Linux kernel
     has soo many exampples of how to proper use that.
 b). The pci_dma_mapping_error implementation in Xen-SWIOTLB is busted,
     but I can't see how. The logic is basically 'return !addr' so, if
     you have addr = 0xf200000', you will get 0, which is the proper
     return value.
 c). the xhci driver does something similar to the pseudo-code I've
     pointed out. It is missing a kfree somewhere.

Can you point me to the git tree for the xhci and I can take a look
there? Also could you send me yor debug patch - that will help in
finding the culprit.

  reply	other threads:[~2010-08-16 14:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-15 21:28 xen-swiotlb Sander Eikelenboom
2010-08-16 14:43 ` Konrad Rzeszutek Wilk [this message]
2010-08-16 19:32   ` xen-swiotlb Sander Eikelenboom
2010-08-26 21:43     ` xen-swiotlb Konrad Rzeszutek Wilk
2010-08-27  6:46       ` xen-swiotlb Pasi Kärkkäinen
2010-08-27 14:19         ` Konrad Rzeszutek Wilk
2010-08-27 14:32           ` Pasi Kärkkäinen
2010-09-13  6:59             ` Sander Eikelenboom
2010-09-13  6:57       ` xen-swiotlb Sander Eikelenboom
2010-09-19 13:14       ` xen-swiotlb Sander Eikelenboom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100816144353.GB29351@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=linux@eikelenboom.it \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.