Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche@sandisk.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: sc_data_direction and bidi commands
Date: Thu, 22 Jan 2015 11:14:29 +0100	[thread overview]
Message-ID: <54C0CD85.4000700@sandisk.com> (raw)
In-Reply-To: <1421920974.7061.55.camel@haakon3.risingtidesystems.com>

On 01/22/15 11:02, Nicholas A. Bellinger wrote:
> On Wed, 2015-01-21 at 17:18 +0100, Bart Van Assche wrote:
>> Although several SCSI LLDs compare sc_data_direction with the value
>> DMA_BIDIRECTIONAL apparently scsi_setup_cmnd() never sets
>> sc_data_direction to the value DMA_BIDIRECTIONAL. Is this behavior on
>> purpose ?
> 
> Yes.  Bi-directional CDBs are signaled using scsi_bidi_cmnd(), and IIRC
> ->sc_data_direction = DMA_TO_DEVICE is set for those cases.

But why is sc_data_direction set to DMA_BIDIRECTIONAL in
scsi_ioctl_reset() in drivers/scsi/scsi_error.c ? I think
scsi_bidi_cmnd() will return false for the SCSI command submitted by
scsi_ioctl_reset() since in this case scmd->request->next_rq == NULL.

Bart.

  reply	other threads:[~2015-01-22 10:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 16:18 sc_data_direction and bidi commands Bart Van Assche
2015-01-22 10:02 ` Nicholas A. Bellinger
2015-01-22 10:14   ` Bart Van Assche [this message]
2015-01-22 10:39     ` Nicholas A. Bellinger
2015-01-22 11:51       ` Bart Van Assche

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=54C0CD85.4000700@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=linux-scsi@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