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

Re: [Xen-devel] [PATCH V4 3/4] Introduce XEN scsiback module



> +#include <scsi/scsi_dbg.h>
> +#include <scsi/scsi_eh.h>
> +#include <scsi/scsi_tcq.h>

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.

> +#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.

> +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?

> +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.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.