Linux-SPI Archive on lore.kernel.org
 help / color / Atom feed
From: "Łukasz Stelmach" <l.stelmach@samsung.com>
To: Kukjin Kim <kgene@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Tomasz Figa <tomasz.figa@gmail.com>,
	Andi Shyti <andi@etezian.org>, Mark Brown <broonie@kernel.org>,
	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" <m.szyprowski@samsung.com>,
	"Bartłomiej Żołnierkiewicz" <b.zolnierkie@samsung.com>,
	"Łukasz Stelmach" <l.stelmach@samsung.com>
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> (raw)
In-Reply-To: <20201002122243.26849-1-l.stelmach@samsung.com>

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 <krzk@kernel.org>
Suggested-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
---
 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);
-- 
2.26.2


  parent reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20201002122251eucas1p1a8977c163d7a291829e7cac212d26862@eucas1p1.samsung.com>
2020-10-02 12:22 ` [PATCH v3 0/9] Some fixes for spi-s3c64xx Łukasz Stelmach
     [not found]   ` <CGME20201002122251eucas1p26b59b6a574f78200d0c696dd1aacc140@eucas1p2.samsung.com>
2020-10-02 12:22     ` [PATCH v3 1/9] spi: spi-s3c64xx: swap s3c64xx_spi_set_cs() and s3c64xx_enable_datapath() Łukasz Stelmach
     [not found]   ` <CGME20201002122251eucas1p235d6797ae11f075a09841be64dc65236@eucas1p2.samsung.com>
2020-10-02 12:22     ` [PATCH v3 2/9] spi: spi-s3s64xx: Add S3C64XX_SPI_QUIRK_CS_AUTO for Exynos3250 Łukasz Stelmach
     [not found]   ` <CGME20201002122252eucas1p1555a9b0df6f2318ab511117be3f65dee@eucas1p1.samsung.com>
2020-10-02 12:22     ` [PATCH v3 3/9] spi: spi-s3c64xx: Check return values Łukasz Stelmach
     [not found]   ` <CGME20201002122252eucas1p1496d896453d21acda6ab83ef9b7f0b8a@eucas1p1.samsung.com>
2020-10-02 12:22     ` [PATCH v3 4/9] spi: spi-s3c64xx: Report more information when errors occur Łukasz Stelmach
     [not found]   ` <CGME20201002122252eucas1p16b24cee16354763e4925f21cf52c6a4d@eucas1p1.samsung.com>
2020-10-02 12:22     ` [PATCH v3 5/9] spi: spi-s3c64xx: Rename S3C64XX_SPI_SLAVE_* to S3C64XX_SPI_CS_* Łukasz Stelmach
     [not found]   ` <CGME20201002122255eucas1p2f361ef66b44801d69e0ee1425571f571@eucas1p2.samsung.com>
2020-10-02 12:22     ` [PATCH v3 6/9] spi: spi-s3c64xx: Fix doc comment for struct s3c64xx_spi_driver_data Łukasz Stelmach
     [not found]   ` <CGME20201002122255eucas1p21976a8ba0566564b79a9dd6f62cd4caf@eucas1p2.samsung.com>
2020-10-02 12:22     ` Łukasz Stelmach [this message]
2020-10-02 12:31       ` [PATCH v3 7/9] spi: spi-s3c64xx: Ensure cur_speed holds actual clock value Krzysztof Kozlowski
     [not found]   ` <CGME20201002122255eucas1p2cec6d9cdac111d6f2dc628c7865f7bd5@eucas1p2.samsung.com>
2020-10-02 12:22     ` [PATCH v3 8/9] spi: spi-s3c64xx: Increase transfer timeout Łukasz Stelmach
     [not found]   ` <CGME20201002122256eucas1p10093b3619fbe5f96ae351920329d1626@eucas1p1.samsung.com>
2020-10-02 12:22     ` [PATCH v3 9/9] spi: spi-s3c64xx: Turn on interrupts upon resume Łukasz Stelmach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201002122243.26849-8-l.stelmach@samsung.com \
    --to=l.stelmach@samsung.com \
    --cc=andi@etezian.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=broonie@kernel.org \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=tomasz.figa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-SPI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-spi/0 linux-spi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-spi linux-spi/ https://lore.kernel.org/linux-spi \
		linux-spi@vger.kernel.org
	public-inbox-index linux-spi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-spi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git