All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vasu Dev <vasu.dev@linux.intel.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: Matthew Wilcox <matthew@wil.cx>, "Zou, Yi" <yi.zou@intel.com>,
	Mike Christie <michaelc@cs.wisc.edu>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	James Bottomley <James.Bottomley@suse.de>,
	"devel@open-fcoe.org" <devel@open-fcoe.org>,
	Christoph Hellwig <hch@lst.de>, Joe Eykholt <jeykholt@cisco.com>,
	Hannes Reinecke <hare@suse.de>
Subject: RE: [Open-FCoE] [RFC PATCH] scsi, fcoe, libfc: drop scsi host_lock use from fc_queuecommand
Date: Fri, 03 Sep 2010 15:38:45 -0700	[thread overview]
Message-ID: <1283553525.30431.192.camel@vi2.jf.intel.com> (raw)
In-Reply-To: <1283456928.5598.117.camel@haakon2.linux-iscsi.org>

On Thu, 2010-09-02 at 12:48 -0700, Nicholas A. Bellinger wrote:
> > Yeah but direct use makes things more obvious at first look. However
> > neatness is worthy using wrapper(macros) if there are several such
> > places. Anycase this is very minor code style thing here and I'm
> fine
> > with wrapper if you want.
> 
> Sure, I am thinking about these simple host_lock wrappers as more of a
> transitional look for LLDs more than anything..
> 
> Btw, I would be happy to include your forthcoming v2 patch into a
> lio-core-2.6.git branch, and give it some testing in the next week.
> 

Awesome, Thanks for your all help Nab,

	I tried to have wrapper instead of checks to drop host_lock before
fc_queuecommand using wrapper something like this :-

+static inline void scsi_qcmd_host_unlock(struct Scsi_Host *shost,
unsigned long irq_flags)
+{
+       if (shost->host_lock_pending) {
+               shost->host_lock_pending = 0;
+               spin_unlock_irqrestore(shost->host_lock, irq_flags);
+       } else if (shost->unlocked_qcmds)
+               spin_unlock_irqrestore(shost->host_lock, irq_flags);
+       else
+               shost->host_lock_pending = 1;
+}
+

This didn't work well beside required lot more checks to track host lock
so that this wrapper can be called w/o checks as:-

	scsi_qcmd_host_unlock(host, flags);
	rtn = host->hostt->queuecommand(cmd, scsi_done);
	scsi_qcmd_host_unlock(host, flags);

I think it is better of with simple checks for now as I posted in my
patch, may be a wrapper can be added in case more places neeeds such
checks as we talked before.

	Thanks
	Vasu 






  reply	other threads:[~2010-09-03 22:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100831225338.25102.59500.stgit@localhost.localdomain>
2010-08-31 23:56 ` [Open-FCoE] [RFC PATCH] scsi, fcoe, libfc: drop scsi host_lock use from fc_queuecommand Nicholas A. Bellinger
2010-09-01  0:16   ` Nicholas A. Bellinger
2010-09-01  4:17   ` Mike Christie
     [not found]     ` <4C7DD3E8.9050700-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
2010-09-01  7:57       ` Zou, Yi
2010-09-01 20:10         ` [Open-FCoE] " Nicholas A. Bellinger
     [not found]           ` <1283371821.32007.636.camel-Y1+j5t8j3WgjMeEPmliV8E/sVC8ogwMJ@public.gmane.org>
2010-09-01 21:06             ` Vasu Dev
2010-09-01 21:38               ` [Open-FCoE] " Nicholas A. Bellinger
2010-09-02 17:24                 ` Vasu Dev
2010-09-02 19:48                   ` Nicholas A. Bellinger
2010-09-03 22:38                     ` Vasu Dev [this message]
     [not found]               ` <1283375187.30431.71.camel-B2RhF0yJhE275v1z/vFq2g@public.gmane.org>
2010-09-01 22:45                 ` Chris Leech
2010-09-01 23:38                   ` [Open-FCoE] " Mike Christie
2010-09-02  1:37                     ` Mike Christie

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=1283553525.30431.192.camel@vi2.jf.intel.com \
    --to=vasu.dev@linux.intel.com \
    --cc=James.Bottomley@suse.de \
    --cc=devel@open-fcoe.org \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=jeykholt@cisco.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=michaelc@cs.wisc.edu \
    --cc=nab@linux-iscsi.org \
    --cc=yi.zou@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.