Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1065943ybl; Wed, 14 Aug 2019 10:09:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqydxzQrmSZ2AmcEySGyLyq5cB9h+LNOcP38UV0obB5RBHocQtzYB6vKXcKWaUHlBI1+t9ZE X-Received: by 2002:a17:90b:d8b:: with SMTP id bg11mr761272pjb.30.1565802565281; Wed, 14 Aug 2019 10:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802565; cv=none; d=google.com; s=arc-20160816; b=Uz6Y4/fMSqIY3wn06TT1i+KQfSH4Kpwn9gzhh/TSX6BHEUFBe7tVzLp4FDl4NQ65sg lBbwy0HtzlXuN2UozlbwKgtECzWlmCDvPXWvwNCWWLbnBFuF2js+oc0O5cD29sofW6sB ERmkcT+lw3BoaLD/cL2hH7jzdrBctCXYOKLkMk5JxcsjGiXX5XCsw3eeSEehF0X3CL2C DBXPKR+qFObYncZaBllP7w7o5B+a/tNGxOTe7UNSXy/JchuT/PnD/QRs+yWKFVjWx9yp lrEWLcEc+yGTj/X6lpd2dTedVNVQP0jikXuwP6suBSeHE8CvR2c9wJaICzJx5lrwD+fX 6JVA== 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=XDaf3iQ4+0LHOa0MWAKiAE5fQUmZKF/DoipYwb/AD+I=; b=leANbETJbS2oLltjk92QV7pPVq/RGZao8bHG3vnUKWd4Kznr9cS7QhGy79HrH2oeVV bJmJr1LgVHGmjr/D+D38nxHOKmw6jBvCvD40FneexOrcxF5dojCI5kIVTyrFHlUKaIpu k2C7Pwc4VMtgPHAPaB1yN5DQVhQieMjp9ZdcNH8IeCzoPV4rOKITCxkS1sJ2bqIdLAVy SXI7q9LlbVLBavqCOg5qTzQ650IOXZ0LqQO+Rvkv+sZRmHFYrzN69MtY4EFO3Q/rZA6R 1/Of5wfMzYLJwLR/BvZfTTDx+yaNwbhUA5b08Xai7vFXq2y5TuJnNhCNxSHrapYqmXoo OQFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NkxKvv5o; 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 c67si58249pfb.211.2019.08.14.10.09.08; Wed, 14 Aug 2019 10:09:25 -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=NkxKvv5o; 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 S1729240AbfHNRGh (ORCPT + 99 others); Wed, 14 Aug 2019 13:06:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:55748 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729687AbfHNRGe (ORCPT ); Wed, 14 Aug 2019 13:06:34 -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 29BFD2084D; Wed, 14 Aug 2019 17:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802393; bh=C2vs5veVVQl4m5EUzEISRy7dfJk4KURDdHDXOBFQgVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NkxKvv5odm7c3lskFut388W8AeGdVcd2EHHZJ7k520fC48j6dJT8bYDIjvMKcDY0d n1Ob8uDcPzgbHZ+O1Mu3WKBTn6RTfbFlWajKjlYAoiwXSa3HGplHX1xdbZd8cCFssN 10/8CoXSMgVP3/3iTjjFnjQpAQZ61uPqRwCPwCeo= 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 5.2 108/144] scsi: ibmvfc: fix WARN_ON during event pool release Date: Wed, 14 Aug 2019 19:01:04 +0200 Message-Id: <20190814165804.426458084@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165759.466811854@linuxfoundation.org> References: <20190814165759.466811854@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 acd16e0d52cfe..8cdbac076a1b6 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -4864,8 +4864,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