On Fri, 2013-11-29 at 16:41 +0800, majianpeng wrote:
> To make the scsi-mq work, add those operations in scsi_mq_queue_rq().
> 
> Signed-off-by: Jianpeng Ma <[email protected]>
> ---
>  drivers/scsi/scsi-mq.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/scsi/scsi-mq.c b/drivers/scsi/scsi-mq.c
> index 918b443..eccdbd5 100644
> --- a/drivers/scsi/scsi-mq.c
> +++ b/drivers/scsi/scsi-mq.c
> @@ -20,8 +20,10 @@ static int scsi_mq_queue_rq(struct blk_mq_hw_ctx *hctx, 
> struct request *rq)
>       struct scsi_device *sdev = q->queuedata;
>       struct scsi_cmnd *sc = rq->special;
>       struct scatterlist *sg = sc->mq_sgl;
> +     struct Scsi_Host *shost = sdev->host;
>       unsigned char *sense_buf = sc->sense_buffer;
>       int rc;
> +
>       /*
>        * With blk-mq rq->special pre-allocation, scsi_get_cmd_from_req()
>        * is using the hardware context *sc descriptor
> @@ -66,6 +68,12 @@ static int scsi_mq_queue_rq(struct blk_mq_hw_ctx *hctx, 
> struct request *rq)
>       if (sdev->host->hostt->cmd_size)
>               sc->SCp.ptr = blk_mq_rq_to_pdu(rq) + sizeof(struct scsi_cmnd);
>  
> +     spin_lock_irq(shost->host_lock);
> +     sdev->device_busy++;
> +     scsi_target(sdev)->target_busy++;
> +     shost->host_busy++;
> +     spin_unlock_irq(shost->host_lock);
> +
>       rc = scsi_dispatch_cmd(sc);
>       switch (rc) {
>       case 0:

Same with this patch, it doesn't seem to be strictly required for the
QEMU AHCI + TYPE_ROM test case to function with v3.13-rc3 code.

I've been avoiding legacy host_lock access in the fast-path thus far,
and would not like to give that away just yet unless it's absolutely
required for prototype scsi-mq code to function.

--nab

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to