Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp416981pxa; Fri, 21 Aug 2020 10:31:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4Xm8b2TQP8LgcbboipldIPKClwqpWDHTXbYpz0PeH86rsnpzWJJUtz2gYcKS7EOqapvJ4 X-Received: by 2002:a17:906:6696:: with SMTP id z22mr3793503ejo.159.1598031073114; Fri, 21 Aug 2020 10:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598031073; cv=none; d=google.com; s=arc-20160816; b=xCZek1/sRDFlbKeXe1ylChAn0tdVKIRr9iDIONxtQY+SGVVpWlqD4cW1CJPcClPkM3 SFzB7ItyvG6j+BEWrf63vsN6p7JSs/FdHpxS7p030mUcuxMe7PcjxgxJrbYb9rfKvXuu /dD8icj/1tJGNOA3PjWd32Sms3LDy9tjIpCN7XcqiJj545eP4oUEqjm+bGOprxz9IkYq rm4Q6nLPC23tTFmysU98avCjXGtLha8vApqThO1feiZFgF6OgX0XLwGJrbeCKAWMojGf /DKxBDMcbve6oNSUesLL2MY2JmwyO/NO/So/iw4vs1+9xZpTPrSVYGWTkUsvQVxdBcuL JYLQ== 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 :content-transfer-encoding:organization:mime-version:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=ELtloJOmnPn+Z5FT9bjX2f4AQc1qGik0EonV1Nsy8yk=; b=AoN5HCC2MNlkWnCqwfxRRXShV1vVgFAJ+WglkH4zBMi61McLoGixurULRQIfgKSj4y csVbnxhhOSE1urjVla7WN06tDbmpO0VYLzdr85v5jjtaCY3kdolo8gDvliWkzjAR2zr6 qHWrE1J02YPbhZrHwp/HHWRmZYTX6UOcF38Cp0iTHs9WwAIcGtPBk8GI1s8MSQYwNBGe jayU4/jMf4ikZJzjTWUnXgFWiKzmhbaSm4DvEcnm7KNtW9IXzPtsi/Utck5uh6/F7LY3 /a4msmC9DsS61ntHwXYiad+R63TaRT6hX2cf5kBNF7mPYvOdUvw1fJZ+IlIjq3Vo9Ccf jc1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=HwT8AwNG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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. [23.128.96.18]) by mx.google.com with ESMTP id k21si1656490eja.290.2020.08.21.10.30.49; Fri, 21 Aug 2020 10:31:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=HwT8AwNG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726870AbgHURaS (ORCPT + 99 others); Fri, 21 Aug 2020 13:30:18 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:37230 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726851AbgHUQOM (ORCPT ); Fri, 21 Aug 2020 12:14:12 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200821161408euoutp01e7fc419ca86a5882978658e3fab92b37~tVJaJL0-82276022760euoutp01o for ; Fri, 21 Aug 2020 16:14:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200821161408euoutp01e7fc419ca86a5882978658e3fab92b37~tVJaJL0-82276022760euoutp01o DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598026448; bh=ELtloJOmnPn+Z5FT9bjX2f4AQc1qGik0EonV1Nsy8yk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HwT8AwNGH9XHwQ126s0HzoxR/FplwnzZiYl8bpir0rDBe0w99mPAhyTWxlNSLNvQS 4bSWcEyiBzWgP6DsB45Bnx8XHhORrcmhEEbHbAAd3Jfg1tXLJ6dfTMerCjJphYBie+ 1sfImtpESYeqkACLqVZGwLnmCvbEIKNDcL7hHN8c= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200821161407eucas1p1a2d41ca21fb435b7f8245db4846c33a9~tVJZpUPP50799907999eucas1p1g; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id D1.AE.05997.FC2FF3F5; Fri, 21 Aug 2020 17:14:07 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200821161407eucas1p249e4833b8839f717cc2a496ab43bb8a2~tVJZTohaQ2033420334eucas1p2g; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200821161407eusmtrp22df030d66edc36898d86dff9387529e4~tVJZTB1i42998229982eusmtrp2h; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-c6-5f3ff2cfcec8 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id AC.17.06314.FC2FF3F5; Fri, 21 Aug 2020 17:14:07 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200821161407eusmtip20e88d7dc8b87e49bb3c07ed8a38d71a4~tVJZICu6-3023630236eusmtip2T; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , 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: m.szyprowski@samsung.com, b.zolnierkie@samsung.com, =?UTF-8?q?=C5=81ukasz=20Stelmach?= , Tomasz Figa Subject: [PATCH v2 7/9] spi: spi-s3c64xx: Ensure cur_speed holds actual clock value Date: Fri, 21 Aug 2020 18:13:59 +0200 Message-Id: <20200821161401.11307-8-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200821161401.11307-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA02SfSyUcRzA+91zz3OPm+NxbL5Jtd2yOhuK2LN5N39c/5Q/arUSDk/OuKM7 RNMIRXphzPK2RbTDvOcurFg3y1tcaXnXEiVKzUvzMiN3j5b/Pt/v7/N9+f32IzFhG25DRiri GKVCGi0i+Fztmw29g37ZO/hk4biYrlif49BNhQ04XTA9S9A5Mz8wWq9v5NFjuipEN88M4/SH 9lKCLtR3cOjbS2M8uq5rikev3NkmfEwlJanvuZKRymVM0lxzj5A8r0yRPGqpQZKV5iMBxGW+ RzgTHZnAKJ28Qvgy7dx3XmwTkThfbZ2KKvBsRJJAnQZdpnM24pNCqgpBwZAaZ4NVBL9HP/Oy kclusIKgujXEwIaC3oG1PUmN4M9iG8EGcwj6OjOMFQTlCznPeoyWFZXLgenBn0YLo4oQbBRV cAyWJXUBshvf4gbmUnawsFNGGFhAuUOWph1j5x2FTPULY96E8oDuoTScdSygt2iWa2Bzyh5q 00aMjO366ZoSzDAMqHEef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G4MPMQpwMCrx8P44ZB8vxJpYVlyZe4hRgoNZSYTX6ezpOCHelMTKqtSi/Pii0pzU4kOM pkBvTmSWEk3OByaLvJJ4Q1NDcwtLQ3Njc2MzCyVx3g6BgzFCAumJJanZqakFqUUwfUwcnFIN jBbdB+VM//bwN3P3b9L7qrb34r2tDVprt2b3y4TpWR81vPpnnb/epnsTLV3rXAp3VwoeLDt5 wTvr03WXQzu+rdz7375JuTR2X33lidntntcCny1PEvT7umHis1t3/byiGw9Y3nWP+7Tyydl0 Q+XMN/V/T8z6FPts7noZy44qk2gvTiaXDzaTw5VYijMSDbWYi4oTAcS6UfjeAgAA X-CMS-MailID: 20200821161407eucas1p249e4833b8839f717cc2a496ab43bb8a2 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200821161407eucas1p249e4833b8839f717cc2a496ab43bb8a2 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200821161407eucas1p249e4833b8839f717cc2a496ab43bb8a2 References: <20200821161401.11307-1-l.stelmach@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cur_speed is used to calculate transfer timeout and needs to be set to the actual value of (half) the clock speed for precise calculations. Cc: 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 02de734b8ab1..89c162efe355 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); -- 2.26.2