Unable to schedue bottom halve

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

 



hi,
    am writing a network driver with USB interface on Linux 2.6. The approach i have in receiving and transmitting the packets is like this :
 
In the probe function i create a work queue using the API create_workqueue. and then i initialize it with INIT_WORK API.
i register a callback handler with the USB subsystem for transmit and receive.I use endpoint 1 for this. to register handler i use usb_submit_urb API. with my handler as an argument and flags GFP_ATOMIC. on reception of a packet from this endpoint my rx callback handler is called where i schedule my bottom half. i.e i queue the work using queue_work. also to transmit a packet i register a tx callback. on successful transmission of the urb this callback is called. in this callback i again schedule a bottom half. The basic functionality of this bottom half is to manage a tx and rx packets in a local control block. which is basically a ring buffer kind of buffer. Now my problem is iam successfully able to schedule a bottom half on the rx callback, but on the tx callback it regularly fails to queue the work. initially after loading the module it works fine till about 20 packets are transmitted, later the bottom halves scheduled by the tx callback fail. i tried flushing the queue in the bottom half using flush_workqueue. but this crashes saying .. trying to sleep in the interrupt context !!! whereas the bottom half runs in the context of a kernel thread. any hint of why this scheduling could be failing would be very helpful.
Thank you for ur patient reading.
 
 
Regards
Srinivas

[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