USB driver query

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

 



I have developed a sample USB mass storage driver. Using this driver,
I can mount file system on my CF card, and can read/write small files
to/from CF card. However, the driver crashes while reading/writing
large files.
>From kernel stack trace, it seems there is some synchronization issue
with interrupts. I see kernel stack something like this:

soft lockup detected on CPU#0

softlockup_tick
update_process_timers
tick_periodic
tick_handle_periodic
smp_apic_timer_interrupt
apic_timer_interrupt
add_to_page_cache
add_to_page_cache_lru
do_generic_mapping_read
file_read_actor
do_sync_read
autoremove_wake_function
__sched_text_start
mutex_lock
vfs_read
copy_to_user
do_sync_read
sys_read
sysenter_past_esp

Looking at the stack trace, it seems, some locking mechanism is
required. I am referring to LDD3 chapter 13 (USB Drivers) and chapter
16 (Block drivers). The driver does USB read/write as follows:

my_request_queue_function
check if request is read or write
allocate and fill urb (using req->sector and req->current_nr_sectors)
submit urb
wait to complete
copy data to req->buffer

during this process, I have not taken any lock. Can someone give some
hint, if some lock is required here?
I do not submit any urb in complete function of usb_fill_bulk_urb. I
am not able to get which other part can be executed in interrupt
context (if I am right, request queue function is not called in
interrupt context).
Any hints would be appreciated.

-Lal

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux