From: Jarek Poplawski on
On Tue, Jan 19, 2010 at 03:06:01PM -0500, Michael Breuer wrote:
> On 1/19/2010 2:59 PM, Jarek Poplawski wrote:
> >On Tue, Jan 19, 2010 at 10:47:27AM -0500, Michael Breuer wrote:
> >...
> >>Still get the warning... but now 60 bytes.
> >>Jan 19 10:43:50 mail kernel: ------------[ cut here ]------------
> >>Jan 19 10:43:50 mail kernel: WARNING: at lib/dma-debug.c:902
> >Thanks for trying this.
> >Jarek P.
> NP. Let me know what else I can do to help with this one. Note that
> it seems innocuous. I'll continue with the older set and no dmar for
> now and see if I get another crash.

I'll try to look at it more. Since, as you predicted, this might be
connected with dmar problems, it needs some ideas for debugging/fixing
and until this time you could give it a rest from crashing.

Jarek P.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Jarek Poplawski on
On Tue, Jan 19, 2010 at 03:06:01PM -0500, Michael Breuer wrote:
> On 1/19/2010 2:59 PM, Jarek Poplawski wrote:
> >On Tue, Jan 19, 2010 at 10:47:27AM -0500, Michael Breuer wrote:
> >...
> >>Still get the warning... but now 60 bytes.
> >>Jan 19 10:43:50 mail kernel: ------------[ cut here ]------------
> >>Jan 19 10:43:50 mail kernel: WARNING: at lib/dma-debug.c:902
> >Thanks for trying this.
> >Jarek P.
> NP. Let me know what else I can do to help with this one. Note that
> it seems innocuous. I'll continue with the older set and no dmar for
> now and see if I get another crash.

Maybe one more idea to try (not compiled).

Jarek P.
---

drivers/net/sky2.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 7650f73..cdebdd3 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -2252,12 +2252,14 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2,
skb = netdev_alloc_skb_ip_align(sky2->netdev, length);
if (likely(skb)) {
pci_dma_sync_single_for_cpu(sky2->hw->pdev, re->data_addr,
- length, PCI_DMA_FROMDEVICE);
+ pci_unmap_len(re, data_size),
+ PCI_DMA_FROMDEVICE);
skb_copy_from_linear_data(re->skb, skb->data, length);
skb->ip_summed = re->skb->ip_summed;
skb->csum = re->skb->csum;
pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr,
- length, PCI_DMA_FROMDEVICE);
+ pci_unmap_len(re, data_size),
+ PCI_DMA_FROMDEVICE);
re->skb->ip_summed = CHECKSUM_NONE;
skb_put(skb, length);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Michael Breuer on
On 1/19/2010 5:45 PM, Jarek Poplawski wrote:
> On Tue, Jan 19, 2010 at 03:06:01PM -0500, Michael Breuer wrote:
>
>> On 1/19/2010 2:59 PM, Jarek Poplawski wrote:
>>
>>> On Tue, Jan 19, 2010 at 10:47:27AM -0500, Michael Breuer wrote:
>>> ...
>>>
>>>> Still get the warning... but now 60 bytes.
>>>> Jan 19 10:43:50 mail kernel: ------------[ cut here ]------------
>>>> Jan 19 10:43:50 mail kernel: WARNING: at lib/dma-debug.c:902
>>>>
>>> Thanks for trying this.
>>> Jarek P.
>>>
>> NP. Let me know what else I can do to help with this one. Note that
>> it seems innocuous. I'll continue with the older set and no dmar for
>> now and see if I get another crash.
>>
> Maybe one more idea to try (not compiled).
>
> Jarek P.
> ---
>
> drivers/net/sky2.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
> index 7650f73..cdebdd3 100644
> --- a/drivers/net/sky2.c
> +++ b/drivers/net/sky2.c
> @@ -2252,12 +2252,14 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2,
> skb = netdev_alloc_skb_ip_align(sky2->netdev, length);
> if (likely(skb)) {
> pci_dma_sync_single_for_cpu(sky2->hw->pdev, re->data_addr,
> - length, PCI_DMA_FROMDEVICE);
> + pci_unmap_len(re, data_size),
> + PCI_DMA_FROMDEVICE);
> skb_copy_from_linear_data(re->skb, skb->data, length);
> skb->ip_summed = re->skb->ip_summed;
> skb->csum = re->skb->csum;
> pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr,
> - length, PCI_DMA_FROMDEVICE);
> + pci_unmap_len(re, data_size),
> + PCI_DMA_FROMDEVICE);
> re->skb->ip_summed = CHECKSUM_NONE;
> skb_put(skb, length);
> }
>
That not only compiled, but it cleared the error as well. Additionally,
I used to see a bit of a delay receiving the login prompt when first
connecting to the box by ssh. That delay is gone with this patch. I'd
guess that the warning wasn't quite as innocuous as I thought.
Note: tested on 2.6.32.4. I'll leave this up for a bit before
attempting to move back to head.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Stephen Hemminger on
On Tue, 19 Jan 2010 20:01:10 -0500
Michael Breuer <mbreuer(a)majjas.com> wrote:

> On 1/19/2010 5:45 PM, Jarek Poplawski wrote:
> > On Tue, Jan 19, 2010 at 03:06:01PM -0500, Michael Breuer wrote:
> >
> >> On 1/19/2010 2:59 PM, Jarek Poplawski wrote:
> >>
> >>> On Tue, Jan 19, 2010 at 10:47:27AM -0500, Michael Breuer wrote:
> >>> ...
> >>>
> >>>> Still get the warning... but now 60 bytes.
> >>>> Jan 19 10:43:50 mail kernel: ------------[ cut here ]------------
> >>>> Jan 19 10:43:50 mail kernel: WARNING: at lib/dma-debug.c:902
> >>>>
> >>> Thanks for trying this.
> >>> Jarek P.
> >>>
> >> NP. Let me know what else I can do to help with this one. Note that
> >> it seems innocuous. I'll continue with the older set and no dmar for
> >> now and see if I get another crash.
> >>
> > Maybe one more idea to try (not compiled).
> >
> > Jarek P.
> > ---
> >
> > drivers/net/sky2.c | 6 ++++--
> > 1 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
> > index 7650f73..cdebdd3 100644
> > --- a/drivers/net/sky2.c
> > +++ b/drivers/net/sky2.c
> > @@ -2252,12 +2252,14 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2,
> > skb = netdev_alloc_skb_ip_align(sky2->netdev, length);
> > if (likely(skb)) {
> > pci_dma_sync_single_for_cpu(sky2->hw->pdev, re->data_addr,
> > - length, PCI_DMA_FROMDEVICE);
> > + pci_unmap_len(re, data_size),
> > + PCI_DMA_FROMDEVICE);
> > skb_copy_from_linear_data(re->skb, skb->data, length);
> > skb->ip_summed = re->skb->ip_summed;
> > skb->csum = re->skb->csum;
> > pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr,
> > - length, PCI_DMA_FROMDEVICE);
> > + pci_unmap_len(re, data_size),
> > + PCI_DMA_FROMDEVICE);
> > re->skb->ip_summed = CHECKSUM_NONE;
> > skb_put(skb, length);
> > }
> >
> That not only compiled, but it cleared the error as well. Additionally,
> I used to see a bit of a delay receiving the login prompt when first
> connecting to the box by ssh. That delay is gone with this patch. I'd
> guess that the warning wasn't quite as innocuous as I thought.
> Note: tested on 2.6.32.4. I'll leave this up for a bit before
> attempting to move back to head.

Seems like an underlying bug in the DMA api. Maybe it just can't
handle operations on partial mapping.

Other drivers with same problem:
bnx2, cassini, pcnet32, r8169, rrunner, skge, sungem, tg3,



--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Stefan Richter on
Stephen Hemminger wrote:
> On Tue, 19 Jan 2010 20:01:10 -0500
> Michael Breuer <mbreuer(a)majjas.com> wrote:
>> On 1/19/2010 5:45 PM, Jarek Poplawski wrote:
[...]
>> > --- a/drivers/net/sky2.c
>> > +++ b/drivers/net/sky2.c
>> > @@ -2252,12 +2252,14 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2,
>> > skb = netdev_alloc_skb_ip_align(sky2->netdev, length);
>> > if (likely(skb)) {
>> > pci_dma_sync_single_for_cpu(sky2->hw->pdev, re->data_addr,
>> > - length, PCI_DMA_FROMDEVICE);
>> > + pci_unmap_len(re, data_size),
>> > + PCI_DMA_FROMDEVICE);
>> > skb_copy_from_linear_data(re->skb, skb->data, length);
>> > skb->ip_summed = re->skb->ip_summed;
>> > skb->csum = re->skb->csum;
>> > pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr,
>> > - length, PCI_DMA_FROMDEVICE);
>> > + pci_unmap_len(re, data_size),
>> > + PCI_DMA_FROMDEVICE);
>> > re->skb->ip_summed = CHECKSUM_NONE;
>> > skb_put(skb, length);
>> > }
>> >
>> That not only compiled, but it cleared the error as well. Additionally,
>> I used to see a bit of a delay receiving the login prompt when first
>> connecting to the box by ssh. That delay is gone with this patch. I'd
>> guess that the warning wasn't quite as innocuous as I thought.
>> Note: tested on 2.6.32.4. I'll leave this up for a bit before
>> attempting to move back to head.
>
> Seems like an underlying bug in the DMA api. Maybe it just can't
> handle operations on partial mapping.
>
> Other drivers with same problem:
> bnx2, cassini, pcnet32, r8169, rrunner, skge, sungem, tg3,

I didn't read the start of this thread and may misunderstand the issue,
but I comment anyway...:

Documentation/DMA-API.txt says the following about (pci_)dma_sync_single
and friends: "All the parameters must be the same as those passed into
the single mapping API."
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/DMA-API.txt;h=5aceb88b3f8b622c8c23ed288f37f42de705c904;hb=HEAD#l367

So, it might be considered an API bug --- but it is a documented one. :-)
--
Stefan Richter
-=====-==-=- ---= =-=-=
http://arcgraph.de/sr/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/