From patchwork Thu Feb 20 12:30:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 183666 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp517845ile; Thu, 20 Feb 2020 04:30:29 -0800 (PST) X-Google-Smtp-Source: APXvYqwDtvWPSJ/ThpxNmulOyc4wWaE6/h9Hilx+MGcp5LnSO/qf2edTbC5Bbl8FKI9o6sr6+H3R X-Received: by 2002:a63:ab04:: with SMTP id p4mr34290795pgf.37.1582201829145; Thu, 20 Feb 2020 04:30:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582201829; cv=none; d=google.com; s=arc-20160816; b=d7DN5gvzMWXnRhxUfcLomKUXI/TeZxTQlagIlrlpB4OMSXSja/206EOz7zvp+Xld2J mXFPbXEOiYUVlCOWlH9aIKoXsxLPCBzp/kmBhYwJUlLmE30Kftcs2C0KfpYsBo04U6MB hjJQmU1HQ9VMcyCnJedOGMHj++UR5I//Y067/ArzUKrj3l+mvJ/MCfgMdPBNIXO0y1xy bgyOfJ/j7yTzsU8ykVhCH1JBk20GfnpH/lhHcUG1Qb+N1Axr2yj3HBqHEER022yNP5dC 48ES0qiPuQeRd2EiUHUR4rVUng/mvjgHJLRICsmpyOBKg91YRI9JVaGXcYf7sVSoPxLO AWNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:cms-type:message-id:date:subject:to :from:dkim-signature:dkim-filter:delivered-to; bh=vOXHcKN9JBQ/SCA7E6Kt/IE5wOhYwjsZ7MYXoOYyBJ0=; b=q8HUsPXFrNpCRNOL34axw2EIm3V/yKPvikCVar4/qE7/GiKeAmIe78/8y0EOAJcRCf 9X/ijC5faqSdJiaE6RAE1wU8qkbtYQJWx5SHbMBx18MaDtTAp6yNLYsxylqbuPhgZXBd pCc+7a5cWpGkQHe6i0F4uFqRNqTo4ZOnMZloOr/ByyYlWuexLuinWOIf7tzQm9JXJTh5 VlkSY5jcTgMh2zkWPEbksZC/iq/DZimWQzDZ/BQyy1y3xuEtvyD5CohCN2UCy7PFO7Gs +fCT8oaKr5MKgfYptVrl4Bqclr7TkAol/mEKmUb9I6nAZAOOcxbBvvzd3DXd6cxgftex XeMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=SrMwNnls; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id g17si2866760pgn.251.2020.02.20.04.30.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 04:30:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=SrMwNnls; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2ED7C6ED57; Thu, 20 Feb 2020 12:30:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0319E6ED57 for ; Thu, 20 Feb 2020 12:30:24 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200220123023euoutp0192092178c3d111a68ac56c82f60398c9~1HCzqafu91369713697euoutp01p for ; Thu, 20 Feb 2020 12:30:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200220123023euoutp0192092178c3d111a68ac56c82f60398c9~1HCzqafu91369713697euoutp01p DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1582201823; bh=p5CpTRZbsYtK0QYL0iltTMJJUAAyPjK8ae5FCrxPunI=; h=From:To:Cc:Subject:Date:References:From; b=SrMwNnlsIJoZyXQfNu8LgEOHF+lcLe1OIHDR7zm3uOlJ/gFFyI7RiyT8gfJZ2TtSg 8UEd1cFly0PN+6C3/dTl0xyTWuUGUaS5+dVygBquIjtBHkE8DRdO/bUjXJJtEGZq4D ZOpAuhtjSqvXQYOxMECBylLfvo+el6Y8fESL0X7M= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200220123023eucas1p2f100ff0bbda584a91c58756d7be9bd29~1HCzcMg3f1885918859eucas1p2O; Thu, 20 Feb 2020 12:30:23 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id F4.A3.61286.EDB7E4E5; Thu, 20 Feb 2020 12:30:23 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200220123022eucas1p21d015e2880680ae1c16e4b2a1d0ebb18~1HCzFR1jy0175401754eucas1p2l; Thu, 20 Feb 2020 12:30:22 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200220123022eusmtrp1e2bd3573e6b7837c03c3d570b76627d9~1HCzEsiyG2842728427eusmtrp1H; Thu, 20 Feb 2020 12:30:22 +0000 (GMT) X-AuditID: cbfec7f2-ef1ff7000001ef66-80-5e4e7bde8f07 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BD.D3.07950.EDB7E4E5; Thu, 20 Feb 2020 12:30:22 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200220123022eusmtip155bf8d78f81beb88588fc75f1eb07143~1HCyphCju2555725557eusmtip1B; Thu, 20 Feb 2020 12:30:22 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH] drm/exynos: dsi: fix workaround for the legacy clock name Date: Thu, 20 Feb 2020 13:30:12 +0100 Message-Id: <20200220123012.19179-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKIsWRmVeSWpSXmKPExsWy7djPc7r3q/3iDJ4cY7K4te4cq8XGGetZ La58fc9mMen+BBaLGef3MVmsPXKX3WLG5JdsDuwe97uPM3n0bVnF6PF5k1wAcxSXTUpqTmZZ apG+XQJXRs/uC2wFj8Urnlz+y9bAuEuki5GTQ0LARGLhrvNsXYxcHEICKxgl7k5/ygjhfGGU uPS9AyrzmVHiyKJjbDAti1+sYoZILAdK/N6N0PLw20YmkCo2AUOJrrddYB0iAm4STYdnsoIU MQtcZ5T49mMRO0hCWMBL4sqiq0AJDg4WAVWJdZfjQUxeAVuJ/7f0IZbJS6zecABsmYTACTaJ t+evs0MkXCSWHvoKdZGwxKvjW6DiMhKnJ/ewQDQ0Ax10bi07hNPDKHG5aQYjRJW1xJ1zv9hA tjELaEqs3wW1zVHi5cHrLCBhCQE+iRtvBUHCzE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Ay8nZ8MCc1s5OduVHBj/lnu498OnZEqnJh/03Jjbf /PDmF+es45Jm0+QX9cb8f3Q4tvmVgcbTRbMMGwXYjzL4nuDP29Pi+pJhhkCgfODTKk7Z9Y+m x/6a+Spi+xYLheKCD+LecjkiNQuir7hu15PmTNuuxFKckWioxVxUnAgAAzj1gE0CAAA= X-CMS-MailID: 20200220123022eucas1p21d015e2880680ae1c16e4b2a1d0ebb18 X-Msg-Generator: CA X-RootMTR: 20200220123022eucas1p21d015e2880680ae1c16e4b2a1d0ebb18 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200220123022eucas1p21d015e2880680ae1c16e4b2a1d0ebb18 References: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Seung-Woo Kim , Marek Szyprowski MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Writing to the built-in strings arrays doesn't work if driver is loaded as kernel module. This is also considered as a bad pattern. Fix this by adding a call to clk_get() with legacy clock name. This fixes following kernel oops if driver is loaded as module: Unable to handle kernel paging request at virtual address bf047978 pgd = (ptrval) [bf047978] *pgd=59344811, *pte=5903c6df, *ppte=5903c65f Internal error: Oops: 80f [#1] SMP ARM Modules linked in: mc exynosdrm(+) analogix_dp rtc_s3c exynos_ppmu i2c_gpio CPU: 1 PID: 212 Comm: systemd-udevd Not tainted 5.6.0-rc2-next-20200219 #326 videodev: Linux video capture interface: v2.00 Hardware name: Samsung Exynos (Flattened Device Tree) PC is at exynos_dsi_probe+0x1f0/0x384 [exynosdrm] LR is at exynos_dsi_probe+0x1dc/0x384 [exynosdrm] ... Process systemd-udevd (pid: 212, stack limit = 0x(ptrval)) ... [] (exynos_dsi_probe [exynosdrm]) from [] (platform_drv_probe+0x6c/0xa4) [] (platform_drv_probe) from [] (really_probe+0x210/0x350) [] (really_probe) from [] (driver_probe_device+0x60/0x1a0) [] (driver_probe_device) from [] (device_driver_attach+0x58/0x60) [] (device_driver_attach) from [] (__driver_attach+0x80/0xbc) [] (__driver_attach) from [] (bus_for_each_dev+0x68/0xb4) [] (bus_for_each_dev) from [] (bus_add_driver+0x130/0x1e8) [] (bus_add_driver) from [] (driver_register+0x78/0x110) [] (driver_register) from [] (exynos_drm_init+0xe8/0x11c [exynosdrm]) [] (exynos_drm_init [exynosdrm]) from [] (do_one_initcall+0x50/0x220) [] (do_one_initcall) from [] (do_init_module+0x60/0x210) [] (do_init_module) from [] (load_module+0x1c0c/0x2310) [] (load_module) from [] (sys_finit_module+0xac/0xbc) [] (sys_finit_module) from [] (ret_fast_syscall+0x0/0x54) Exception stack(0xd979bfa8 to 0xd979bff0) ... ---[ end trace db16efe05faab470 ]--- Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.17.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel Reviewed-by: Andrzej Hajda diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 33628d85edad..08a8ce3f499c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1787,9 +1787,10 @@ static int exynos_dsi_probe(struct platform_device *pdev) dsi->clks[i] = devm_clk_get(dev, clk_names[i]); if (IS_ERR(dsi->clks[i])) { if (strcmp(clk_names[i], "sclk_mipi") == 0) { - strcpy(clk_names[i], OLD_SCLK_MIPI_CLK_NAME); - i--; - continue; + dsi->clks[i] = devm_clk_get(dev, + OLD_SCLK_MIPI_CLK_NAME); + if (!IS_ERR(dsi->clks[i])) + continue; } dev_info(dev, "failed to get the clock: %s\n",