From patchwork Thu Sep 13 08:21:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 146615 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp324620ljw; Thu, 13 Sep 2018 01:21:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZyBEnjzmn3OGjlkyRriHD8ed1EenyaCsRAes3skkRyeXqU4/Gh0NrbIrI/otafzHwzObzf X-Received: by 2002:a17:902:9045:: with SMTP id w5-v6mr6187157plz.10.1536826899712; Thu, 13 Sep 2018 01:21:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536826899; cv=none; d=google.com; s=arc-20160816; b=yEi8Nou9u2KUJtqp09T5hO/5CZYfX8f2STwReqAJCcKQIK1S5H/hVnsCXxNIwBHzFn pCb4EflJ45erQwdyveM9j3aiH7ojBJrNYqwPY8JwtahFOn0E1wN8w91b72DeoxmRl+zY 90ZNtRNjYLh+cUAcn9BRHOP/rMPGd5rb5F3O3YPmvtQ6+0DgSQnMNPyWvtztWkc4eEYT IXZNniYMDBcYRddkUtNE3tP5YPUzwALIyhOt3JsXsVJ2ffyx2krixkXm4eRdTiE9m7Rp OvW4w7Z5K9TBEiU0GfQVE2Eq8ipp3QUN6K7MXCfyMso9PzjWxBWa+jwVT5IkruelFa09 d9yw== 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:dkim-signature:dkim-filter; bh=6/2IOOFUIqMZjTTJphTjCbgG1lnVEh+kUx+XZ6Obkrw=; b=SazvRg12jACehxuD372shRfQuxFSaNtVeDeKf5ZKAi1yRjkRrnF2qvF+Zq1apRRans HrHe5U08Cj5NH8rdhuwHmKx90eEfXv3Coa2LlzOOpTm7R4xKyLWQa30eUblEqs55nDSF J/JsGUUf6s1Ik7ag8AkfQk/Rct0pB2y6GSQIXAJx8f639lFLx7qsQVSuHd/pjnFbm6cU o1ULTK9IVks1MH7OUX8oKw6KEIfj2EDonldgsgyKFUq0LpEVyIJqPu+lOuJsXjRlm8iP qDgdAwzDL1Wi+COaOpk1Q+Nl77zXbc6isFJ+IpYIcrhYWG7kyGXdh77U5THVc4Z3GMpl 0xFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Wk6wTncs; 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=pass (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 m9-v6si3301803plt.478.2018.09.13.01.21.39; Thu, 13 Sep 2018 01:21:39 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Wk6wTncs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbeIMNaC (ORCPT + 3 others); Thu, 13 Sep 2018 09:30:02 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:36872 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726308AbeIMNaC (ORCPT ); Thu, 13 Sep 2018 09:30:02 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180913082137euoutp01b0fc5657ff8f7454eeb03b9f18f200f5~T5_uhxHyU1420514205euoutp01S; Thu, 13 Sep 2018 08:21:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180913082137euoutp01b0fc5657ff8f7454eeb03b9f18f200f5~T5_uhxHyU1420514205euoutp01S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1536826897; bh=6/2IOOFUIqMZjTTJphTjCbgG1lnVEh+kUx+XZ6Obkrw=; h=From:To:Cc:Subject:Date:References:From; b=Wk6wTncsKcRQjnWGr+LVVinDhpxJyHXHGWKqFvR5c3dsbhPSULXqQphD9WT73L8XG icM+6ndIEWLW6nHOiW6VPMVWdN/TyVe1g3YYm2udJZxkx3HrJIxglGWxSq6s/3DFMW 4SOKAU6ObeGDQdTB1aMAv5JEXdevzfIet/muzCWs= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180913082136eucas1p2a6aa6cd42f030ed1416a19a393328a0b~T5_t6V3XD1013310133eucas1p22; Thu, 13 Sep 2018 08:21:36 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 32.62.04806.01E1A9B5; Thu, 13 Sep 2018 09:21:36 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180913082135eucas1p28c5fcd288b09cadc9c8425e19817c086~T5_tLHfLZ0777607776eucas1p2P; Thu, 13 Sep 2018 08:21:35 +0000 (GMT) X-AuditID: cbfec7f5-367ff700000012c6-89-5b9a1e109341 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id BE.CD.04284.F0E1A9B5; Thu, 13 Sep 2018 09:21: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 <0PEZ00J5QJ7VL940@eusync1.samsung.com>; Thu, 13 Sep 2018 09:21:35 +0100 (BST) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH] serial: samsung: Enable baud clock for UART reset procedure in resume Date: Thu, 13 Sep 2018 10:21:25 +0200 Message-id: <20180913082125.11849-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrIIsWRmVeSWpSXmKPExsWy7djPc7oCcrOiDY4u5bDYOGM9q0Xz4vVs FlM2fGCyOH9+A7vFjPP7mCzOLO5lt1h75C67RfvTl8wOHB6bVnWyeeyfu4bdo2/LKkaP9Vuu snh83iQXwBrFZZOSmpNZllqkb5fAlbFwnUzBJ66KHVOnMDYwzuDsYuTkkBAwkdh5YzlzFyMX h5DACkaJnW1XWCCcz4wSm5+eYYWpuvfsABNEYhmjxNrj31khnAYmiVOn5rCDVLEJGEp0ve1i A7FFBJwlZp9dCNbBLNDDJHFh8SSgIg4OYYEIiZ7/ziA1LAKqEudez2AGsXkFbCXu/njIBrFN XmL1hgNgN0kIfGSVuLdrDRNIr4SAi8TeW1YQNcISr45vYYewZSQ6Ow4yQdQ3M0q0z5jFDuH0 MEpsnbMDaqq1xOHjF8H+YRbgk5i0bTozxFBeiY42IYgSD4mnW28wgthCArESn28eYJnAKLGA kWEVo3hqaXFuemqxcV5quV5xYm5xaV66XnJ+7iZGYMSd/nf86w7GfX+SDjEKcDAq8fB+0JwZ LcSaWFZcmXuIUYKDWUmE9zU7UIg3JbGyKrUoP76oNCe1+BCjNAeLkjgvn1ZatJBAemJJanZq akFqEUyWiYNTqoFRzGbfWZbG7a26+lET01OqFpgcTLasC90RotB0y+VYTZn8xbuNW1N+WrQ9 ODvpepOseqXUkaZljAs+RRQEbD60fWZDipHwXNHaHQY7Gzn3Punhur3w8JRvqYV7383iNj2w 4fNbo4aKQ0uNqv55is86dWij3vmTMnq+XbkqBd4vtpnMPSsSfMRdiaU4I9FQi7moOBEANs5J r7QCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCJMWRmVeSWpSXmKPExsVy+t/xy7r8crOiDR7NFrbYOGM9q0Xz4vVs FlM2fGCyOH9+A7vFjPP7mCzOLO5lt1h75C67RfvTl8wOHB6bVnWyeeyfu4bdo2/LKkaP9Vuu snh83iQXwBrFZZOSmpNZllqkb5fAlbFwnUzBJ66KHVOnMDYwzuDsYuTkkBAwkbj37ABTFyMX h5DAEkaJvT8uMkM4TUwSk26cYgWpYhMwlOh628UGYosIOEvMPrsQrINZoI9J4tz09SwgCWGB CIk1r1qZQWwWAVWJc69ngNm8ArYSd388ZINYJy+xesMB5gmMXAsYGVYxiqSWFuem5xYb6hUn 5haX5qXrJefnbmIEhsW2Yz8372C8tDH4EKMAB6MSD+8LpZnRQqyJZcWVuYcYJTiYlUR4X7MD hXhTEiurUovy44tKc1KLDzFKc7AoifOeN6iMEhJITyxJzU5NLUgtgskycXBKNTCG2xf0sZ9+ zfl5qtGMP+fFu7sVV1eyKId79MrG3GfZIz5N5kKe6NtfeydtLtzm87f2yeb/89nrPjjd/RZ+ 6+pmS2VH7iLlJSFCpnfL8j67rN7Lzdx048OiXNbVcqz77pveKZ8pv31VkVrHZZbJPs+jBe1L VpsUFHT0lh2f8SK+K/9qu3F/s6QSS3FGoqEWc1FxIgD6NZIOBwIAAA== X-CMS-MailID: 20180913082135eucas1p28c5fcd288b09cadc9c8425e19817c086 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180913082135eucas1p28c5fcd288b09cadc9c8425e19817c086 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Ensure that the baud clock is also enabled for UART register writes in driver resume. On Exynos5433 SoC this is needed to avoid external abort issue. Signed-off-by: Marek Szyprowski --- drivers/tty/serial/samsung.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.17.1 Reviewed-by: Krzysztof Kozlowski diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 2f8fa184aafa..da1bd4bba8a9 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -1941,7 +1941,11 @@ static int s3c24xx_serial_resume(struct device *dev) if (port) { clk_prepare_enable(ourport->clk); + if (!IS_ERR(ourport->baudclk)) + clk_prepare_enable(ourport->baudclk); s3c24xx_serial_resetport(port, s3c24xx_port_to_cfg(port)); + if (!IS_ERR(ourport->baudclk)) + clk_disable_unprepare(ourport->baudclk); clk_disable_unprepare(ourport->clk); uart_resume_port(&s3c24xx_uart_drv, port); @@ -1964,7 +1968,11 @@ static int s3c24xx_serial_resume_noirq(struct device *dev) if (rx_enabled(port)) uintm &= ~S3C64XX_UINTM_RXD_MSK; clk_prepare_enable(ourport->clk); + if (!IS_ERR(ourport->baudclk)) + clk_prepare_enable(ourport->baudclk); wr_regl(port, S3C64XX_UINTM, uintm); + if (!IS_ERR(ourport->baudclk)) + clk_disable_unprepare(ourport->baudclk); clk_disable_unprepare(ourport->clk); } }