From patchwork Sat May 16 07:17:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 6419201 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 3536BC0433 for ; Sat, 16 May 2015 07:18:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 63D41204A7 for ; Sat, 16 May 2015 07:18:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 76F2E204B0 for ; Sat, 16 May 2015 07:18:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932932AbbEPHSl (ORCPT ); Sat, 16 May 2015 03:18:41 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34164 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932595AbbEPHSd (ORCPT ); Sat, 16 May 2015 03:18:33 -0400 Received: by pabru16 with SMTP id ru16so53520747pab.1 for ; Sat, 16 May 2015 00:18:33 -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=PsRnxmUbuQaqeAGRlKd7FmviFUyhbRRuE+7yyoPHYdc=; b=GftsfA3vCDXiHs34z7eryRVmLxjmZw7b3Wfzcze4YWLh7oi0Fz5Jg+32SyEedbwRFs JX7wcvo956z1cdBjZAT3YGKwkX3HV4CgnKo0sX+4wjiqiwq/qcRgqqUhMH2umXyiQ64F fXrctbfhVsF/g8QTQln4cTByAtzsZ6tpW5JXCAeHTvv9ngf+Vnck9XElJ3aaX4b5pMdE V496yEQPwuttD9HtnR6tB+v+Z7JeZVEvXC2yKfJ7ZFZF1BFfcFg30DLrF38nXk/5Gu6b 6WTWL5Y28tU5BeXHZDHYUM0dEIK/sQ4Jxn2pxHXTwyjhNTBbRzKXRWOEewX31tfF4y5B kH5w== X-Received: by 10.66.177.238 with SMTP id ct14mr25231094pac.121.1431760713112; Sat, 16 May 2015 00:18:33 -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.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 May 2015 00:18:32 -0700 (PDT) From: Akinobu Mita To: linux-scsi@vger.kernel.org, "James E.J. Bottomley" Cc: Akinobu Mita , Adam Radford Subject: [PATCH 3/7] 3w-9xxx: fix transfer length 0 for 6-byte r/w commands Date: Sat, 16 May 2015 16:17:49 +0900 Message-Id: <1431760673-7180-4-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: Adam Radford Cc: linux-scsi@vger.kernel.org --- drivers/scsi/3w-9xxx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index add419d..71ddb7f 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -1870,8 +1870,11 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, } if (srb) { - if (srb->cmnd[0] == READ_6 || srb->cmnd[0] == WRITE_6) + if (srb->cmnd[0] == READ_6 || srb->cmnd[0] == WRITE_6) { num_sectors = (u32)srb->cmnd[4]; + if (num_sectors == 0) + num_sectors = 256; + } if (srb->cmnd[0] == READ_10 || srb->cmnd[0] == WRITE_10) num_sectors = (u32)srb->cmnd[8] | ((u32)srb->cmnd[7] << 8);