From patchwork Mon Oct 9 11:40:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 115201 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2451664qgn; Mon, 9 Oct 2017 04:40:41 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDPRSDoCAqAeiTlwyOKAnaCHk9CcvclWyLXMKkkEnCgT8y4srB4qeEWH/w400E1KsASbYFR X-Received: by 10.84.201.6 with SMTP id u6mr8766994pld.83.1507549240925; Mon, 09 Oct 2017 04:40:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507549240; cv=none; d=google.com; s=arc-20160816; b=Awc1CcrFn5pa8kqorgp2Dbej4WB/Px3z18LNES4Gbp4q0rz2X0nGMrRZDoEa+ml56i UYuZjxfVExc2HYvR+K2JlykWXTNRJrC7yGFZ/FkPWYqFqGPL2G7e2d3mgXGGddh9Dx3/ WoSlodizVcghb3PUj4ItSSRGxShWzAivq7u5nuipFtaHUQaYAMMnSawQ2KZtCIsfkXRr 6p4FQzqPXcnBSWrQwfQ/eKZ5rG6byejku8vb8ufe6AyXSWMBiRwA4Qu6D7VpPMEmwCue Pn5vHrLNPI244MF3FAiMbzz3nezOAM4VPa4KsGip8xTbkssufx8Hi7awhFCceTNFDMEi Crng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id:date :subject:cc:to:from:arc-authentication-results; bh=SGTYdPVbrkGz7gc4tRMMSW1CpPPRG17vzZazkEA/U2c=; b=Fwl865TO7LVleHTbygBvtvh9OdZjV8xntvds7zdQX51alplFvJaPu7Ct2NG13Ii1wk 2V34a0B1hSYteU1DaUZpeZDK7E7W/bGvk4rOSTcDmFs4thcvaS37TcrYtfWFiuG//Jlx tmX/734SoER2qR9ncGLSNFUYK1i4/1O+SrXAbuKeo/V+7uXt/1XABZuTwbyBV3jLoIDw SNqDehLFrlLIcat3FWOzSvVLTJv8ZHDew8amdx6B5Ha9HHgsI26ZroxSClQBn5S3gSwY yKZFYZWF/a/LUPeoAe5YczwVBVkcA+qJVzHnDwRCduNie10TPCRfEbNoGa/TKdBcB3iy mKMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az5si6457868plb.459.2017.10.09.04.40.40; Mon, 09 Oct 2017 04:40:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751711AbdJILkk (ORCPT + 4 others); Mon, 9 Oct 2017 07:40:40 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:38576 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754160AbdJILkj (ORCPT ); Mon, 9 Oct 2017 07:40:39 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20171009114037euoutp0100ec2fe173ab039d03726c0030eb1461~r5As7BRZn0136201362euoutp01d; Mon, 9 Oct 2017 11:40:37 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20171009114036eucas1p122d48c8710091284278ea99050350486~r5AsQpYj90910009100eucas1p1h; Mon, 9 Oct 2017 11:40:36 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 2C.7F.12944.4306BD95; Mon, 9 Oct 2017 12:40:36 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20171009114035eucas1p102089b889ad374b33c3302f1ad84e783~r5ArnvVX40720907209eucas1p1t; Mon, 9 Oct 2017 11:40:35 +0000 (GMT) X-AuditID: cbfec7f4-f79ab6d000003290-b8-59db60347123 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 4C.9E.20118.3306BD95; Mon, 9 Oct 2017 12:40:35 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OXK00MFV0FJT9C0@eusync1.samsung.com>; Mon, 09 Oct 2017 12:40:35 +0100 (BST) From: Marek Szyprowski To: iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Joerg Roedel , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH] iommu/exynos: Remove initconst attribute to avoid potential kernel oops Date: Mon, 09 Oct 2017 13:40:23 +0200 Message-id: <20171009114023.3427-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.14.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrJIsWRmVeSWpSXmKPExsWy7djPc7omCbcjDa6c57HYOGM9q8WC/dYW nbM3sFucPw8kZpzfx2Sx9shddgc2jycH5zF5bFrVyeYx+cZyRo++LasYPT5vkgtgjeKySUnN ySxLLdK3S+DKWLLoOHPBD5WKM2fXszcwfpbvYuTgkBAwkdgwxbaLkRPIFJO4cG89WxcjF4eQ wFJG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iWXFlbmHGCU4mJVEeJeZ344U4k1J rKxKLcqPLyrNSS0+xCjNwaIkztu7Z3WkkEB6YklqdmpqQWoRTJaJg1OqgVFtyRnXu7+nfv0X 4Lk4/XOlZ6Tz78kigtOf5lgqPC8Ivm9wJWR27m4fIRkWjmOHxG6m5KhmSB05/35Nc8HRiVfn rb5we9kcr9eL5xceY19Teu31BwFzjaRn+Z/62RIZs99prVAV2P25dOvXjpB1J8y1ppy/z6My VdsuYMKBt5l/b3/9esfQK81AiaU4I9FQi7moOBEAzrkcuQgCAAA= X-CMS-MailID: 20171009114035eucas1p102089b889ad374b33c3302f1ad84e783 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-CMS-RootMailID: 20171009114035eucas1p102089b889ad374b33c3302f1ad84e783 X-RootMTR: 20171009114035eucas1p102089b889ad374b33c3302f1ad84e783 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Exynos SYSMMU registers standard platform device with sysmmu_of_match table, what means that this table is accessed every time a new platform device is registered in a system. This might happen also after the boot, so the table must not be attributed as initconst to avoid potential kernel oops caused by access to freed memory. Fixes: 6b21a5db3642 ("iommu/exynos: Support for device tree") Signed-off-by: Marek Szyprowski --- Hi! This issue was there from the beggining of the device tree support, I'm really surprised that it has not been noticed it till now. This patch fixes the following hard-to-debug kernel issue: Unable to handle kernel paging request at virtual address ffffff80090fb018 Mem abort info: Exception class = DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x00000007 CM = 0, WnR = 0 swapper pgtable: 4k pages, 39-bit VAs, pgd = ffffff80097f9000 [ffffff80090fb018] *pgd=00000008ffffe003, *pud=00000008ffffe003, *pmd=00000008ffffb003, *pte=0000000000000000 Internal error: Oops: 96000007 [#1] PREEMPT SMP Modules linked in: CPU: 7 PID: 102 Comm: kworker/7:1 Tainted: G S 4.14.0-rc1+ #4572 Hardware name: Samsung DREAMLTE EUR rev10 board based on EXYNOS8895 (DT) Workqueue: events deferred_probe_work_func task: ffffffc87a7f1b00 task.stack: ffffff8009b88000 PC is at __of_match_node+0x24/0x7c LR is at of_match_node+0x38/0x5c pc : [] lr : [] pstate: a00001c5 sp : ffffff8009b8bba0 x29: ffffff8009b8bba0 x28: ffffffc87ff8fc00 x27: ffffff80095c7000 x26: ffffff80096e76e0 x25: ffffff8008f1e7a0 x24: ffffff800965d000 x23: ffffff800977d008 x22: 0000000000000000 x21: ffffffc87ffcd598 x20: 0000000000000000 x19: ffffff80090fb018 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000008 x14: 0000000000000000 x13: 0000000000000040 x12: 0000000000000038 x11: 0000000000000001 x10: 0101010101010101 x9 : 06fefeff01fefeff x8 : 7f7f7f7f7f7f7f7f x7 : 2f2f2f2f382f3030 x6 : 4354571454455d5d x5 : 5d5d455414575443 x4 : ffffff8009b8c000 x3 : ffffff8009b88000 x2 : 0000000000000000 x1 : ffffffc87ffcd598 x0 : ffffff80090fb018 Process kworker/7:1 (pid: 102, stack limit = 0xffffff8009b88000) Call trace: Exception stack(0xffffff8009b8ba60 to 0xffffff8009b8bba0) ba60: ffffff80090fb018 ffffffc87ffcd598 0000000000000000 ffffff8009b88000 ba80: ffffff8009b8c000 5d5d455414575443 4354571454455d5d 2f2f2f2f382f3030 baa0: 7f7f7f7f7f7f7f7f 06fefeff01fefeff 0101010101010101 0000000000000001 bac0: 0000000000000038 0000000000000040 0000000000000000 0000000000000008 bae0: 0000000000000000 0000000000000000 0000000000000000 ffffff80090fb018 bb00: 0000000000000000 ffffffc87ffcd598 0000000000000000 ffffff800977d008 bb20: ffffff800965d000 ffffff8008f1e7a0 ffffff80096e76e0 ffffff80095c7000 bb40: ffffffc87ff8fc00 ffffff8009b8bba0 ffffff800871acfc ffffff8009b8bba0 bb60: ffffff800871ac6c 00000000a00001c5 ffffffc800000000 ffffff800871acec bb80: ffffffffffffffff ffffff800871acec ffffff8009b8bba0 ffffff800871ac6c [] __of_match_node+0x24/0x7c [] of_match_node+0x38/0x5c [] of_match_device+0x18/0x28 [] platform_match+0x4c/0xc8 [] __device_attach_driver+0x3c/0x138 [] bus_for_each_drv+0x54/0x94 [] __device_attach+0xc4/0x154 [] device_initial_probe+0x10/0x18 [] bus_probe_device+0x90/0x98 [] deferred_probe_work_func+0x64/0x18c [] process_one_work+0x150/0x3dc [] worker_thread+0x58/0x3b8 [] kthread+0x104/0x130 [] ret_from_fork+0x10/0x20 Code: aa0103f5 b40002a0 52800014 d2800016 (39400264) ---[ end trace 4a748776163027e1 ]--- I'm not sure however if it makes sense to add the above kernel log to the commit message as it doesn't directly point to the code fixed by this patch. Best regards Marek Szyprowski Samsung R&D Institute Poland --- drivers/iommu/exynos-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Krzysztof Kozlowski diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index d90cc9f2dd9c..1a7e8c2c89ea 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -740,7 +740,7 @@ static const struct dev_pm_ops sysmmu_pm_ops = { pm_runtime_force_resume) }; -static const struct of_device_id sysmmu_of_match[] __initconst = { +static const struct of_device_id sysmmu_of_match[] = { { .compatible = "samsung,exynos-sysmmu", }, { }, };