linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kristian Høgsberg" <krh@redhat.com>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux1394-devel <linux1394-devel@lists.sourceforge.net>,
	linux-scsi@vger.kernel.org
Subject: Re: use_sg != 0 assumption (was Re: [PATCH 5/9] Drop single buffer request support.)
Date: Thu, 10 May 2007 09:08:03 -0400	[thread overview]
Message-ID: <46431933.9090300@redhat.com> (raw)
In-Reply-To: <4642F627.5040400@s5r6.in-berlin.de>

Stefan Richter wrote:
> Kristian Høgsberg wrote:
>> The SCSI layer only passes sg requests down, so drop the
>> use_sg == 0, request_bufflen != 0 case.
>>
>> Signed-off-by: Kristian Hoegsberg <krh@redhat.com>
>> ---
>>  drivers/firewire/fw-sbp2.c |   43 +------------------------------------------
>>  1 files changed, 1 insertions(+), 42 deletions(-)
> 
> [...]
> 
>> @@ -1063,21 +1035,8 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
>>  		orb->request.misc |=
>>  			COMMAND_ORB_DIRECTION(SBP2_DIRECTION_TO_MEDIA);
>>  
>> -	if (cmd->use_sg) {
>> -		if (sbp2_command_orb_map_scatterlist(orb) < 0)
>> -			goto fail_map_payload;
>> -	} else if (cmd->request_bufflen > SBP2_MAX_SG_ELEMENT_LENGTH) {
>> -		/*
>> -		 * FIXME: Need to split this into a sg list... but
>> -		 * could we get the scsi or blk layer to do that by
>> -		 * reporting our max supported block size?
>> -		 */
>> -		fw_error("command > 64k\n");
>> +	if (cmd->use_sg && sbp2_command_orb_map_scatterlist(orb) < 0)
>>  		goto fail_map_payload;
>> -	} else if (cmd->request_bufflen > 0) {
>> -		if (sbp2_command_orb_map_buffer(orb) < 0)
>> -			goto fail_map_payload;
>> -	}
>>  
>>  	fw_memcpy_to_be32(&orb->request, &orb->request, sizeof orb->request);
>>  
> 
> Would a BUG_ON(cmd->use_sg == 0); be in order?

That's a good idea, though it needs to be

   BUG_ON(cmd->usg_sg == 0 && cmd->request_bufflen > 0);

since commands with no payload have use_sg == 0 and request_bufflen == 0.

Kristian


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

  parent reply	other threads:[~2007-05-10 15:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <11787529952207-git-send-email-krh@redhat.com>
     [not found] ` <11787530023454-git-send-email-krh@redhat.com>
     [not found]   ` <11787530031570-git-send-email-krh@redhat.com>
     [not found]     ` <11787530031450-git-send-email-krh@redhat.com>
     [not found]       ` <11787530043878-git-send-email-krh@redhat.com>
2007-05-10 10:38         ` use_sg != 0 assumption (was Re: [PATCH 5/9] Drop single buffer request support.) Stefan Richter
2007-05-10 11:44           ` Christoph Hellwig
2007-05-10 13:09             ` Stefan Richter
2007-05-10 13:08           ` Kristian Høgsberg [this message]
     [not found]         ` <11787530054176-git-send-email-krh@redhat.com>
2007-05-10 10:44           ` [PATCH 6/9] Make scsi_host_template::proc_name const char * instead of char * Stefan Richter

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=46431933.9090300@redhat.com \
    --to=krh@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=stefanr@s5r6.in-berlin.de \
    /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).