From patchwork Wed Apr 25 16:24:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Carroll X-Patchwork-Id: 10363835 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8698C6032C for ; Wed, 25 Apr 2018 16:24:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7156B287B5 for ; Wed, 25 Apr 2018 16:24:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63F7B28CAA; Wed, 25 Apr 2018 16:24:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D2EE287B5 for ; Wed, 25 Apr 2018 16:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755275AbeDYQYk (ORCPT ); Wed, 25 Apr 2018 12:24:40 -0400 Received: from mail-sn1nam02on0043.outbound.protection.outlook.com ([104.47.36.43]:49028 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754752AbeDYQYe (ORCPT ); Wed, 25 Apr 2018 12:24:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mscc365.onmicrosoft.com; s=selector1-microsemi-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=rEjDOu6tuhLo0ZCpXbiWNTszGCZLhDq/l2seH7eIpy0=; b=eVNy0ZnSP9WlJluX30GtC3INLYa44Kh2ee6RxNC3YnaYoA99oj/bockOhLCSc5g6j3B8LNojlkFmYwPjwC1oF5pe7/RGLaPzqceJV26xXKdBdDybOkITLcgev1OgRsH2FUq9H0+PY6w0eTkjOsht2ia3X9IiQs+5q3T3UpEKBww= Received: from MWHPR02CA0031.namprd02.prod.outlook.com (2603:10b6:301:60::20) by MWHPR02MB2366.namprd02.prod.outlook.com (2603:10b6:300:5c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.17; Wed, 25 Apr 2018 16:24:32 +0000 Received: from BY2FFO11OLC015.protection.gbl (2a01:111:f400:7c0c::188) by MWHPR02CA0031.outlook.office365.com (2603:10b6:301:60::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.715.18 via Frontend Transport; Wed, 25 Apr 2018 16:24:32 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.22) smtp.mailfrom=microsemi.com; oracle.com; dkim=none (message not signed) header.d=none;oracle.com; dmarc=bestguesspass action=none header.from=microsemi.com; Received-SPF: Pass (protection.outlook.com: domain of microsemi.com designates 208.19.100.22 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.22; helo=AVMBX2.microsemi.net; Received: from AVMBX2.microsemi.net (208.19.100.22) by BY2FFO11OLC015.mail.protection.outlook.com (10.1.15.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.653.14 via Frontend Transport; Wed, 25 Apr 2018 16:24:32 +0000 Received: from AVMBX2.microsemi.net (10.100.34.32) by AVMBX2.microsemi.net (10.100.34.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Wed, 25 Apr 2018 09:24:30 -0700 Received: from localhost.localdomain (10.225.65.2) by avmbx2.microsemi.net (10.100.34.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Wed, 25 Apr 2018 09:24:30 -0700 From: Dave Carroll To: "Martin K . Petersen" , Noah Misner , James Bottomley , "Hannes Reinecke" CC: Dave Carroll , linux-scsi , , Scott Benesh , Subject: [PATCH] aacraid: Correct hba_send to include iu_type Date: Wed, 25 Apr 2018 10:24:20 -0600 Message-ID: <20180425162420.612-1-david.carroll@microsemi.com> X-Mailer: git-send-email 2.8.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:208.19.100.22; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(39380400002)(396003)(39860400002)(346002)(2980300002)(438002)(199004)(189003)(69596002)(106466001)(110136005)(106002)(1076002)(68736007)(54906003)(47776003)(48376002)(53936002)(97736004)(50466002)(2906002)(476003)(478600001)(77096007)(26005)(59450400001)(316002)(336012)(6666003)(5660300001)(356003)(305945005)(4326008)(126002)(486006)(86362001)(2616005)(186003)(81156014)(81166006)(8936002)(1857600001)(50226002)(36756003)(8656006)(51416003)(8676002)(49486002)(16586007); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR02MB2366; H:AVMBX2.microsemi.net; FPR:; SPF:Pass; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC015; 1:UUU133EF1RzgigzKhcoKpo2uMie/5thrrX7c/d2xSvm/slEgWoogdIApoU7lWncKDk9z/tI12o/ZkjABWcLBtt5whN5JW8SCZ4vRt3w+7J2Ug7Vd3/FgBI2sS5es0W6O X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:MWHPR02MB2366; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB2366; 3:6bZjUwX7LTE5C1onEpqBBxem0i3EoH1z9OnZOJpODIDS1S/quZd5gqrwuDcLSmla8mU3++/pueh1lV+F57u+O7Zz3Lg4WXw6uO3qSTgpPzOIONvT81EmWt0LAtUdHVBV9Rnysf9wqgTOnHKMkvtz0aS+7N0z7P2d4qYHmP0FOW9+47t06RsApVkNh8I9TZK8Wt9Sh6FhBWepZiReb95dnU4LEzYPyzFHd/I9K0w0mTs8hMzQtWGTo51EcRLUhynMJay5Apoa/kl7xVrSrCCNwUWCiqDGwlhSLicRKdCxBgRnUvQhO81ZWwWYsS9eirMUV5ejopKNQaZYZrsh/y61SnMlKLq0wXGLKokpzwKCP+8=; 25:tIXLQz6oJEHDgflRqQWSy7BwQQGzMh3r8l9X8u5Z881C9Uz+X0HXnknPszqS/WgEq1yubpr3djy+nULud7dlXOPmwZ6SBQ7CByLoAW10YNkayRQ5db7JDxZZkXAjix7Hfa4aa3cBG2sY7VAw139eH0a/lF7g/zPd52fkBJ3P5CH+WjTm5A34GlMQqu2wVmeoSPFAZXCO2HC4l70l2RmH481XW+2AacwSkRVGaxetjYtaCa7oNhkRIS6BJ7e0/T5yEBOGhGO3h1BDX3NbcO5gp0VyXm8Wmz5fkb3eM0V8wfej4h3etksi317fI1sWhDouF5of353gOB2/XgDqeqAl/Q== X-MS-TrafficTypeDiagnostic: MWHPR02MB2366: X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB2366; 31:i2Q8IZyqBQ3vlyyCOFB47MVlP9sC156hkgpxiW+Ccue9Ql9SuD4OhV5IzpVFqRTBYj+gIoPp0CaZXPI6DywTglsr595Fi6QonFBI2w6u2K6cDkqJrTKLkR1QyWb+b0tU5PMjuO2DZt6Is7+/h6jwxOKW/f3YUYvUEOTuGNAroOOZOTPSOz80LsWrDPnCK06OVxhdkqLg4NfSGJz9787XHEhSgFdETBdcaaPBcVFHccM=; 20:xraRinwpCEjiI6uu+EOA9TKewLZIgBv9JCa1qugvMJRsqHTHraLgbFnJhfgDIkHwWX3Kk4fAZj8xPm1z2sFjqIw++8O5rFGVcH+b5FhadXroPtt6IlCLgD8iQx2IOwbtc2CdTP+6Pq5XZjZzLI+qZOA1YUnh+R0dvA42vQV93w8ExgaEMMVmd9PgzNjCT+LRS8xVJrwe4+9/xDeAsVkX2ktv4MnsJPBFsHboAYPAGsCYIojj0dvQGm/IQ1KbbLKxQE3IhvmyT6LkRjcOJ9Y9yrSg0G7C2SH2PBLRGjqdFx+pdp9GwSSuU3wLynhTh3SR8/vNd5V4MKfcBMUHX0Rhn03eiWYGJoz5weq6Wtlt4jsKll/czWbNELaRcq+cX2oyqGHHcRdkumZ3lG+2TFmcfNsyGD6HI6lPjck5TliD7tMRnNafLZz73X0S42UCMFD0RNS03D420ou0dNoZkHrtbqbRG2vMb1V5GlkFTz0wi/Tn3PB4dw5bhwGRd9EOJqxApbTyAvqWooNmPM9NEJF6O4nw7kh1k5dVRUrg0I1q+zfVquQleqcfgbL+byEAeqPKJoq9OScNcoxDfHWilKH9d+VtA8EUNMMz0lghBrK46xM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(72170198267865)(274839183919467)(104084551191319); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231232)(944501410)(52105095)(93006095)(93004095)(3002001)(10201501046)(6055026)(6041310)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011); SRVR:MWHPR02MB2366; BCL:0; PCL:0; RULEID:; SRVR:MWHPR02MB2366; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB2366; 4:GF81N0TFPNGYkKTRBhVu/G4Fs5Z+stQxhWIcepy96JhK0uLBTwiYgp8j2YQ+0oK7BvlpBSJ39yM8AhZCzt2VumQ8ppDNr5r9KVL/PmOBiTLV09TKqluHML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ScIfUXZ9J1LGqrRp7J1VB?= =?us-ascii?Q?nkv9cCEQUgWRZGYaLYypRoPZH8I0PjKpLcs32sKCMvxGx9DYBXWX0ZxhndXq?= =?us-ascii?Q?iScmGlhAPM6PfrUBBoyr1coc95r/TvfapQoVIR5Jlx9fsuk2b0dKNCZ4s9v5?= =?us-ascii?Q?/QJyHyUeyS9pk+TmbRhpbDuR7hpzsNzWR1tJSjI0vf49woRcckAGB4ctvI+s?= =?us-ascii?Q?I5DhtzKKrHgPt3KvZK7qyP2dg7I3lwKUDwugQmuXurnqLZ+7zR53gG9F1Fgz?= =?us-ascii?Q?yh58IM5yCkKy59zWc5L62ZPC50C4D2YjH+bcLFLvdnB4THaYtjhP4nbmk4FL?= =?us-ascii?Q?sUDBDIkQEzk+lY1wRrX9/L570nUiM2y0FToP48j3wG8O7ZwYA7MDcrDFsqGo?= =?us-ascii?Q?/f0YX1k7xxjpTf1tIZFRxNjfn2aE5EIEi+HX68VATIwehQ9ArTUILtaLh6TP?= =?us-ascii?Q?EpaZyO2KIO91OAEXkqHBXpFpO8ssIqbDtDfmrHfpLReIKI7jRCIUhzthtJ2p?= =?us-ascii?Q?vYGz1Lnw4P/itLe3ijVPucPU+akHm5YibTcdjfP0v2GFHielWKJOdr9iFGd0?= =?us-ascii?Q?ZBdmiVmnyjOgCR+LHFQqdUgNB8EIKXV?= X-Microsoft-Antispam-Message-Info: U6R6ea9nkGnzTlZ123u380hpyAYpNhct9v6Qk8ByRZm8WuuVuXYp4ej1E77csjdPOZtrZUlSi+gOagu9L1B79arQjbRkxr10QoPpBliSKZPxMLnnL0lt9plUT5jafTfyALtwqTPbndlUxV1ZgeAPC/smWYQCHaX7Xh6Nlua9++YOlP811ok47KslIMj6i/yq X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB2366; 6:6XH9ddcJSuo8VtZ6Pe2ItAYUIrYEytAiuAgl3rGhuCHCsP+hDPb3FSeoEktnU+z1CToa2VGEoowcFTcQgpcNbT0gB3F1GR6bH2UZ3k9xvmjhUMAQhVIgb0ayggYVO9McrmoY+A9ptJKHPQs3u8HYAOvNrEmmVhqqjqDsUuTNRVJ1Z+Nvcdolv63/k6e3N2LcMmGZZr3AX/cbTOhHSCw8GKSrS3zBbTX3t6UQKmpL8LD1C87yh2jNHC4h5XXuM8fwsXcDnoSdGOPhn1xMhfSKSyyvIENABnJLgVI3qmPCh6Mqukc0+vfF1nshrlO7K8giwClIVNGny7vfY8KXBgUEUbK316obv0/qn7cmpo5AGaefq/EpWrxPTtmBgyU1wGQ7RQLFi5jHsejfEmCvtoS/m9mPDhm39fHhcCtfOMVeWP0dm3rZqeOT8rX5wyxIPr90u9nRF0ymVX55mSlZ2ltuFg==; 5:0Qn10+uEk0lHLgrAtm5ke92gwdPOeCJLZxVd4NaTKdSJwBFIPCxiZ5xl4g8de7Rx1DagA/dBFCfi5OQMnwGNqcEwN3g6xkafibLaQ25VyrCeCHescKn1h7lLEKlh1QHjvkMLRxXsYt/C5pWY0kdcZFm8qZGQd8s+votRNyxT7fc=; 24:VsHSccDD7xSWcH5uN3F2unOGP85yxl3goKerX2YNPP/DvaVGcRl5L4Rv+LhOETguYs9PweMjxIA4tnrAL77PD4G4I3Cq+Tcbg07eDSl/3M4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB2366; 7:kZ/ZtTKMLBJmPvWHYUPXd/1q6XMtTOwXNmNdJwifzdzMA2i1SammSNQSMGoj9SWk+rM6ab21JxHruD/FWPegh6AwR0UfbJELAazuzjhOvp7bhyjkGBog5nLoMYPsl7CuhF0Qh7/ClgXc7A8eqWGtT5UVax75pD70ntrQAYnbghV/Nt8JcdtdI8mfOHowjf1bcEDPnhVwKJ/uVKCfJVXiTfwHbKv6Qz1Kp2YjK8mfw/2srid8JFGsmujajS+jqYEb X-MS-Office365-Filtering-Correlation-Id: 24f58d7f-5559-48b9-1f03-08d5aac906c5 X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2018 16:24:32.0899 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 24f58d7f-5559-48b9-1f03-08d5aac906c5 X-MS-Exchange-CrossTenant-Id: f267a5c8-86d8-4cc9-af71-1fd2c67c8fad X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f267a5c8-86d8-4cc9-af71-1fd2c67c8fad; Ip=[208.19.100.22]; Helo=[AVMBX2.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2366 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP commit b60710ec7d7ab ("aacraid: enable sending of TMFs from aac_hba_send()") allows aac_hba_send() to send scsi commands, and TMF requests, but the existing code only updates the iu_type for scsi commands. For TMF requests we are sending an unknown iu_type to firmware, which causes a fault. Include iu_type prior to determining the validity of the command Reported-by: Noah Misner Fixes: b60710ec7d7ab ("aacraid: enable sending of TMFs from aac_hba_send()") Fixes: 423400e64d377 ("aacraid: Include HBA direct interface") Tested-by: Noah Misner cc: stable@vger.kernel.org Signed-off-by: Dave Carroll Reviewed-by: Raghava Aditya Renukunta Reviewed-by: Brian King --- drivers/scsi/aacraid/commsup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 0156c96..d62ddd6 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -724,6 +724,8 @@ int aac_hba_send(u8 command, struct fib *fibptr, fib_callback callback, int wait; unsigned long flags = 0; unsigned long mflags = 0; + struct aac_hba_cmd_req *hbacmd = (struct aac_hba_cmd_req *) + fibptr->hw_fib_va; fibptr->flags = (FIB_CONTEXT_FLAG | FIB_CONTEXT_FLAG_NATIVE_HBA); if (callback) { @@ -734,11 +736,9 @@ int aac_hba_send(u8 command, struct fib *fibptr, fib_callback callback, wait = 1; - if (command == HBA_IU_TYPE_SCSI_CMD_REQ) { - struct aac_hba_cmd_req *hbacmd = - (struct aac_hba_cmd_req *)fibptr->hw_fib_va; + hbacmd->iu_type = command; - hbacmd->iu_type = command; + if (command == HBA_IU_TYPE_SCSI_CMD_REQ) { /* bit1 of request_id must be 0 */ hbacmd->request_id = cpu_to_le32((((u32)(fibptr - dev->fibs)) << 2) + 1);