From patchwork Tue Sep 19 17:10:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viswas G X-Patchwork-Id: 9959705 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 BA5C96056A for ; Tue, 19 Sep 2017 17:11:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A503028725 for ; Tue, 19 Sep 2017 17:11:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A034E28EEF; Tue, 19 Sep 2017 17:11:08 +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=-6.9 required=2.0 tests=BAYES_00,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 1D49B28725 for ; Tue, 19 Sep 2017 17:11:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751519AbdISRLC (ORCPT ); Tue, 19 Sep 2017 13:11:02 -0400 Received: from mail-by2nam01on0079.outbound.protection.outlook.com ([104.47.34.79]:19520 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751001AbdISRKk (ORCPT ); Tue, 19 Sep 2017 13:10:40 -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=mwGmbJ2LgbmvjZlASWZbch+a0FMn8d/HbMahGXhOvXw=; b=GHn6ID8502Ra62yx44R/qQkyZVkHE7cqQg6Pt8qH4paSpBtfa6Q3sEW68L1zaG+bvb63WZeXOWWXQ1dMSme0+nwPQ2y8akUBSOziXG1hGR2j/MgMLjyZJ8ErC6hoxUYDaaa1C+KgNEAYGKW7XBC3UzTiYMMYE/Otf0Cvj5mJD0I= Received: from CY4PR02CA0022.namprd02.prod.outlook.com (10.169.188.32) by BY2PR0201MB1448.namprd02.prod.outlook.com (10.163.153.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Tue, 19 Sep 2017 17:10:39 +0000 Received: from BN1AFFO11FD046.protection.gbl (2a01:111:f400:7c10::145) by CY4PR02CA0022.outlook.office365.com (2603:10b6:903:18::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11 via Frontend Transport; Tue, 19 Sep 2017 17:10:39 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) 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.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 BN1AFFO11FD046.mail.protection.outlook.com (10.58.53.61) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.35.14 via Frontend Transport; Tue, 19 Sep 2017 17:10:38 +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; Tue, 19 Sep 2017 10:10:20 -0700 From: Viswas G To: CC: , , , , , Subject: [PATCH V3 8/9] pm80xx : panic on ncq error cleaning up the read log. Date: Tue, 19 Sep 2017 22:40:03 +0530 Message-ID: <20170919171004.10331-9-Viswas.G@microsemi.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170919171004.10331-1-Viswas.G@microsemi.com> References: <20170919171004.10331-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:NSPM; SFS:(10009020)(6009001)(376002)(39860400002)(346002)(2980300002)(438002)(199003)(189002)(8936002)(356003)(8676002)(53936002)(305945005)(48376002)(50466002)(6666003)(86362001)(6916009)(2950100002)(54906002)(68736007)(1076002)(316002)(16586007)(478600001)(36756003)(97736004)(47776003)(81156014)(81166006)(2906002)(50986999)(76176999)(4326008)(5660300001)(77096006)(5003940100001)(106466001)(50226002)(189998001)(76506005)(69596002)(2351001)(104016004)(57986006); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0201MB1448; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD046; 1:xLJsaZ6L+f/kzid0LD166KcRfDwKw1M6QECILDVzn1gFgHN+dZ00RLVA2yBW6TFzV1N4FCvYNR3fEpSf6tfjPX89AdYHi94JvB0r9hmVgX3+dk9jdROYtCCEf2pjTgoF X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 76e2bf36-d8ba-4d6d-7543-08d4ff8159ea X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(8251501002)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BY2PR0201MB1448; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1448; 3:UJxmpUn2d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vrqrzEIYJ/dZMygmGQv3Vdt5MyHz+/1HBG7G+0wf61KrDsbJNCeA2m/fAzmFJ4AgEMHRJTNtej2c9iC+YNIqAxvqFzMcmfNCOU1HBzQ4VnKC43VYZwNqojh/ywwSfofPJU62c7MksSqfxcR0z+F0n76tB5adNPM48HnMlN/VoJ6ELEaW5Qa2Dh5CLMmSqixri4csEDm+2tZa3Dx2Nm2lrTn9QoHl82Ss7DUqmZoRxe4Ovw2M6wZNQAcUAJmQgyDqSWicEKJRciT3PUx2CpndLUS4pl++cXd48M38S979gVSCxlGK8/qh2LT6H8mLSyMcmZqiJyuiwwvFjhpzPbnE0ezRkGFzpxLL9Pf1qYdLz7C9j9PxpkG+Q7z5NJqllS2gdkiEGTiZLPTC2Ur6jJefaYpeV+vvgNcztBWx+ZI0rjTWnBPnOuwpcvDe1bhEMsRccWI2Dd2b89b5 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)(2401047)(8121501046)(5005006)(93006095)(93004095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR0201MB1448; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR0201MB1448; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1448; 4:B+kPFQFUabrl0BKRnWpsUHP0VrB9InR15t9ttdYc27R2CsQ2VwwL783FIaHHQVHj1qWv94nLAjxm1zs0ckQdspmWbaurTrQaruKHpJW/rN5M/9TKhr0u+h3et47Gj2U42nj8v7KmDoq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W5kPd152qbGheaG5yMv0+41RchK6n3FnjkxJNFwZXi1BTDM3AK5cBvLY+Zx9tLvudcpLT3tY1yUtXhP7rjZjYOEp24WWA=; 7:gNzoerbGo4yPRkpdBOWjBi0nZEyPnN3s82iKCUIE1SjMN5F+vo4yz3YQPqVcFeDOymzgERTx/iXY3M9+zkkumCKZoem0JlmxfZt0ILiIWp196AOXcHzzIDANcUwNEELgqBlqhtutJqmze8DoO+D0dkTvoIZe0jQ1h510rq6LBd0JuOnQEStynf4ZYBuKQGkRk8bOHxRi+h/LSy045aUoHvUv0KRbyNCqEGvAL32yeqc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2017 17:10:38.6896 (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: BY2PR0201MB1448 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 92d2045dea68..f2c0839afbe3 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;