mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Stephen Hemminger <stephen@networkplumber.org>, <netdev@vger.kernel.org>
Cc: Mirko Lindner <mlindner@marvell.com>,
	<linux-kernel@vger.kernel.org>,
	Igor Gnatenko <i.gnatenko.brain@gmail.com>
Subject: Re: [REGRESSION][BISECTED] skge: add dma_mapping check
Date: Wed, 18 Sep 2013 16:22:27 +0100	[thread overview]
Message-ID: <1379517747.1522.9.camel@bwh-desktop.uk.level5networks.com> (raw)
In-Reply-To: <1379494844.2294.12.camel@ThinkPad-X230.localdomain>

On Wed, 2013-09-18 at 13:00 +0400, Igor Gnatenko wrote:
> Since 136d8f377e1575463b47840bc5f1b22d94bf8f63 commit we have kernel
> panic on:
[...]

At a first glance, it looks like this bit is wrong:

> @@ -3058,13 +3090,17 @@ static struct sk_buff *skge_rx_get(struct net_device *dev,
>  		if (!nskb)
>  			goto resubmit;
>  
> +		if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) {
> +			dev_kfree_skb(nskb);
> +			goto resubmit;
> +		}
> +
>  		pci_unmap_single(skge->hw->pdev,
>  				 dma_unmap_addr(e, mapaddr),
>  				 dma_unmap_len(e, maplen),
>  				 PCI_DMA_FROMDEVICE);
>  		skb = e->skb;
>  		prefetch(skb->data);
> -		skge_rx_setup(skge, e, nskb, skge->rx_buf_size);
>  	}
>  
>  	skb_put(skb, len);

That pci_unmap_single() appears to unmap the *new*, rather than old, DMA
mapping.  I think you need to copy out the old DMA address and length
before doing skge_rx_setup().

Try it with an IOMMU in strict mode (intel_iommu=on,strict or
amd_iommu=fullflush).

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


  reply	other threads:[~2013-09-18 15:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-18  9:00 Igor Gnatenko
2013-09-18 15:22 ` Ben Hutchings [this message]
2013-09-18 22:08 ` Francois Romieu
2013-09-19  8:18   ` Igor Gnatenko
2013-09-19  9:03   ` Igor Gnatenko
2013-09-24 15:16     ` Joseph Salisbury
2013-09-24 17:50       ` Mikulas Patocka

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=1379517747.1522.9.camel@bwh-desktop.uk.level5networks.com \
    --to=bhutchings@solarflare.com \
    --cc=i.gnatenko.brain@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlindner@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®