linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
	James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>
Subject: linux-next: manual merge of the target-updates tree with the  tree
Date: Fri, 23 May 2014 19:07:13 +1000	[thread overview]
Message-ID: <20140523190713.198c5d68@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 2608 bytes --]

Hi Nicholas,

Today's linux-next merge of the target-updates tree got a conflict in
drivers/scsi/virtio_scsi.c between commit b54197c43db8 ("virtio_scsi:
use cmd_size") from the scsi tree and commit 4baaa7d589e2
("virtio-scsi: Enable DIF/DIX modes in SCSI host LLD") from the
target-updates tree.

I fixed it up (I think - see below) and can carry the fix as necessary
(no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/scsi/virtio_scsi.c
index d4727b339474,cc634b0e8f04..000000000000
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@@ -456,9 -537,10 +497,10 @@@ static int virtscsi_queuecommand(struc
  				 struct virtio_scsi_vq *req_vq,
  				 struct scsi_cmnd *sc)
  {
 -	struct virtio_scsi_cmd *cmd;
 -	int ret, req_size;
 -
++	int req_size;
  	struct Scsi_Host *shost = virtio_scsi_host(vscsi->vdev);
 +	struct virtio_scsi_cmd *cmd = scsi_cmd_priv(sc);
 +
  	BUG_ON(scsi_sg_count(sc) > shost->sg_tablesize);
  
  	/* TODO: check feature bit and fail if unsupported?  */
@@@ -467,27 -549,34 +509,25 @@@
  	dev_dbg(&sc->device->sdev_gendev,
  		"cmd %p CDB: %#02x\n", sc, sc->cmnd[0]);
  
 -	ret = SCSI_MLQUEUE_HOST_BUSY;
 -	cmd = mempool_alloc(virtscsi_cmd_pool, GFP_ATOMIC);
 -	if (!cmd)
 -		goto out;
 -
  	memset(cmd, 0, sizeof(*cmd));
  	cmd->sc = sc;
- 	cmd->req.cmd = (struct virtio_scsi_cmd_req){
- 		.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,
- 		.task_attr = VIRTIO_SCSI_S_SIMPLE,
- 		.prio = 0,
- 		.crn = 0,
- 	};
  
  	BUG_ON(sc->cmd_len > VIRTIO_SCSI_CDB_SIZE);
- 	memcpy(cmd->req.cmd.cdb, sc->cmnd, sc->cmd_len);
  
- 	if (virtscsi_kick_cmd(req_vq, cmd,
- 			      sizeof cmd->req.cmd, sizeof cmd->resp.cmd,
+ 	if (virtio_has_feature(vscsi->vdev, VIRTIO_SCSI_F_T10_PI)) {
+ 		virtio_scsi_init_hdr_pi(&cmd->req.cmd_pi, sc);
+ 		memcpy(cmd->req.cmd_pi.cdb, sc->cmnd, sc->cmd_len);
+ 		req_size = sizeof(cmd->req.cmd_pi);
+ 	} else {
+ 		virtio_scsi_init_hdr(&cmd->req.cmd, sc);
+ 		memcpy(cmd->req.cmd.cdb, sc->cmnd, sc->cmd_len);
+ 		req_size = sizeof(cmd->req.cmd);
+ 	}
+ 
+ 	if (virtscsi_kick_cmd(req_vq, cmd, req_size, sizeof(cmd->resp.cmd),
 -			      GFP_ATOMIC) == 0)
 -		ret = 0;
 -	else
 -		mempool_free(cmd, virtscsi_cmd_pool);
 -
 -out:
 -	return ret;
 +			      GFP_ATOMIC) != 0)
 +		return SCSI_MLQUEUE_HOST_BUSY;
 +	return 0;
  }
  
  static int virtscsi_queuecommand_single(struct Scsi_Host *sh,

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

             reply	other threads:[~2014-05-23  9:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23  9:07 Stephen Rothwell [this message]
2015-06-01 11:22 linux-next: manual merge of the target-updates tree with the tree Stephen Rothwell
2015-06-01 11:35 ` Nicholas A. Bellinger
2015-06-01 11:56   ` Stephen Rothwell

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=20140523190713.198c5d68@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=nab@linux-iscsi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).