From patchwork Sat May 16 07:17:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 6419221 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C0984C0432 for ; Sat, 16 May 2015 07:18:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 05668204B0 for ; Sat, 16 May 2015 07:18:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A8E7204A7 for ; Sat, 16 May 2015 07:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754068AbbEPHSt (ORCPT ); Sat, 16 May 2015 03:18:49 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:36558 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932859AbbEPHSo (ORCPT ); Sat, 16 May 2015 03:18:44 -0400 Received: by pdfh10 with SMTP id h10so52169239pdf.3 for ; Sat, 16 May 2015 00:18:43 -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=mVGORt57AXnoLpNv9IrcGszrh53kV8s2DaddDnpMXTQ=; b=PJ8fbYCrPBFJgzgIJSgDPkFEbFk/a/ZS98UILfj3ArE6vRDq5ru+dufGRM5q3hR4Ay WwBULJg98iwdGvnnY8AjQV+ZmmUmYRdyEWZtV7N4oC/qfFwRhRw4Mtjq6C7GCFGY9/eZ Hq59RcEpRJczRiHUh3F3lV9jYqvBWKpUL6qlAU6AyLAoihDbY9eJdox6eIvKwTLSOnao EIpcRO+ieZI1OMkLRPbX5SR1BVjjWCPSAP/Bjfa/nBUK+A0BPiE3zWZevDvGiwIV3Z23 HoHpclIbQrUEbTqOx1AO+RTo7TedlUQDe70yU3RlZCfpNz1OPc4Z1fCPGWni9pp+DtVt AqYg== X-Received: by 10.66.232.104 with SMTP id tn8mr24953338pac.73.1431760723835; Sat, 16 May 2015 00:18:43 -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.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 May 2015 00:18:42 -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 6/7] megaraid_mbox: fix transfer length 0 for 6-byte r/w commands Date: Sat, 16 May 2015 16:17:52 +0900 Message-Id: <1431760673-7180-7-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/megaraid_mbox.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index f0987f2..bed00d4 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -1691,6 +1691,8 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) */ if (scp->cmd_len == 6) { mbox->numsectors = (uint32_t)scp->cmnd[4]; + if (mbox->numsectors == 0) + mbox->numsectors = 256; mbox->lba = ((uint32_t)scp->cmnd[1] << 16) | ((uint32_t)scp->cmnd[2] << 8) |