From patchwork Fri Oct 2 12:22:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 287029 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 139C9C4742A for ; Fri, 2 Oct 2020 12:23:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA5F02168B for ; Fri, 2 Oct 2020 12:22:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="kVFdCIh0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387923AbgJBMW6 (ORCPT ); Fri, 2 Oct 2020 08:22:58 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:54178 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387906AbgJBMW6 (ORCPT ); Fri, 2 Oct 2020 08:22:58 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201002122256euoutp0286f3cc92bd62d0bf65d2d72e49cd73a4~6LFh8ekoO2297122971euoutp02b for ; Fri, 2 Oct 2020 12:22:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201002122256euoutp0286f3cc92bd62d0bf65d2d72e49cd73a4~6LFh8ekoO2297122971euoutp02b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1601641376; bh=XzneccWbW6+CEoFf1aTmHjTyFh+KVtRq/ZUrB/a8b5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kVFdCIh0o+oN9hEVa9UU5pcEJ11xpwHZK3x1CmR//SuJDqxXWPwhUMXvAFXwffKlO mkluil/+ggiEjEmzT/cHSBpK0MhBLx3u8hh/yds/cd6TzwsBs1xYK7LzgR1JTSn1sC mJxT5sKjwMnpgKz3MwDOUo61kKqdEuHFkvj/XyuY= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201002122255eucas1p29804342cb1e06a80434922e3a3d9d6fc~6LFhiKCSK1013510135eucas1p2r; Fri, 2 Oct 2020 12:22:55 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 44.42.06456.F9B177F5; Fri, 2 Oct 2020 13:22:55 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201002122255eucas1p21976a8ba0566564b79a9dd6f62cd4caf~6LFhQR6Jx1906319063eucas1p2e; Fri, 2 Oct 2020 12:22:55 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201002122255eusmtrp24330bdd13b9ea2ab8f6734720c6d228d~6LFhPq7HJ0225802258eusmtrp2M; Fri, 2 Oct 2020 12:22:55 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-9d-5f771b9fff00 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 13.C0.06017.F9B177F5; Fri, 2 Oct 2020 13:22:55 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201002122255eusmtip11ff21a2427deff936bc232a76845b536~6LFhGZtVQ0581605816eusmtip1h; Fri, 2 Oct 2020 12:22:55 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , Tomasz Figa , Andi Shyti , Mark Brown , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , =?utf-8?q?Bart=C5=82omiej?= =?utf-8?b?IMW7b8WCbmllcmtpZXdpY3o=?= , =?utf-8?q?=C5=81ukasz_Stelmach?= Subject: [PATCH v3 7/9] spi: spi-s3c64xx: Ensure cur_speed holds actual clock value Date: Fri, 2 Oct 2020 14:22:41 +0200 Message-Id: <20201002122243.26849-8-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201002122243.26849-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJKsWRmVeSWpSXmKPExsWy7djPc7rzpcvjDbZ1KVss/vGcyWLjjPWs FlMfPmGz6H/8mtni/PkN7BY3D61gtNj0+BqrxeVdc9gsZpzfx2TR+PEmu8XaI3fZLVbt+sPo wONxfcknZo+ds+6ye2xa1cnmsXlJvUffllWMHp83yQWwRXHZpKTmZJalFunbJXBlTF2fW9DH UXFm5k+2BsYnbF2MnBwSAiYSl/6fYe1i5OIQEljBKDH7zho2COcLo8TBUz8YIZzPjBJzDn1g hGnZfLSdHcQWEljOKPFsFj9E0XNGif0bIIrYBBwl+peeAJsrIrCdSWLi5/MsIA6zwFFGic0P rrKAVAkLhEp83HUcrINFQFWit/UqUxcjBwevgLVE04Y6iG3yEu3Lt4MdyylgI3Fy0TYwm1dA UOLkzCdgY/gFtCTWN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zhEDC/AJaEmuaroNN ZwYa07x1NvMERqFZSDpmIXTMQlK1gJF5FaNIamlxbnpusZFecWJucWleul5yfu4mRmBEbjv2 c8sOxq53wYcYBTgYlXh4BQ6UxguxJpYVV+YeYpTgYFYS4XU6ezpOiDclsbIqtSg/vqg0J7X4 EKMp0JcTmaVEk/OBySKvJN7Q1NDcwtLQ3Njc2MxCSZy3Q+BgjJBAemJJanZqakFqEUwfEwen VAPjqsLzn6/Jevet6HJ+yzF/avxVnrCKKT/+G9SVmTxML2b8+ufVLCfvZKNrzclfy3YujdXw Xv/R/V/v1YUFNzlX82vLbvnF/3iJU+ieuFV/HTniF7Vq7N/JlDS9QIll7sNdFuv65GRbFiy4 dUqwdUcXt13U49iw00LP50WuOsabxfdyWXG5odpLJZbijERDLeai4kQAd2m5jt4CAAA= X-CMS-MailID: 20201002122255eucas1p21976a8ba0566564b79a9dd6f62cd4caf X-Msg-Generator: CA X-RootMTR: 20201002122255eucas1p21976a8ba0566564b79a9dd6f62cd4caf X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201002122255eucas1p21976a8ba0566564b79a9dd6f62cd4caf References: <20201002122243.26849-1-l.stelmach@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Make sure the cur_speed value used in s3c64xx_enable_datapath() to configure DMA channel and in s3c64xx_wait_for_*() to calculate the transfer timeout is set to the actual value of (half) the clock speed. Don't change non-CMU case, because no frequency calculation errors have been reported. Reviewed-by: Krzysztof Kozlowski Suggested-by: Tomasz Figa Signed-off-by: Ɓukasz Stelmach --- drivers/spi/spi-s3c64xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index f85f40fd608c..0bd3e230350c 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -626,6 +626,7 @@ static int s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) ret = clk_set_rate(sdd->src_clk, sdd->cur_speed * 2); if (ret) return ret; + sdd->cur_speed = clk_get_rate(sdd->src_clk) / 2; } else { /* Configure Clock */ val = readl(regs + S3C64XX_SPI_CLK_CFG);