From: Juergen Gross <jgross@suse.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-scsi@vger.kernel.org, JBottomley@parallels.com,
xen-devel@lists.xen.org, target-devel@vger.kernel.org,
david.vrabel@citrix.com, JBeulich@suse.com
Subject: Re: [Xen-devel] [PATCH V4 3/4] Introduce XEN scsiback module
Date: Tue, 12 Aug 2014 14:29:48 +0200 [thread overview]
Message-ID: <53EA08BC.90809@suse.com> (raw)
In-Reply-To: <20140811181436.GA14313@infradead.org>
On 08/11/2014 08:14 PM, Christoph Hellwig wrote:
>> +#include <scsi/scsi_dbg.h>
__scsi_print_sense()
>> +#include <scsi/scsi_eh.h>
struct scsi_sense_hdr
>> +#include <scsi/scsi_tcq.h>
SG_ALL
>
> What do you need these for? Normally target drivers shouldn't need
> these.
>
>> +struct vscsibk_emulate {
>> + void (*pre_function)(struct vscsibk_pend *, void *);
>> + void (*post_function)(struct vscsibk_pend *, void *);
>> +};
>
> This doesn't seem to be used.
Correct. Will delete.
>
>> +#define scsiback_get(_b) (atomic_inc(&(_b)->nr_unreplied_reqs))
>> +#define scsiback_put(_b) \
>> + do { \
>> + if (atomic_dec_and_test(&(_b)->nr_unreplied_reqs)) \
>> + wake_up(&(_b)->waiting_to_free);\
>> + } while (0)
>
> Normal Linux style would be to make these inline functions.
Okay. I'll change those.
>
>> +static void scsiback_notify_work(struct vscsibk_info *info)
>> +{
>> + info->waiting_reqs = 1;
>> + wake_up(&info->wq);
>> +}
>> +
>> +static irqreturn_t scsiback_intr(int irq, void *dev_id)
>> +{
>> + scsiback_notify_work((struct vscsibk_info *)dev_id);
>> + return IRQ_HANDLED;
>> +}
>
> Seems like this driver should get the same threaded irq treatment as
> the initiator side?
Indeed.
>
>> +static void scsiback_disconnect(struct vscsibk_info *info)
>> +{
>> + if (info->kthread) {
>> + kthread_stop(info->kthread);
>> + info->kthread = NULL;
>> + wake_up(&info->shutdown_wq);
>> + }
>> +
>> + wait_event(info->waiting_to_free,
>> + atomic_read(&info->nr_unreplied_reqs) == 0);
>> +
>> + if (info->irq) {
>> + unbind_from_irqhandler(info->irq, info);
>> + info->irq = 0;
>> + }
>> +
>> + if (info->ring.sring) {
>> + xenbus_unmap_ring_vfree(info->dev, info->ring.sring);
>> + info->ring.sring = NULL;
>> + }
>> +}
>
> Also the same treatment for goto based init failure unwinding.
Yep.
Juergen
next prev parent reply other threads:[~2014-08-12 12:29 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-08 7:49 Add XEN pvSCSI support jgross
2014-08-08 7:49 ` [PATCH V4 1/4] Add XEN pvSCSI protocol description jgross
2014-08-08 7:49 ` jgross
2014-08-08 7:49 ` [PATCH V4 2/4] Introduce xen-scsifront module jgross
2014-08-08 7:49 ` jgross
2014-08-11 9:54 ` Christoph Hellwig
2014-08-11 10:27 ` [Xen-devel] " Juergen Gross
2014-08-11 17:50 ` Christoph Hellwig
2014-08-12 11:32 ` Juergen Gross
2014-08-12 11:32 ` [Xen-devel] " Juergen Gross
2014-08-11 17:50 ` Christoph Hellwig
2014-08-11 10:27 ` Juergen Gross
2014-08-11 9:54 ` Christoph Hellwig
2014-08-08 7:49 ` [PATCH V4 3/4] Introduce XEN scsiback module jgross
2014-08-08 7:49 ` jgross
2014-08-11 18:14 ` Christoph Hellwig
2014-08-11 18:14 ` Christoph Hellwig
2014-08-12 12:29 ` Juergen Gross [this message]
2014-08-12 12:52 ` Juergen Gross
2014-08-12 12:52 ` [Xen-devel] " Juergen Gross
2014-08-12 12:29 ` Juergen Gross
2014-08-12 21:13 ` Nicholas A. Bellinger
2014-08-13 7:02 ` Juergen Gross
2014-08-14 4:34 ` Re: [Xen-devel] " Juergen Gross
2014-08-17 2:33 ` Nicholas A. Bellinger
2014-08-17 2:33 ` Re: [Xen-devel] " Nicholas A. Bellinger
2014-08-14 4:34 ` Juergen Gross
2014-08-17 2:15 ` Nicholas A. Bellinger
2014-08-17 2:15 ` Nicholas A. Bellinger
2014-08-13 7:02 ` Juergen Gross
2014-08-14 8:53 ` Re: [Xen-devel] " Juergen Gross
2014-08-14 10:14 ` Juergen Gross
2014-08-17 2:38 ` Nicholas A. Bellinger
2014-08-18 9:06 ` Juergen Gross
2014-08-18 9:06 ` Juergen Gross
2014-08-17 2:38 ` Nicholas A. Bellinger
2014-08-14 10:14 ` Juergen Gross
2014-08-14 8:53 ` Juergen Gross
2014-08-12 21:13 ` Nicholas A. Bellinger
2014-08-08 7:49 ` [PATCH V4 4/4] add xen pvscsi maintainer jgross
2014-08-08 7:49 ` jgross
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=53EA08BC.90809@suse.com \
--to=jgross@suse.com \
--cc=JBeulich@suse.com \
--cc=JBottomley@parallels.com \
--cc=david.vrabel@citrix.com \
--cc=hch@infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=target-devel@vger.kernel.org \
--cc=xen-devel@lists.xen.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 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.