Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1071011ybl; Wed, 14 Aug 2019 10:13:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOC26QSvyIEBC+elDkQ53Sw6naAe30FIDvdUClgB2o9JF3/GCDI09pldnvzDdBQ76AcGLL X-Received: by 2002:a65:464d:: with SMTP id k13mr169240pgr.99.1565802819237; Wed, 14 Aug 2019 10:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802819; cv=none; d=google.com; s=arc-20160816; b=x63Ys1J/ab+9kdTL/jCggCWSlj+uALDEmyTuynXVulfQyt6UmDKWfoumNiliSJJaeh jRBVSCGcQ5PL9iPsbs4wV/spIJ32ot9n9xYDoqxbQvuiAUnTy09Eq/awXYz9LOaFc1MG 0W3OWwC6vY+oPVf+YHM2oHSPLNBSs3m8ymDWsc3JU9bYx3awBetgH9Q92rN5hXZs1yGC NTCPCtrLtpH1wGZWrPZCn3VYZctY5H6AvHQ40C0u8+x+viIM9gF7a8uQotTxbBoEpwu1 APXby1Ha3EIzPNHb7VkcvAZR48YSIzsRWRFWkPu3udpgC4kYTskcnCjOG3plPJ5hsFVR 5r/A== 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=Y8dzfLayYqcA49kRc+23IeTOb7P2DhJyPoKn8UyTIVQ=; b=z4MbQMFAo0FAv6rTwMG901HveO0F5uAX0YzyQBtyZ4MDpLWVJXMwfaA+c1SuFm4gkt jrKPymEJX6MZ0y/PGTEO26IF3h93eUUbXxcV8g0+MLoleE5IBrkKp7Rel9mCm85jbJ+7 pBXYjrehg1b9pFLQL2WSY2gu8KOTyPQEPKQ93cQV09l3u5uvF/zADX/gGCflzzo2o2Pb l+GN7h/UYYzYmKublwTkLetZXnObtzIB05o7cKDvPlORZnY0qmIe0VFWfhcqKb4hdLGJ S3hlz7+gJevhOeawy9eoPdeMlUTFDNFfhgO0ANQ4hO+VQkMrt2JsTbkNxVccV+4D8UfE bPyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="B/yX50uH"; 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 z35si193547pga.42.2019.08.14.10.13.23; Wed, 14 Aug 2019 10:13:39 -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="B/yX50uH"; 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 S1730620AbfHNRLi (ORCPT + 99 others); Wed, 14 Aug 2019 13:11:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:34986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730605AbfHNRLg (ORCPT ); Wed, 14 Aug 2019 13:11:36 -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 97F6D20665; Wed, 14 Aug 2019 17:11:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802695; bh=a4T1BuU92elMJ7DDD7qk14qK0qAgjGt6b04cYK53+rk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B/yX50uHMveYhy/cM99H2dH7X7cCciRJgaLNX6ITZeij4JtMQ75ts8LEamsBnBw35 bJLxrDBDl8YVqgg53v6oiyigthvhs6agebz5zVC3ZweElnz0YYwY7iCoQBeUg0s2Zu NVYEpm5pCNhNrCGUix5DogHtEG80ecN/6N/5HAxo= 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.19 64/91] scsi: ibmvfc: fix WARN_ON during event pool release Date: Wed, 14 Aug 2019 19:01:27 +0200 Message-Id: <20190814165752.335067644@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165748.991235624@linuxfoundation.org> References: <20190814165748.991235624@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 b64ca977825df..71d53bb239e25 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -4874,8 +4874,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