From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRLRu-0004xS-74 for qemu-devel@nongnu.org; Thu, 04 Feb 2016 10:03:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRLRq-0003t0-Vk for qemu-devel@nongnu.org; Thu, 04 Feb 2016 10:03:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRLRq-0003sw-QX for qemu-devel@nongnu.org; Thu, 04 Feb 2016 10:03:54 -0500 References: <56B2754B.7030809@redhat.com> <56B28B1C.7060202@redhat.com> <56B28E8B.1030107@redhat.com> <56B326B4.1020407@redhat.com> <56B3550C.1010003@redhat.com> <56B35816.80900@suse.de> From: Paolo Bonzini Message-ID: <56B36852.8000101@redhat.com> Date: Thu, 4 Feb 2016 16:03:46 +0100 MIME-Version: 1.0 In-Reply-To: <56B35816.80900@suse.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] sda abort with virtio-scsi List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hannes Reinecke , Jim Minter , qemu-devel > diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c > index 595af1a..f712db5 100644 > --- a/drivers/scsi/virtio_scsi.c > +++ b/drivers/scsi/virtio_scsi.c > @@ -543,6 +543,33 @@ static int virtscsi_abort(struct scsi_cmnd *sc) > return virtscsi_tmf(vscsi, cmd); > } > > +static enum blk_eh_timer_return virtscsi_timed_out(struct scsi_cmnd *sc) > +{ > + struct virtio_scsi *vscsi = shost_priv(sc->device->host); > + struct virtio_scsi_cmd *cmd; > + > + scmd_printk(KERN_INFO, sc, "timeout\n"); > + cmd = mempool_alloc(virtscsi_cmd_pool, GFP_NOIO); > + if (!cmd) > + return FAILED; Should this be BLK_EH_NOT_HANDLED? Apart from this, the patch looks good. And of course this doesn't affect Jim, who can test this patch anyway. Thanks! Paolo > + > + memset(cmd, 0, sizeof(*cmd)); > + cmd->sc = sc; > + cmd->req.tmf = (struct virtio_scsi_ctrl_tmf_req){ > + .type = VIRTIO_SCSI_T_TMF, > + .subtype = VIRTIO_SCSI_T_TMF_QUERY_TASK, > + .lun[0] = 1, > + .lun[1] = sc->device->id, > + .lun[2] = (sc->device->lun >> 8) | 0x40, > + .lun[3] = sc->device->lun & 0xff, > + .tag = (unsigned long)sc, > + }; > + if (virtscsi_tmf(vscsi, cmd) == FAILED) > + return BLK_EH_NOT_HANDLED; > + > + return BLK_EH_RESET_TIMER; > +} > + > static struct scsi_host_template virtscsi_host_template = { > .module = THIS_MODULE, > .name = "Virtio SCSI HBA", > @@ -551,6 +578,7 @@ static struct scsi_host_template virtscsi_host_template = { > .this_id = -1, > .eh_abort_handler = virtscsi_abort, > .eh_device_reset_handler = virtscsi_device_reset, > + .eh_timed_out = virtscsi_timed_out, > > .can_queue = 1024, > .dma_boundary = UINT_MAX, > -- 1.8.5.6 >