Re: System crashes when usb_free_streams API used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 26, 2010 at 08:59:52PM +0530, Ramya Desai wrote:
> On Sat, Apr 24, 2010 at 8:42 PM, Greg KH <greg@xxxxxxxxx> wrote:
> > On Sat, Apr 24, 2010 at 03:02:57PM +0530, Ramya Desai wrote:
> >> Dear Experts,
> >>
> >> My system crashes when I use the usb_free_streams API in my driver
> >> code. The usb_free_streams API is executed correctly without any
> >> issue, but after some time, around 1 minute, I saw the trace when I
> >> type dmesg. If I comment this API, there is no crash and I am able to
> >> all the operations with my driver. I am using the usb_alloc_streams
> >> API in the driver initialization routine (probe method, when device
> >> inserted) and usb_free_streams API in the driver exit routine (release
> >> method, when device removed).
> >>
> >> I am working on Ubuntu with 2.6.34-rc2 kernel. It also crashes in
> >> 2.6.32 kernel version. I do not understand, why it crashes when I use
> >> the API.
> >>
> >> Any ideas / suggestions are greatly appreciated.
> >
> > Can you duplicate this without the closed source, nvidia driver loaded?
> 
> Dea Greg,
> 
> The driver seems to be working fine and there is no system crash when
> I comment the API named, xhci_free_streams_info(), in the
> xhci_free_streams() routine which is defined in the xhci.c file.

What version of the code are you working with?  My xhci-streams branch
does not have a function named xhci_free_streams_info().

> This
> is because, the same API is called from xhci_free_virt_device()
> routine which is defined in xhci-mem.c file. When it is called twice,
> I saw the following messages (3 times) in the kernel log.

I'm confused.  If xhci_free_virt_device() got to freeing the streams, it
should also set xhci->devs[slot_id] to NULL.  All calls to
xhci_free_virt_device() should be made while holding the xhci->lock.
With that assumption, xhci_free_streams() would exit early after
grabbing the lock and calling xhci_calculate_no_streams_bitmask(), which
will return early when it sees xhci->devs[slot_id] to be NULL.

> xhci_hcd 0000:06:00.0: dma_pool_free xHCI input/output contexts,
> 7269762f/6c617574 (bad dma)
> 
> If I do not call usb_free_streams API, the xhci_free_streams_info() is
> called only one time from the from xhci_free_virt_device() routine.
> This time, I did not see any "bad dma" messages in the kernel log. So,
> I just commented the xhci_free_streams_info() API call in the
> xhci_free_streams() routine. After, commenting this, every thing seems
> to be working fine.
> 
> Please let me know If this is the right way of doing it.

Please update to the latest streams branch and see if you still have
this issue.  If you do, send me a patch that implements your fix
described above.

Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux