From mboxrd@z Thu Jan 1 00:00:00 1970 From: Subject: [RESEND PATCH] mptsas: Fixed code to check whether the LU type is SSC or not for SILI bit in READ_6 and READ_16 CDB Date: Mon, 5 Mar 2012 10:24:31 +0530 Message-ID: <201203050453.q254rqa5002619@milmhbs0.lsil.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from na3sys009aog104.obsmtp.com ([74.125.149.73]:57516 "EHLO na3sys009aog104.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755083Ab2CEEx4 (ORCPT ); Sun, 4 Mar 2012 23:53:56 -0500 Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: stable@vger.kernel.org, linux-scsi@vger.kernel.org Cc: jejb@kernel.org This SILI bit (suppress incorrect length indicator) is defined only for SSC READ(6) and READ(16) commands. For other device types bit is part of LBA field. In the current implementation, it is not checked whether the logical unit is a SSC device. Added code for checking the LU type is SSC for SILI bit in READ_6 and READ_16 CDB Signed-off-by: Nagalakshmi Nandigama CC: --- diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index 0c3ced7..266bb14 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c @@ -827,13 +827,16 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) * DID_SOFT_ERROR is set. */ if (ioc->bus_type == SPI) { - if ((pScsiReq->CDB[0] == READ_6 && ((pScsiReq->CDB[1] & 0x02) == 0)) || - pScsiReq->CDB[0] == READ_10 || - pScsiReq->CDB[0] == READ_12 || - (pScsiReq->CDB[0] == READ_16 && - ((pScsiReq->CDB[1] & 0x02) == 0)) || - pScsiReq->CDB[0] == VERIFY || - pScsiReq->CDB[0] == VERIFY_16) { + if ((pScsiReq->CDB[0] == READ_6 && + ((pScsiReq->CDB[1] & 0x02) == 0) && + (sc->device->type == TYPE_TAPE)) || + pScsiReq->CDB[0] == READ_10 || + pScsiReq->CDB[0] == READ_12 || + (pScsiReq->CDB[0] == READ_16 && + ((pScsiReq->CDB[1] & 0x02) == 0) && + (sc->device->type == TYPE_TAPE)) || + pScsiReq->CDB[0] == VERIFY || + pScsiReq->CDB[0] == VERIFY_16) { if (scsi_bufflen(sc) != xfer_cnt) { sc->result =