Bug 13385
Summary: | DMA-API: device driver frees DMA sg list with different entry count [map count=70] [unmap count=26] | ||
---|---|---|---|
Product: | IO/Storage | Reporter: | Nicolas Mailhot (Nicolas.Mailhot) |
Component: | Serial ATA | Assignee: | Jeff Garzik (jgarzik) |
Status: | CLOSED OBSOLETE | ||
Severity: | normal | CC: | alan, hverkuil |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.30-rc7 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
system lspci
dmesg Patch to test dmesg #2 |
Description
Nicolas Mailhot
2009-05-25 21:13:36 UTC
Created attachment 21544 [details]
system lspci
Created attachment 21545 [details]
dmesg
This is: if (ivtv_might_use_dma(s)) { s->sg_handle = pci_map_single(itv->pdev, s->sg_dma, sizeof(struc ... s->dma)) ivtv_stream_sync_for_cpu(s); } Mapped with the type s->dma and handle s->sg_handle then flushed using static inline void ivtv_stream_sync_for_cpu(struct ivtv_stream *s) { if (ivtv_use_dma(s)) pci_dma_sync_single_for_cpu(s->itv->pdev, s->sg_handle, sizeof(struct ivtv_sg_element), PCI_DMA_TODEVICE); } from the code it seems that the buffers may be to or from but the sg handle is always to so try the following patch Created attachment 21731 [details]
Patch to test
Please try this
Created attachment 21739 [details]
dmesg #2
(In reply to comment #4) > Please try this Well, the DMA-API message about ivtv is gone, now I have another one about ahci. ivtv itself works fine ahci 0000:00:1f.2: DMA-API: device driver frees DMA sg list with different entry count [map count=70] [unmap count=26] (see new attached dmesg) WARNING: at lib/dma-debug.c:530 check_unmap+0x3cf/0x519() Hardware name: EP45-DS5 ahci 0000:00:1f.2: DMA-API: device driver frees DMA sg list with different entry count [map count=70] [unmap count=26] Modules linked in: it87 hwmon_vid coretemp hwmon xt_limit xt_TCPMSS ipt_LOG xt_pkttype iptable_mangle ipt_MASQUERADE ipt_REDIRECT xt_owner xt_multiport iptable_nat nf_nat acpi_cpufreq freq_table snd_emu10k1_synth snd_emux_synth snd_seq_virmidi snd_seq_midi_event snd_seq_midi_emul snd_seq tuner_simple tuner_types wm8775 tda9887 tda8290 tuner cx25840 snd_emu10k1 snd_rawmidi snd_ac97_codec ivtv snd_hda_intel snd_hda_codec i2c_algo_bit cx2341x v4l2_common videodev ac97_bus firewire_ohci snd_seq_device v4l1_compat v4l2_compat_ioctl32 firewire_core tveeprom snd_util_mem snd_pcm snd_hwdep ata_generic snd_timer pata_acpi pcspkr i2c_i801 crc_itu_t i2c_core snd soundcore r8169 pata_jmicron iTCO_wdt iTCO_vendor_support mii snd_page_alloc raid1 [last unloaded: scsi_wait_scan] Pid: 0, comm: swapper Not tainted 2.6.30-0.91.rc7.git1.bzko503662.1.fc12.x86_64 #1 Call Trace: <IRQ> [<ffffffff8105b041>] warn_slowpath_common+0x8d/0xbb [<ffffffff8105b0fc>] warn_slowpath_fmt+0x50/0x66 [<ffffffff81250126>] ? get_hash_bucket+0x3b/0x5d [<ffffffff81250f00>] check_unmap+0x3cf/0x519 [<ffffffff81250126>] ? get_hash_bucket+0x3b/0x5d [<ffffffff81251239>] debug_dma_unmap_sg+0x152/0x18c [<ffffffff81087258>] ? register_lock_class+0x2d/0x37e [<ffffffff8133be71>] ata_sg_clean+0xa9/0xfa [<ffffffff8133bf28>] __ata_qc_complete+0x66/0xef [<ffffffff8133c154>] ata_qc_complete+0x1a3/0x1c4 [<ffffffff8133c4f3>] ata_qc_complete_multiple+0xb8/0xe8 [<ffffffff81351c8e>] ? ahci_interrupt+0x5d/0x4be [<ffffffff81352032>] ahci_interrupt+0x401/0x4be [<ffffffff81086d4a>] ? lock_release_holdtime+0x3f/0x147 [<ffffffff810b9644>] handle_IRQ_event+0x62/0x148 [<ffffffff810bbbb4>] handle_edge_irq+0xde/0x13c [<ffffffff81015eac>] handle_irq+0x9a/0xba [<ffffffff814b943b>] ? trace_hardirqs_off_thunk+0x3a/0x3c [<ffffffff810153f6>] do_IRQ+0x6f/0xee [<ffffffff81013a93>] ret_from_intr+0x0/0x16 <EOI> [<ffffffff812c0781>] ? acpi_idle_enter_simple+0x132/0x17a [<ffffffff812c077a>] ? acpi_idle_enter_simple+0x12b/0x17a [<ffffffff813d0335>] ? cpuidle_idle_call+0xa0/0xef [<ffffffff81011f4e>] ? cpu_idle+0xbf/0x10a [<ffffffff814b1bb8>] ? start_secondary+0x211/0x268 ---[ end trace 32a0d5fa6281db13 ]--- Mapped at: [<ffffffff81251502>] debug_dma_map_sg+0x4a/0x135 [<ffffffff8133c38c>] ata_qc_issue+0x217/0x2c6 [<ffffffff81343db2>] __ata_scsi_queuecmd+0x1a2/0x212 [<ffffffff81343ef9>] ata_scsi_queuecmd+0x6d/0xc0 [<ffffffff8131c516>] scsi_dispatch_cmd+0x1c2/0x25f (btw the build is available here if that matters, just added your patch to a regular fedora kernel https://koji.fedoraproject.org/koji/taskinfo?taskID=1392082 ) I will push the ivtv fixes and reassign the rest of this to libata |