Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp279093ybi; Wed, 29 May 2019 21:15:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZxl+AkTWwVgCOcTnRsVEgn2I9UjFR6pn3E0jOxPggaKf6hTFo0KwQRZPeOx7BdOevgPQz X-Received: by 2002:a17:902:e40a:: with SMTP id ci10mr1882021plb.195.1559189729461; Wed, 29 May 2019 21:15:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559189729; cv=none; d=google.com; s=arc-20160816; b=awCGz6Q5EQuhKEhsNzjwjGZmnzgu/5rloRIHzCbMQlzNbhVQQ4NvGIe4EHErbsX8rs /Qy5CN/Wn/xdzUdjxKkEb7nI9S+JAw+ERWevRuRc73/HAFbGHAhZwqs5urDKpqME33UU nOlY+RUJ6qHOAQwKAdwJRCai6kM8wOEQEr8FQGJ0BVxmkjALyPHLCXVThVkyt9zQ/a8v C/lCZUhoUHhcmrnLQpRnZzKBuqGVvpASemjP9jpEV0eYWElCsMzPvJBZXKWgqbtXOwfE bww+cw/ac1g9i9bvobc3LJAYdTNwnKCqAK5MkpFCU75PZdnBPan6abSGjNuIZHIRQSYC wm9Q== 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=jbr3NG3ROvwrXH15GS3Qgf0NzEw2bIuvw68v5s4IBoE=; b=Wk85aSpcMlQG7qKGuC3f/NKKpYgTZ0AUljExIC0I15uaZV1kLHmMK1xyqRo9TVG+u7 NjoErJ68o3Bl5iYZvkKiArdYj5uwPuFe1QgC1n1F9CwgjZc2Xh7THcJ4bTZ3OwRSbBlS ciqPyMURPzd98xE2IeZcb+GQD6JlJLJuA1nVdMgMrx9lDAmmQYf/puhHlP0KU7GnL54E zsZOGQ9chlPBbSEFCHHl525fHsC+0utH5pQNvAQJ4Yon47aeck/Qu39zrp/8Pz8F3GG7 +gSpQ13Zzg+S+Be6mW62U24nP/twKMj77je62EyOCl7gg/v6By+zfJHJp0DxuY+G3CGV R4QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xKnP5yrQ; 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 14si2372935pfw.143.2019.05.29.21.15.13; Wed, 29 May 2019 21:15:29 -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=xKnP5yrQ; 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 S1730695AbfE3ENB (ORCPT + 99 others); Thu, 30 May 2019 00:13:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:42566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730671AbfE3DQ0 (ORCPT ); Wed, 29 May 2019 23:16:26 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (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 BBCDD245DF; Thu, 30 May 2019 03:16:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186185; bh=VEZpUIdlXjhf23J0PQHrbPeW73H2jqsEXS2Vwuma1lw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xKnP5yrQ/JxZORrQV5/hDw60ckGALYbdwvPkxZH9riO2/NnQbtqe/ZoYVmiOWCgqq pe74eZlDPA0Ev6psGhkMDC5L40CFIy4GHc/QUg6Cy7vZSQYVecpKte8/p0bikHm8zo I1YnVoCcYUMjDDdoah7KrRj2sa3BHeMPJ1ppPGq0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sameer Pujar , Jon Hunter , Vinod Koul , Sasha Levin Subject: [PATCH 4.19 053/276] dmaengine: tegra210-dma: free dma controller in remove() Date: Wed, 29 May 2019 20:03:31 -0700 Message-Id: <20190530030528.440186289@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@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 f030e419501cb95e961e9ed35c493b5d46a04eca ] Following kernel panic is seen during DMA driver unload->load sequence ========================================================================== Unable to handle kernel paging request at virtual address ffffff8001198880 Internal error: Oops: 86000007 [#1] PREEMPT SMP CPU: 0 PID: 5907 Comm: HwBinder:4123_1 Tainted: G C 4.9.128-tegra-g065839f Hardware name: galen (DT) task: ffffffc3590d1a80 task.stack: ffffffc3d0678000 PC is at 0xffffff8001198880 LR is at of_dma_request_slave_channel+0xd8/0x1f8 pc : [] lr : [] pstate: 60400045 sp : ffffffc3d067b710 x29: ffffffc3d067b710 x28: 000000000000002f x27: ffffff800949e000 x26: ffffff800949e750 x25: ffffff800949e000 x24: ffffffbefe817d84 x23: ffffff8009f77cb0 x22: 0000000000000028 x21: ffffffc3ffda49c8 x20: 0000000000000029 x19: 0000000000000001 x18: ffffffffffffffff x17: 0000000000000000 x16: ffffff80082b66a0 x15: ffffff8009e78250 x14: 000000000000000a x13: 0000000000000038 x12: 0101010101010101 x11: 0000000000000030 x10: 0101010101010101 x9 : fffffffffffffffc x8 : 7f7f7f7f7f7f7f7f x7 : 62ff726b6b64622c x6 : 0000000000008064 x5 : 6400000000000000 x4 : ffffffbefe817c44 x3 : ffffffc3ffda3e08 x2 : ffffff8001198880 x1 : ffffffc3d48323c0 x0 : ffffffc3d067b788 Process HwBinder:4123_1 (pid: 5907, stack limit = 0xffffffc3d0678028) Call trace: [] 0xffffff8001198880 [] dma_request_chan+0x50/0x1f0 [] dma_request_slave_channel+0x28/0x40 [] tegra_alt_pcm_open+0x114/0x170 [] soc_pcm_open+0x10c/0x878 [] snd_pcm_open_substream+0xc0/0x170 [] snd_pcm_open+0xc4/0x240 [] snd_pcm_playback_open+0x58/0x80 [] snd_open+0xb4/0x178 [] chrdev_open+0xb8/0x1d0 [] do_dentry_open+0x214/0x318 [] vfs_open+0x58/0x88 [] do_last+0x450/0xde0 [] path_openat+0xa8/0x368 [] do_filp_open+0x8c/0x110 [] do_sys_open+0x164/0x220 [] compat_SyS_openat+0x3c/0x50 [] el0_svc_naked+0x34/0x38 ---[ end trace 67e6d544e65b5145 ]--- Kernel panic - not syncing: Fatal exception ========================================================================== In device probe(), of_dma_controller_register() registers DMA controller. But when driver is removed, this is not freed. During driver reload this results in data abort and kernel panic. Add of_dma_controller_free() in driver remove path to fix the issue. Fixes: f46b195799b5 ("dmaengine: tegra-adma: Add support for Tegra210 ADMA") Signed-off-by: Sameer Pujar Reviewed-by: Jon Hunter Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/tegra210-adma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c index b26256f23d67f..08b10274284a8 100644 --- a/drivers/dma/tegra210-adma.c +++ b/drivers/dma/tegra210-adma.c @@ -786,6 +786,7 @@ static int tegra_adma_remove(struct platform_device *pdev) struct tegra_adma *tdma = platform_get_drvdata(pdev); int i; + of_dma_controller_free(pdev->dev.of_node); dma_async_device_unregister(&tdma->dma_dev); for (i = 0; i < tdma->nr_channels; ++i) -- 2.20.1