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 8/9] spi: spi-s3c64xx: Increase transfer timeout Date: Fri, 2 Oct 2020 14:22:42 +0200 [thread overview] Message-ID: <20201002122243.26849-9-l.stelmach@samsung.com> (raw) In-Reply-To: <20201002122243.26849-1-l.stelmach@samsung.com> Increase timeout by 30 ms for some wiggle room and set the minimum value to 100 ms. This ensures a non-zero value for short transfers which may take less than 1 ms. The timeout value does not affect performance because it is used with a completion. Similar formula is used in other drivers e.g. sun4i, sun6i. Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com> --- drivers/spi/spi-s3c64xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 0bd3e230350c..9f728a7c59a1 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -473,7 +473,8 @@ static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd, /* millisecs to xfer 'len' bytes @ 'cur_speed' */ ms = xfer->len * 8 * 1000 / sdd->cur_speed; - ms += 10; /* some tolerance */ + ms += 30; /* some tolerance */ + ms = max(ms, 100); /* minimum timeout */ val = msecs_to_jiffies(ms) + 10; val = wait_for_completion_timeout(&sdd->xfer_completion, val); -- 2.26.2
WARNING: multiple messages have this Message-ID (diff)
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: "Bartłomiej Żołnierkiewicz" <b.zolnierkie@samsung.com>, "Łukasz Stelmach" <l.stelmach@samsung.com>, "Marek Szyprowski" <m.szyprowski@samsung.com> Subject: [PATCH v3 8/9] spi: spi-s3c64xx: Increase transfer timeout Date: Fri, 2 Oct 2020 14:22:42 +0200 [thread overview] Message-ID: <20201002122243.26849-9-l.stelmach@samsung.com> (raw) In-Reply-To: <20201002122243.26849-1-l.stelmach@samsung.com> Increase timeout by 30 ms for some wiggle room and set the minimum value to 100 ms. This ensures a non-zero value for short transfers which may take less than 1 ms. The timeout value does not affect performance because it is used with a completion. Similar formula is used in other drivers e.g. sun4i, sun6i. Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com> --- drivers/spi/spi-s3c64xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 0bd3e230350c..9f728a7c59a1 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -473,7 +473,8 @@ static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd, /* millisecs to xfer 'len' bytes @ 'cur_speed' */ ms = xfer->len * 8 * 1000 / sdd->cur_speed; - ms += 10; /* some tolerance */ + ms += 30; /* some tolerance */ + ms = max(ms, 100); /* minimum timeout */ val = msecs_to_jiffies(ms) + 10; val = wait_for_completion_timeout(&sdd->xfer_completion, val); -- 2.26.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-10-02 12:23 UTC|newest] Thread overview: 23+ 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 2020-10-02 12:22 ` Ł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 2020-10-02 12:22 ` Ł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 2020-10-02 12:22 ` Ł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 2020-10-02 12:22 ` Ł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 2020-10-02 12:22 ` Ł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 2020-10-02 12:22 ` Ł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 2020-10-02 12:22 ` Łukasz Stelmach [not found] ` <CGME20201002122255eucas1p21976a8ba0566564b79a9dd6f62cd4caf@eucas1p2.samsung.com> 2020-10-02 12:22 ` [PATCH v3 7/9] spi: spi-s3c64xx: Ensure cur_speed holds actual clock value Łukasz Stelmach 2020-10-02 12:22 ` Łukasz Stelmach 2020-10-02 12:31 ` Krzysztof Kozlowski 2020-10-02 12:31 ` Krzysztof Kozlowski [not found] ` <CGME20201002122255eucas1p2cec6d9cdac111d6f2dc628c7865f7bd5@eucas1p2.samsung.com> 2020-10-02 12:22 ` Łukasz Stelmach [this message] 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 2020-10-02 12:22 ` Łukasz Stelmach 2020-10-05 17:54 ` [PATCH v3 0/9] Some fixes for spi-s3c64xx Mark Brown
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-9-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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.