From patchwork Fri Jan 30 06:06:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viswas G X-Patchwork-Id: 9922539 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 016AA600C5 for ; Fri, 25 Aug 2017 17:12:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE44F28414 for ; Fri, 25 Aug 2017 17:12:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D361428419; Fri, 25 Aug 2017 17:12:21 +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=-3.5 required=2.0 tests=BAYES_00, DATE_IN_PAST_96_XX, DKIM_SIGNED,DKIM_VALID,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 762EB28414 for ; Fri, 25 Aug 2017 17:12:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755888AbdHYRMU (ORCPT ); Fri, 25 Aug 2017 13:12:20 -0400 Received: from mail-co1nam03hn0228.outbound.protection.outlook.com ([104.47.40.228]:26624 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755814AbdHYRMS (ORCPT ); Fri, 25 Aug 2017 13:12:18 -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=rzt1dcPtDBmahBDXm7E5TjZ/B9X2n+a1rzRQsIidAh0=; b=GMnW4d4oJu2hnoDhzFWXBW5HpNKlKBZ+LdIgz5ANL0Mh7L90SOYX1Z7CPwnIef9cr4qqyr/qeI4riMtnhNNh+kfQmDN26F7/IGJAWbWbys++QROg5hUG7GNJu1f0EMVgR8RfIfURpMR3Z8LKWPxZDnl8bgsXDW5PTIQFA01sIoI= Received: from BLUPR0201CA0004.namprd02.prod.outlook.com (10.163.116.14) by BY2PR0201MB1445.namprd02.prod.outlook.com (10.163.153.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Fri, 25 Aug 2017 17:12:16 +0000 Received: from BY2FFO11OLC014.protection.gbl (2a01:111:f400:7c0c::143) by BLUPR0201CA0004.outlook.office365.com (2a01:111:e400:52e7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.8 via Frontend Transport; Fri, 25 Aug 2017 17:12:16 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=bestguesspass action=none header.from=microsemi.com; Received-SPF: Pass (protection.outlook.com: domain of microsemi.com designates 208.19.100.21 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.21; helo=avsrvexchhts1.microsemi.net; Received: from avsrvexchhts1.microsemi.net (208.19.100.21) by BY2FFO11OLC014.mail.protection.outlook.com (10.1.15.48) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 17:12:16 +0000 Received: from localhost (10.187.72.81) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server id 14.3.361.1; Fri, 25 Aug 2017 10:11:55 -0700 From: Viswas G To: CC: , , Subject: [PATCH 5/6] pm80xx : panic on ncq error cleaning up the read log Date: Fri, 30 Jan 2015 11:36:44 +0530 Message-ID: <20150130060645.23653-6-Viswas.G@microsemi.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20150130060645.23653-1-Viswas.G@microsemi.com> References: <20150130060645.23653-1-Viswas.G@microsemi.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:208.19.100.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:SPM; SFS:(10009020)(6009001)(39860400002)(2980300002)(438002)(199003)(189002)(104016004)(47776003)(97736004)(305945005)(50226002)(69596002)(76176999)(8936002)(77096006)(50986999)(36756003)(110136004)(107886003)(575784001)(68736007)(86362001)(478600001)(626005)(39060400002)(48376002)(4326008)(1076002)(2950100002)(76506005)(106466001)(2351001)(57986006)(189998001)(5003940100001)(6916009)(81166006)(53936002)(2906002)(6666003)(81156014)(5660300001)(356003)(54906002)(8676002)(50466002)(5530500006); DIR:OUT; SFP:1501; SCL:5; SRVR:BY2PR0201MB1445; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC014; 1:E5IPjiwnN+h8GRQRcNpzVB6Z653z/nEFdR9baOoJe9kieguWTew4b3AEHjojr/639KFU18ahxnt7TSVIyl38ttrUnHLNpYlf56JO5BcT0WwtsKLM3StkeJfnp8PmvL3a X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4ceebb94-fb43-492f-8666-08d4ebdc6f93 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(8251501002)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BY2PR0201MB1445; X-Microsoft-Exchange-Diagnostics: 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1RsLYhXJYrNFhGe27DxwrqJsfYQ0mI3Jp9UmXPIvI2KdLHr9+V4xi+mCgZIkPgNxYjdZxSE9R3J8LOKOoPqh+LZ3LozUTVRQnjcbe8+yILTi85EvXXDW+BFDmWVNgL52hpaBhTh3wnBGYQOiKN8F0kLNy2bZYvbLEhp16UmvJVg1kkQG0KxeTedjB0jUe81Gd1aEbT7IMLuD6RYn5x1Th5bDH/R1QT1hfAqO3eNTLpyimomBaoeOGPeIcbyhiqz8McWXgEJhPQjEljrkJLeLYuTxCj1UbASWPCeIygM3Tsh2du8dviwRMKDbtiE8V1wWnGAcr1knO9LVM/O4kF0voI5vcfnMhSCka+0J1x9bgP2LT6WjrqZ/Gi1AAFCbrxsocjqHaC0vCMBV+MLxR4hATOnXjZrvZkDSbKVHbQ2lkV+LCkiC7Fhv/6Fv6GwWBxGgGDtLIEi0YCPrmFN0RnY48W9QTeIa X-Exchange-Antispam-Report-Test: UriScan:(72170198267865); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(13018025)(8121501046)(13016025)(5005006)(10201501046)(93006095)(93004095)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR0201MB1445; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR0201MB1445; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1445; 4:hI3PBOp+g4wvgpji5nBSGNG8Ry5mbiac0/g0Y8PSoW03llhploQEAg82ejQFH2UxTiAUOpg5TsCSOzPE8DPUdMa7hnGU4P2lx4dj4lHB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ntJaUFa9qnOfjBpv03fYYpWo8O5yu4pDh44YfiVDioQV50V?= =?us-ascii?Q?GNUSsFxRgYisZdbg3mN/KMXKg5JvdBu3cDsgKJfIf973BkBBLxSIUrJ56M+k?= =?us-ascii?Q?NDGkxt2DF8Ujsfv6d5TmLKICbINByMvG2mk/4CQcCBB+lqY9PLOMetvp8K6j?= =?us-ascii?Q?Fs75O25Ixyhj72anzmXzW3b5nh4e7iLQ8968+BrMpbhNgxjtBJ6YmoE657HU?= =?us-ascii?Q?cyi183atB3AQvnWKG1lPN91MIsfui+lQs5CbyFWwDxY2sPTdQh4+p0UCJbda?= =?us-ascii?Q?gnsOc++obqTMT1G17MDgdCvjTbdLn2GRuZpOWUKnFWG9qN6c5VXdzcNbYa2z?= =?us-ascii?Q?vVbFBVraiyxakwxxOYUe7zDnClGZtTMGOW4hDyh1Q/J+CMHbajDpkWThTLD9?= =?us-ascii?Q?KaA+02Cazrmd/MW6HQUPxaEhrWthkri43cK3QZO2vMby/pw2CR7pvrVmyTfF?= =?us-ascii?Q?iAUnADE+SkzyqRY2GOroK20pjrzZDfPTY9pH4x+Y9mHTGDAC5yIwbNQ2oCxZ?= =?us-ascii?Q?OFEp08Dp05NzhFv0=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1445; 6:RdJ9alItvh98tmiXYFKIrWjLV+YDkgGoCW04fvmM1ek4UFecWDD2V2ysEUhNJu1+SSZdJXe184l4i//IiFkk4wf3u3/jYuFieU4eosLuLXY2Lvy9fjJYMN2etm28wuLACjqYiUYlgJLotkjZ+VXNRjOXW8CdyVRadiYaI93LnYiT3nVFucDJ9jSQ8uJDMjhuMSst0polAK2rtaa+GHVbNKtB7kcMSKQcPjf6oMsWK/S02SDeDnaOeH8glbPihHXNunOLSGEZcx4GggerFD7R3scCQen8sx2YXeryP9AES+3tmQGuuOsHIMyUkNX5emwa/XWhH1KMH9gKjtJnnSCK3A==; 5:yOjpxkTjZyPlR2vhNDU5JdUCPLOpyhxnFJudEZ8f/ZgCBVq+3B9J/Su/9g2FCR9+ZUJk8aDaozVRpXHWdtkIGiK/dVTtvJXimL6Li00fAirom0krxRkNqpxjKtnzX5lMbBuC7RNfnaLAE7YwnCjMfg==; 24:IDO19d1kziQdDwjJLi4QXq41LI3y1vbX1WJB5PC+MIrNrbbPtzwi66QowcBpSlknAl7fgJwy8POcBpPJ3FkjIA==; 7:Fh7BPPs3QBwizQXspfNVpfG5aHOTLBmWZbU8r7oaq4N4maqK2DyAWl+SSJDxw1m/dB+gFruER/PVLGvntkTxFg04ako+GUPvbXgofVMCdSAnBCRD4V5kk3eHh0k8EZLJPix6CNEP32/td7dO+DLm0Pa0lzXnLyNMlnU+ujC/m/A3WaqMmHfEqtzTw75B9gxlo7T482MwfQ3rqnZjH/QTLpqIkAl+440NdNw25KSxX7Y= SpamDiagnosticOutput: 1:22 X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 17:12:16.1014 (UTC) 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.21]; Helo=[avsrvexchhts1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0201MB1445 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 when there's an error in 'ncq mode' the host has to read the ncq error log (10h) to clear the error state. however, the ccb that is setup for doing this doesn't setup the ccb so that the previous state is cleared. if the ccb was previously used for an IO n_elems is set and pm8001_ccb_task_free() treats this as the signal to go free a scatter-gather list (that's already been free-ed). Signed-off-by: Deepak Ukey Signed-off-by: Viswas G Acked-by: Jack Wang --- drivers/scsi/pm8001/pm80xx_hwi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index ae9252cf1706..e75b0aa497f0 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -1489,6 +1489,7 @@ static void pm80xx_send_read_log(struct pm8001_hba_info *pm8001_ha, ccb->device = pm8001_ha_dev; ccb->ccb_tag = ccb_tag; ccb->task = task; + ccb->n_elem = 0; pm8001_ha_dev->id |= NCQ_READ_LOG_FLAG; pm8001_ha_dev->id |= NCQ_2ND_RLE_FLAG;