Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1074123ybl; Wed, 14 Aug 2019 10:16:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKnganzkm4x/FandXZgeF1mV1HaP763rAppV82waSIB/NLKomtzC5oUoItiXEPYNSj6WR2 X-Received: by 2002:aa7:9a12:: with SMTP id w18mr1085878pfj.110.1565802988553; Wed, 14 Aug 2019 10:16:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802988; cv=none; d=google.com; s=arc-20160816; b=ErKbm3FeLGQtG57wdu9fpkr/WTOh5mvRYCAqeqPkOrczQ4K9UVp9OJbPkZsk95qgwK qRiA9icphq/NU+rEF9RZ9oSQEk75ZBfp7tpjIRDCAZFxE4SwvU0VACi78NogaSB4i3fM ewCC+OJbQ4spuE1iK1g0zDEqXzAWwY9yDIEMo509ZZOrQPRPhmn7pMHWEdaG6abdM/ID 5rQE7iY+7XGhNEz46QEYH5jrN7Ry11sT0JINhnK6vE9g2nJKdqh0phpMBQ5EbcbX68rV TeSJPJKNX5l8s9PlX0YNdm8k+eB9p9C0UruTXQ1bDZwIEa0ZDdTyvw84SCyKaZX0/a6t zDtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6D9SvyVpAlkFPd4fKvIP8/IDfRWNIe4c945hbPqJmNM=; b=lQzfWMF7UrspOCy8fN2snS1mFWN1FDhOZpTAeb/e+BQsvmd+nQy/swnF3ThFYZGfCC v2EbBerpaWRs+jGnqU+6Eo3SGhQjzfqjAlZ+Fb9tpqUut1CxzhRnRr2Bf4aVgAkzXgaQ U1kbNsLycMa7jyR5bHZ8rZj+ZFxaZWmWIiBMPxqBYuD1SshxSPPHua5Y92pmt4fezzF7 SjyQi9HBTOCth7OJB8ergnuI8tkoblr7dHePCvbtG6CWbf83gOQaBEw0ImmPi6ljMhSN qes56CdoZhjyETLUnGqXoW6Zx91/KrSKYSKMhkHkLHDVpTsI/MN6VBCzvit4/FuOTDCU IiFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jH9ASQUv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d18si210081pjz.58.2019.08.14.10.16.12; Wed, 14 Aug 2019 10:16:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jH9ASQUv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730739AbfHNRPg (ORCPT + 99 others); Wed, 14 Aug 2019 13:15:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:39688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731179AbfHNRPI (ORCPT ); Wed, 14 Aug 2019 13:15:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9278D2063F; Wed, 14 Aug 2019 17:15:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802908; bh=+c1bQtgSvvbVzC97PQpwXiYwGEcVTYMTcvVyHUkkiT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jH9ASQUvz0ZKs5VAI6spmLqiIqqZqd8blrLLgBZt/MrWE5OcEvI6rGTtVvdW9nWXv KP6jin/9Kx05TRmDhfaSKyrjmmgjX7/Bz+lyk+AqeIS/MO8d395qeu6o3ujy6Z6mrM KkugRGnBsibFdkjd6n+NBnGR7vUdQYfs9wmpJovM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Abdul Haleem , Tyrel Datwyler , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 46/69] scsi: ibmvfc: fix WARN_ON during event pool release Date: Wed, 14 Aug 2019 19:01:44 +0200 Message-Id: <20190814165748.572922019@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165744.822314328@linuxfoundation.org> References: <20190814165744.822314328@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 5578257ca0e21056821e6481bd534ba267b84e58 ] While removing an ibmvfc client adapter a WARN_ON like the following WARN_ON is seen in the kernel log: WARNING: CPU: 6 PID: 5421 at ./include/linux/dma-mapping.h:541 ibmvfc_free_event_pool+0x12c/0x1f0 [ibmvfc] CPU: 6 PID: 5421 Comm: rmmod Tainted: G E 4.17.0-rc1-next-20180419-autotest #1 NIP: d00000000290328c LR: d00000000290325c CTR: c00000000036ee20 REGS: c000000288d1b7e0 TRAP: 0700 Tainted: G E (4.17.0-rc1-next-20180419-autotest) MSR: 800000010282b033 CR: 44008828 XER: 20000000 CFAR: c00000000036e408 SOFTE: 1 GPR00: d00000000290325c c000000288d1ba60 d000000002917900 c000000289d75448 GPR04: 0000000000000071 c0000000ff870000 0000000018040000 0000000000000001 GPR08: 0000000000000000 c00000000156e838 0000000000000001 d00000000290c640 GPR12: c00000000036ee20 c00000001ec4dc00 0000000000000000 0000000000000000 GPR16: 0000000000000000 0000000000000000 00000100276901e0 0000000010020598 GPR20: 0000000010020550 0000000010020538 0000000010020578 00000000100205b0 GPR24: 0000000000000000 0000000000000000 0000000010020590 5deadbeef0000100 GPR28: 5deadbeef0000200 d000000002910b00 0000000000000071 c0000002822f87d8 NIP [d00000000290328c] ibmvfc_free_event_pool+0x12c/0x1f0 [ibmvfc] LR [d00000000290325c] ibmvfc_free_event_pool+0xfc/0x1f0 [ibmvfc] Call Trace: [c000000288d1ba60] [d00000000290325c] ibmvfc_free_event_pool+0xfc/0x1f0 [ibmvfc] (unreliable) [c000000288d1baf0] [d000000002909390] ibmvfc_abort_task_set+0x7b0/0x8b0 [ibmvfc] [c000000288d1bb70] [c0000000000d8c68] vio_bus_remove+0x68/0x100 [c000000288d1bbb0] [c0000000007da7c4] device_release_driver_internal+0x1f4/0x2d0 [c000000288d1bc00] [c0000000007da95c] driver_detach+0x7c/0x100 [c000000288d1bc40] [c0000000007d8af4] bus_remove_driver+0x84/0x140 [c000000288d1bcb0] [c0000000007db6ac] driver_unregister+0x4c/0xa0 [c000000288d1bd20] [c0000000000d6e7c] vio_unregister_driver+0x2c/0x50 [c000000288d1bd50] [d00000000290ba0c] cleanup_module+0x24/0x15e0 [ibmvfc] [c000000288d1bd70] [c0000000001dadb0] sys_delete_module+0x220/0x2d0 [c000000288d1be30] [c00000000000b284] system_call+0x58/0x6c Instruction dump: e8410018 e87f0068 809f0078 e8bf0080 e8df0088 2fa30000 419e008c e9230200 2fa90000 419e0080 894d098a 794a07e0 <0b0a0000> e9290008 2fa90000 419e0028 This is tripped as a result of irqs being disabled during the call to dma_free_coherent() by ibmvfc_free_event_pool(). At this point in the code path we have quiesced the adapter and its overly paranoid anyways to be holding the host lock. Reported-by: Abdul Haleem Signed-off-by: Tyrel Datwyler Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/ibmvscsi/ibmvfc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index a06b24a61622c..34612add3829f 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -4876,8 +4876,8 @@ static int ibmvfc_remove(struct vio_dev *vdev) spin_lock_irqsave(vhost->host->host_lock, flags); ibmvfc_purge_requests(vhost, DID_ERROR); - ibmvfc_free_event_pool(vhost); spin_unlock_irqrestore(vhost->host->host_lock, flags); + ibmvfc_free_event_pool(vhost); ibmvfc_free_mem(vhost); spin_lock(&ibmvfc_driver_lock); -- 2.20.1