public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Ke Wei <kewei@marvell.com>
To: linux-scsi@vger.kernel.org
Cc: james.bottomley@hansenpartnership.com, jeff@garzik.org
Subject: [PATCH 9/9][RESEND] mvsas: ATAPI lun issue
Date: Thu, 27 Mar 2008 14:55:50 +0800	[thread overview]
Message-ID: <47EB44F6.8070708@marvell.com> (raw)

    I found that sending REPORT_LUNS command to some DVD device will cause fis error and controller error record. As a result, scsi mid layer get some wrong LUNs. Also I can get some queer messages.

scsi: host 12 channel 0 id 2 lun 0x30302e302f686f73 has a LUN larger
than currently supported.
scsi: host 12 channel 0 id 2 lun 0x7431322f706f7274 has a LUN larger
than currently supported.
scsi: host 12 channel 0 id 2 lun 0x2d31323a322f656e has a LUN larger
than currently supported.
...

    The patch forced to clear the sg buffer of SATA response if FIS is error. But I suggest these codes should merge to the libsas module.


Signed-off-by: Ke Wei <kewei@marvell.com>
---
 drivers/scsi/mvsas.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/mvsas.c b/drivers/scsi/mvsas.c
index e55b903..42f3e90 100644
--- a/drivers/scsi/mvsas.c
+++ b/drivers/scsi/mvsas.c
@@ -1263,8 +1263,14 @@ static int mvs_sata_done(struct mvs_info *mvi, struct sas_task *task,
 	       SATA_RECEIVED_D2H_FIS(port->taskfileset),
 	       sizeof(struct dev_to_host_fis));
 	tstat->buf_valid_size = sizeof(*resp);
-	if (unlikely(err))
+	if (unlikely(err)) {
+		struct scatterlist *sg = task->scatter;
+		u8 *buf;
 		stat = SAS_PROTO_RESPONSE;
+		buf = kmap_atomic(sg_page(sg), KM_IRQ0) + sg->offset;
+		memset(buf, 0, sg->length);
+		kunmap_atomic(buf - sg->offset, KM_IRQ0);
+	}
 	return stat;
 }
 
-- 
1.5.4





             reply	other threads:[~2008-03-27  6:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-27  6:55 Ke Wei [this message]
2008-03-27 13:38 ` [PATCH 9/9][RESEND] mvsas: ATAPI lun issue Jeff Garzik

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=47EB44F6.8070708@marvell.com \
    --to=kewei@marvell.com \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=jeff@garzik.org \
    --cc=linux-scsi@vger.kernel.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