diff options
author | Michael Buesch <mb@bu3sch.de> | 2009-04-02 20:01:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-04 19:48:17 -0400 |
commit | 5d4d9e8ad6c646c4811bf0049df761dee6affc3d (patch) | |
tree | b27a702da2c0b5219ecb8ea38fde695c209b59bd | |
parent | 4e69489a0ac11a9b62a25923975bfc370a30eae5 (diff) |
b44: Fix sizes passed to b44_sync_dma_desc_for_{device,cpu}()
> > ------------[ cut here ]------------
> > WARNING: at lib/dma-debug.c:539 check_sync+0xe9/0x341() (Not tainted)
> > Hardware name: HP Compaq nx6110 (PY501EA#AB9)
> > b44 0000:02:0e.0: DMA-API: device driver tries to sync DMA memory it has not
> > allocated [device address=0x0000000075941040] [size=1566 bytes]
> > Modules linked in: llc bnep l2cap bluetooth autofs4 lm90 hwmon i2c_i801 sunrpc
> > ipv6 cpufreq_ondemand acpi_cpufreq uinput snd_intel8x0m snd_intel8x0
> > snd_ac97_codec snd_seq_dummy ac97_bus snd_seq_oss snd_seq_midi_event snd_seq
> > snd_seq_device snd_pcm_oss snd_mixer_oss snd_pcm b44 ssb firewire_ohci
> > snd_timer ipw2200 iTCO_wdt mii firewire_core snd iTCO_vendor_support libipw
> > yenta_socket crc_itu_t lib80211 rsrc_nonstatic soundcore snd_page_alloc joydev
> > pcspkr wmi serio_raw ata_generic pata_acpi i915 drm i2c_algo_bit i2c_core video
> > output [last unloaded: scsi_wait_scan]
> > Pid: 2418, comm: S58ntpd Not tainted 2.6.29-16.fc10.i686.PAE #1
> > Call Trace:
> > [<c04396d1>] warn_slowpath+0x7c/0xbd
> > [<c0457fe1>] ? register_lock_class+0x17/0x290
> > [<c0458d61>] ? mark_lock+0x1e/0x349
> > [<c0556448>] ? _raw_spin_unlock+0x74/0x78
> > [<c0458d61>] ? mark_lock+0x1e/0x349
> > [<c055a060>] ? check_sync+0x37/0x341
> > [<c055a112>] check_sync+0xe9/0x341
> > [<c0711245>] ? _spin_unlock_irqrestore+0x45/0x55
> > [<c04592db>] ? trace_hardirqs_on+0xb/0xd
> > [<c055a4d1>] debug_dma_sync_single_for_device+0x2f/0x39
> > [<f828f722>] dma_sync_single_for_device+0x4a/0x59 [b44]
> > [<f828f76f>] ssb_dma_sync_single_for_device+0x3e/0x48 [b44]
> > [<f8291d1e>] b44_recycle_rx+0x18c/0x196 [b44]
> > [<f8291f9f>] b44_poll+0x277/0x3c0 [b44]
> > [<c0687bb9>] net_rx_action+0xa1/0x1ca
> > [<c043e30a>] __do_softirq+0x9d/0x154
> > [<c043e413>] do_softirq+0x52/0x7e
> > [<c043e56f>] irq_exit+0x49/0x77
> > [<c040b22e>] do_IRQ+0x97/0xad
> > [<c0409dac>] common_interrupt+0x2c/0x34
I don't know if this is related, but the following patch seems to fix some DMA
mapping bug. Can somebody comment who does understand the code better than me?
(completely untested)
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/b44.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index 5c84541e0737..95698c6db50f 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
@@ -703,7 +703,7 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) | |||
703 | 703 | ||
704 | if (bp->flags & B44_FLAG_RX_RING_HACK) | 704 | if (bp->flags & B44_FLAG_RX_RING_HACK) |
705 | b44_sync_dma_desc_for_device(bp->sdev, bp->rx_ring_dma, | 705 | b44_sync_dma_desc_for_device(bp->sdev, bp->rx_ring_dma, |
706 | dest_idx * sizeof(dp), | 706 | dest_idx * sizeof(*dp), |
707 | DMA_BIDIRECTIONAL); | 707 | DMA_BIDIRECTIONAL); |
708 | 708 | ||
709 | return RX_PKT_BUF_SZ; | 709 | return RX_PKT_BUF_SZ; |
@@ -731,7 +731,7 @@ static void b44_recycle_rx(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) | |||
731 | 731 | ||
732 | if (bp->flags & B44_FLAG_RX_RING_HACK) | 732 | if (bp->flags & B44_FLAG_RX_RING_HACK) |
733 | b44_sync_dma_desc_for_cpu(bp->sdev, bp->rx_ring_dma, | 733 | b44_sync_dma_desc_for_cpu(bp->sdev, bp->rx_ring_dma, |
734 | src_idx * sizeof(src_desc), | 734 | src_idx * sizeof(*src_desc), |
735 | DMA_BIDIRECTIONAL); | 735 | DMA_BIDIRECTIONAL); |
736 | 736 | ||
737 | ctrl = src_desc->ctrl; | 737 | ctrl = src_desc->ctrl; |
@@ -747,7 +747,7 @@ static void b44_recycle_rx(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) | |||
747 | 747 | ||
748 | if (bp->flags & B44_FLAG_RX_RING_HACK) | 748 | if (bp->flags & B44_FLAG_RX_RING_HACK) |
749 | b44_sync_dma_desc_for_device(bp->sdev, bp->rx_ring_dma, | 749 | b44_sync_dma_desc_for_device(bp->sdev, bp->rx_ring_dma, |
750 | dest_idx * sizeof(dest_desc), | 750 | dest_idx * sizeof(*dest_desc), |
751 | DMA_BIDIRECTIONAL); | 751 | DMA_BIDIRECTIONAL); |
752 | 752 | ||
753 | ssb_dma_sync_single_for_device(bp->sdev, le32_to_cpu(src_desc->addr), | 753 | ssb_dma_sync_single_for_device(bp->sdev, le32_to_cpu(src_desc->addr), |