public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: a_kumar <cable_plug2000@yahoo.com>
To: linux-kernel@vger.kernel.org
Subject: problem with ending requests asynchronously in my block device driver
Date: Sat, 15 Dec 2007 13:07:01 -0800 (PST)	[thread overview]
Message-ID: <14355076.post@talk.nabble.com> (raw)


Hi, 

I've a block device driver which does the following, 

Inside the request function I do something like this: 
request(fn) { 

 while ((req = elv_next_request(q)) != NULL) { 
....................set up the request; 
 spin_unlock_irq(q->queue_lock); 
call the transfer(set_up_req) function; 
spin_lock_irq(q->queue_lock); 
} 
       spin_unlock_irq (q->queue_lock); 
        /* allow callback to execute as it needs the lock!!! */ 
        spin_lock_irq (q->queue_lock); 


} 
and the transfer function calls the scsi_execute_asyn(....) with the
callback function doing the end request. So, the ending of the request is
done like below: 

callback(fn) { 

 spin_lock_irqsave(q->queue_lock, flags); 
        if (!end_that_request_first(set_up_req->req, cmpstatus, 
                        set_up_req->req->nr_sectors)) { 
                add_disk_randomness(...); 
                end_that_request_last(set_up_req->req,0); 
        } 
        spin_unlock_irqrestore(q->queue_lock, flags); 
} 


This code works fine with most of the kernel versions, but fails on some
like , Linux 2.6.18-8.el5-xen 

Please help me to find out where I'm going wrong? 

Thanks in advance for an early reply. 
Anil P. 


-- 
View this message in context: http://www.nabble.com/problem-with-ending-requests-asynchronously-in-my-block-device-driver-tp14355076p14355076.html
Sent from the linux-kernel mailing list archive at Nabble.com.


             reply	other threads:[~2007-12-15 21:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-15 21:07 a_kumar [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-12-17 20:21 problem with ending requests asynchronously in my block device driver cable_plug
2007-12-17 19:50 cable_plug
2007-12-17 15:52 a_kumar
2007-12-15 21:57 a_kumar
2007-12-15 20:52 a_kumar
2007-12-16  9:23 ` Jon Masters

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14355076.post@talk.nabble.com \
    --to=cable_plug2000@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox