From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-scsi@vger.kernel.org, "James E.J. Bottomley" <JBottomley@odin.com>
Cc: Akinobu Mita <akinobu.mita@gmail.com>,
Micky Ching <micky_ching@realsil.com.cn>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH 5/7] staging: rts5208: fix transfer length 0 for 6-byte r/w commands
Date: Sat, 16 May 2015 16:17:51 +0900 [thread overview]
Message-ID: <1431760673-7180-6-git-send-email-akinobu.mita@gmail.com> (raw)
In-Reply-To: <1431760673-7180-1-git-send-email-akinobu.mita@gmail.com>
For 6-byte r/w commands, transfer length 0 means 256 blocks of data,
not 0 block.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Micky Ching <micky_ching@realsil.com.cn>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-scsi@vger.kernel.org
---
drivers/staging/rts5208/rtsx_scsi.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rts5208/rtsx_scsi.c b/drivers/staging/rts5208/rtsx_scsi.c
index 8a5d6a8..60871f3 100644
--- a/drivers/staging/rts5208/rtsx_scsi.c
+++ b/drivers/staging/rts5208/rtsx_scsi.c
@@ -915,6 +915,8 @@ static int read_write(struct scsi_cmnd *srb, struct rtsx_chip *chip)
start_sec = ((u32)(srb->cmnd[1] & 0x1F) << 16) |
((u32)srb->cmnd[2] << 8) | ((u32)srb->cmnd[3]);
sec_cnt = srb->cmnd[4];
+ if (sec_cnt == 0)
+ sec_cnt = 256;
} else if ((srb->cmnd[0] == VENDOR_CMND) &&
(srb->cmnd[1] == SCSI_APP_CMD) &&
((srb->cmnd[2] == PP_READ10) || (srb->cmnd[2] == PP_WRITE10))) {
@@ -2904,9 +2906,11 @@ void led_shine(struct scsi_cmnd *srb, struct rtsx_chip *chip)
if ((srb->cmnd[0] == READ_10) || (srb->cmnd[0] == WRITE_10))
sec_cnt = ((u16)(srb->cmnd[7]) << 8) | srb->cmnd[8];
- else if ((srb->cmnd[0] == READ_6) || (srb->cmnd[0] == WRITE_6))
+ else if ((srb->cmnd[0] == READ_6) || (srb->cmnd[0] == WRITE_6)) {
sec_cnt = srb->cmnd[4];
- else
+ if (sec_cnt == 0)
+ sec_cnt = 256;
+ } else
return;
if (chip->rw_cap[lun] >= GPIO_TOGGLE_THRESHOLD) {
--
1.9.1
next prev parent reply other threads:[~2015-05-16 7:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-16 7:17 [PATCH 0/7] scsi: Fix transfer length 0 for 6-byte r/w commands Akinobu Mita
2015-05-16 7:17 ` [PATCH 1/7] hpsa: fix " Akinobu Mita
2015-05-16 7:17 ` [PATCH 2/7] 3w-xxxx: " Akinobu Mita
2015-05-16 7:17 ` [PATCH 3/7] 3w-9xxx: " Akinobu Mita
2015-05-16 7:17 ` [PATCH 4/7] scsi: trace: " Akinobu Mita
2015-05-16 7:17 ` Akinobu Mita [this message]
2015-05-16 7:17 ` [PATCH 6/7] megaraid_mbox: " Akinobu Mita
2015-05-16 7:17 ` [PATCH 7/7] megaraid: " Akinobu Mita
2015-05-16 16:46 ` [PATCH 0/7] scsi: Fix " James Bottomley
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=1431760673-7180-6-git-send-email-akinobu.mita@gmail.com \
--to=akinobu.mita@gmail.com \
--cc=JBottomley@odin.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-scsi@vger.kernel.org \
--cc=micky_ching@realsil.com.cn \
/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