From patchwork Sat May 16 07:17:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 6419231 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 523819F318 for ; Sat, 16 May 2015 07:18:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B116204A7 for ; Sat, 16 May 2015 07:18:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9FBA4204E3 for ; Sat, 16 May 2015 07:18:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932994AbbEPHSu (ORCPT ); Sat, 16 May 2015 03:18:50 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:36721 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932939AbbEPHSs (ORCPT ); Sat, 16 May 2015 03:18:48 -0400 Received: by pdfh10 with SMTP id h10so52171724pdf.3 for ; Sat, 16 May 2015 00:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6Pr4LsHoSI9oj0EqLmERcGGIabCaalAS0yuyYX3h6vI=; b=OF6PW9H3kp8XosaAiedAYjaz84VXKc8LGC/wLfopv0jncSN7MljYwdBS4/iBgOnylu OaKm9ob+C7KEM3LJeCa1ybpv4t3OZk8R22E2NWqHGRYhsrrb223vWqCmca9J2ZodsBA5 wJ3DmN/s9DY+KZc3Du4SHXOwtPg2K6hcYf/eT+7pZpDDdgWDwLIUA402VYZgJW0W2Y8+ eSR1U6JW0ixToQwVXHHvzP9g+ZQ2kqCtOpGOBn1pISq7+s7SFC7O/4q29tWZiTMw5wj+ kPCRMR+1iR7D1TKBCNXgjaBOKvfqJoVEFXvXyBmU7xSFYuChIVwKTI+jLN+n49nwqJ/G 3HOA== X-Received: by 10.70.135.106 with SMTP id pr10mr11879793pdb.156.1431760727464; Sat, 16 May 2015 00:18:47 -0700 (PDT) Received: from localhost.localdomain (KD106168100169.ppp-bb.dion.ne.jp. [106.168.100.169]) by mx.google.com with ESMTPSA id j14sm3804949pbq.29.2015.05.16.00.18.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 May 2015 00:18:46 -0700 (PDT) From: Akinobu Mita To: linux-scsi@vger.kernel.org, "James E.J. Bottomley" Cc: Akinobu Mita , Kashyap Desai , Sumit Saxena , Uday Lingala , megaraidlinux.pdl@avagotech.com Subject: [PATCH 7/7] megaraid: fix transfer length 0 for 6-byte r/w commands Date: Sat, 16 May 2015 16:17:53 +0900 Message-Id: <1431760673-7180-8-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431760673-7180-1-git-send-email-akinobu.mita@gmail.com> References: <1431760673-7180-1-git-send-email-akinobu.mita@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For 6-byte r/w commands, transfer length 0 means 256 blocks of data, not 0 block. Signed-off-by: Akinobu Mita Cc: Kashyap Desai Cc: Sumit Saxena Cc: Uday Lingala Cc: megaraidlinux.pdl@avagotech.com Cc: linux-scsi@vger.kernel.org --- drivers/scsi/megaraid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index bc7b34c..509aead 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -759,6 +759,8 @@ mega_build_cmd(adapter_t *adapter, Scsi_Cmnd *cmd, int *busy) */ if( cmd->cmd_len == 6 ) { mbox->m_out.numsectors = (u32) cmd->cmnd[4]; + if (mbox->m_out.numsectors == 0) + mbox->m_out.numsectors = 256; mbox->m_out.lba = ((u32)cmd->cmnd[1] << 16) | ((u32)cmd->cmnd[2] << 8) |