From patchwork Tue Mar 17 15:26:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Achim Leubner X-Patchwork-Id: 6032681 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 B0B9C9F54E for ; Tue, 17 Mar 2015 15:54:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC4372041B for ; Tue, 17 Mar 2015 15:54:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E5DA2044B for ; Tue, 17 Mar 2015 15:54:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932509AbbCQPyI (ORCPT ); Tue, 17 Mar 2015 11:54:08 -0400 Received: from bby1mta02.pmc-sierra.com ([216.241.235.117]:55935 "EHLO bby1mta02.pmc-sierra.bc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932335AbbCQPyE convert rfc822-to-8bit (ORCPT ); Tue, 17 Mar 2015 11:54:04 -0400 Received: from bby1mta02.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id F060D8E03B7; Tue, 17 Mar 2015 08:26:03 -0700 (PDT) Received: from smtp.pmcs.com (bby1cas02.pmc-sierra.internal [216.241.227.143]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by bby1mta02.pmc-sierra.bc.ca (Postfix) with ESMTP id E420A8E0303; Tue, 17 Mar 2015 08:26:03 -0700 (PDT) Received: from BBYEXM01.pmc-sierra.internal ([169.254.1.130]) by bby1cas02.pmc-sierra.internal ([2002:d8f1:e38f::d8f1:e38f]) with mapi id 14.03.0123.003; Tue, 17 Mar 2015 08:26:04 -0700 From: Achim Leubner To: Mahesh Rajashekhara , "JBottomley@Parallels.com" , "linux-scsi@vger.kernel.org" Subject: RE: [PATCH 2/7] aacraid: IOCTL pass-through command fix Thread-Topic: [PATCH 2/7] aacraid: IOCTL pass-through command fix Thread-Index: AQHQVlddRsdMqAwM+0+MGNpjC1l11Z0g4Ihw Date: Tue, 17 Mar 2015 15:26:02 +0000 Message-ID: <307F48E420013C4E85C75C93E532197AB8092024@BBYEXM01.pmc-sierra.internal> References: <1425458313-1956-1-git-send-email-Mahesh.Rajashekhara@pmcs.com> <1425458313-1956-3-git-send-email-Mahesh.Rajashekhara@pmcs.com> In-Reply-To: <1425458313-1956-3-git-send-email-Mahesh.Rajashekhara@pmcs.com> Accept-Language: de-DE, en-CA, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [216.241.227.4] MIME-Version: 1.0 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Reviewed-by: Achim Leubner -----Original Message----- From: Mahesh Rajashekhara Sent: Wednesday, March 4, 2015 9:38 AM To: JBottomley@Parallels.com; linux-scsi@vger.kernel.org Cc: aacraid@pmc-sierra.com; Harry Yang; Achim Leubner; Rajinikanth Pandurangan; Rich Bono; Mahesh Rajashekhara Subject: [PATCH 2/7] aacraid: IOCTL pass-through command fix The Linux aacriad driver fails to detect the case of SG list count=0 on IOCTL pass-through command and cause intermittent fault. The result is the Linux aacriad driver send down IOCTL pass-through command with one not initialized SG list to firmware when receiving SG list count =0 on pass-through command. Signed-off-by: Mahesh Rajashekhara Reviewed-by: Hannes Reinecke --- drivers/scsi/aacraid/commctrl.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) } } srbcmd->count = cpu_to_le32(byte_count); - psg->count = cpu_to_le32(sg_indx+1); + if (user_srbcmd->sg.count) + psg->count = cpu_to_le32(sg_indx+1); + else + psg->count = 0; status = aac_fib_send(ScsiPortCommand, srbfib, actual_fibsize, FsaNormal, 1, 1, NULL, NULL); } if (status == -ERESTARTSYS) { -- 1.7.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c index fbcd48d..54195a1 100644 --- a/drivers/scsi/aacraid/commctrl.c +++ b/drivers/scsi/aacraid/commctrl.c @@ -689,7 +689,10 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) kfree (usg); } srbcmd->count = cpu_to_le32(byte_count); - psg->count = cpu_to_le32(sg_indx+1); + if (user_srbcmd->sg.count) + psg->count = cpu_to_le32(sg_indx+1); + else + psg->count = 0; status = aac_fib_send(ScsiPortCommand64, srbfib, actual_fibsize, FsaNormal, 1, 1,NULL,NULL); } else { struct user_sgmap* upsg = &user_srbcmd->sg; @@ -775,7 +778,10 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)