From: Michal Suchanek <hramrach@gmail.com> To: linux-sunxi@googlegroups.com, stable@vger.kernel.org, Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>, Mark Rutland <mark.rutland@arm.com>, Ian Campbell <ijc+devicetree@hellion.org.uk>, Kumar Gala <galak@codeaurora.org>, Maxime Ripard <maxime.ripard@free-electrons.com>, Chen-Yu Tsai <wens@csie.org>, Russell King <linux@armlinux.org.uk>, Mark Brown <broonie@kernel.org>, Michal Suchanek <hramrach@gmail.com>, Arnd Bergmann <arnd@arndb.de>, Olof Johansson <olof@lixom.net>, Krzysztof Kozlowski <k.kozlowski@samsung.com>, Javier Martinez Canillas <javier@osg.samsung.com>, Simon Horman <horms+renesas@verge.net.au>, Sjoerd Simons <sjoerd.simons@collabora.co.uk>, Thierry Reding <treding@nvidia.com>, Alison Wang <b18965@freescale.com>, Timo Sigurdsson <public_timo.s@silentcreek.de>, Jonathan Liu <net147@gmail.com>, Gerhard Bertelsmann <info@gerhard-bertelsmann.> Subject: [PATCH v3 01/13] spi: sunxi: set maximum and minimum speed of SPI master Date: 13 Jun 2016 17:46:49 -0000 [thread overview] Message-ID: <2db0ce0ea1ddc17e9bb790c8cc50bcb4bb97be58.1465490774.git.hramrach@gmail.com> (raw) In-Reply-To: <cover.1465490774.git.hramrach@gmail.com> The speed limits are unset in the sun4i and sun6i SPI drivers. The maximum speed of SPI master is used when maximum speed of SPI slave is not specified. Also the __spi_validate function should check that transfer speeds do not exceed the master limits. The user manual for A10 and A31 specifies maximum speed of the SPI clock as 100MHz and minimum as 3kHz. Setting the SPI clock to out-of-spec values can lock up the SoC. Signed-off-by: Michal Suchanek <hramrach@gmail.com> -- v2: new patch v3: fix constant style --- drivers/spi/spi-sun4i.c | 2 ++ drivers/spi/spi-sun6i.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c index 1ddd9e2..4213508 100644 --- a/drivers/spi/spi-sun4i.c +++ b/drivers/spi/spi-sun4i.c @@ -387,6 +387,8 @@ static int sun4i_spi_probe(struct platform_device *pdev) } sspi->master = master; + master->max_speed_hz = 100 * 1000 * 1000; + master->min_speed_hz = 3 * 1000; master->set_cs = sun4i_spi_set_cs; master->transfer_one = sun4i_spi_transfer_one; master->num_chipselect = 4; diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c index 42e2c4b..fe70695 100644 --- a/drivers/spi/spi-sun6i.c +++ b/drivers/spi/spi-sun6i.c @@ -386,6 +386,8 @@ static int sun6i_spi_probe(struct platform_device *pdev) } sspi->master = master; + master->max_speed_hz = 100 * 1000 * 1000; + master->min_speed_hz = 3 * 1000; master->set_cs = sun6i_spi_set_cs; master->transfer_one = sun6i_spi_transfer_one; master->num_chipselect = 4; -- 2.8.1
WARNING: multiple messages have this Message-ID (diff)
From: hramrach@gmail.com (Michal Suchanek) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 01/13] spi: sunxi: set maximum and minimum speed of SPI master Date: 13 Jun 2016 17:46:49 -0000 [thread overview] Message-ID: <2db0ce0ea1ddc17e9bb790c8cc50bcb4bb97be58.1465490774.git.hramrach@gmail.com> (raw) In-Reply-To: <cover.1465490774.git.hramrach@gmail.com> The speed limits are unset in the sun4i and sun6i SPI drivers. The maximum speed of SPI master is used when maximum speed of SPI slave is not specified. Also the __spi_validate function should check that transfer speeds do not exceed the master limits. The user manual for A10 and A31 specifies maximum speed of the SPI clock as 100MHz and minimum as 3kHz. Setting the SPI clock to out-of-spec values can lock up the SoC. Signed-off-by: Michal Suchanek <hramrach@gmail.com> -- v2: new patch v3: fix constant style --- drivers/spi/spi-sun4i.c | 2 ++ drivers/spi/spi-sun6i.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c index 1ddd9e2..4213508 100644 --- a/drivers/spi/spi-sun4i.c +++ b/drivers/spi/spi-sun4i.c @@ -387,6 +387,8 @@ static int sun4i_spi_probe(struct platform_device *pdev) } sspi->master = master; + master->max_speed_hz = 100 * 1000 * 1000; + master->min_speed_hz = 3 * 1000; master->set_cs = sun4i_spi_set_cs; master->transfer_one = sun4i_spi_transfer_one; master->num_chipselect = 4; diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c index 42e2c4b..fe70695 100644 --- a/drivers/spi/spi-sun6i.c +++ b/drivers/spi/spi-sun6i.c @@ -386,6 +386,8 @@ static int sun6i_spi_probe(struct platform_device *pdev) } sspi->master = master; + master->max_speed_hz = 100 * 1000 * 1000; + master->min_speed_hz = 3 * 1000; master->set_cs = sun6i_spi_set_cs; master->transfer_one = sun6i_spi_transfer_one; master->num_chipselect = 4; -- 2.8.1
next prev parent reply other threads:[~2016-06-13 17:46 UTC|newest] Thread overview: 121+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-06-13 17:46 [PATCH v3 00/13] sunxi spi fixes Michal Suchanek 2016-06-13 17:46 ` Michal Suchanek 2016-06-13 17:46 ` Michal Suchanek [this message] 2016-06-13 17:46 ` [PATCH v3 01/13] spi: sunxi: set maximum and minimum speed of SPI master Michal Suchanek 2016-06-13 19:55 ` Maxime Ripard 2016-06-13 19:55 ` Maxime Ripard 2016-06-13 19:55 ` Maxime Ripard 2016-06-13 17:46 ` [PATCH v3 04/13] spi: sunxi: expose maximum transfer size limit Michal Suchanek 2016-06-13 17:46 ` Michal Suchanek 2016-06-13 19:56 ` Maxime Ripard 2016-06-13 19:56 ` Maxime Ripard 2016-06-13 19:56 ` Maxime Ripard [not found] ` <cover.1465490774.git.hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2016-06-13 17:46 ` [PATCH v3 03/13] spi: sun4i: fix FIFO limit Michal Suchanek 2016-06-13 17:46 ` Michal Suchanek 2016-06-13 19:56 ` Maxime Ripard 2016-06-13 19:56 ` Maxime Ripard 2016-06-13 19:56 ` Maxime Ripard 2016-06-13 17:46 ` [PATCH v3 02/13] spi: sunxi: fix transfer timeout Michal Suchanek 2016-06-13 17:46 ` Michal Suchanek 2016-06-13 19:55 ` Maxime Ripard 2016-06-13 19:55 ` Maxime Ripard 2016-06-13 19:55 ` Maxime Ripard 2016-06-13 17:46 ` [PATCH v3 06/13] spi: sunxi: rename sun4i,sun6i -> sunxi Michal Suchanek 2016-06-13 17:46 ` Michal Suchanek 2016-06-13 17:46 ` [PATCH v3 05/13] spi: sun6i: update CS handling from spi-sun4i Michal Suchanek 2016-06-13 17:46 ` Michal Suchanek 2016-06-13 17:46 ` [PATCH v3 08/13] spi: sunxi: synchronize whitespace, comments, struct Michal Suchanek 2016-06-13 17:46 ` Michal Suchanek 2016-06-13 17:46 ` [PATCH v3 09/13] spi: sunxi: use register map Michal Suchanek 2016-06-13 17:46 ` Michal Suchanek 2016-06-13 17:46 ` [PATCH v3 07/13] spi: sunxi: rename constants to match between sun4i and sun6i Michal Suchanek 2016-06-13 17:46 ` Michal Suchanek 2016-06-13 23:31 ` [linux-sunxi] " Julian Calaby 2016-06-13 23:31 ` Julian Calaby 2016-06-13 23:31 ` Julian Calaby 2016-06-13 23:31 ` Julian Calaby 2016-06-14 4:43 ` [linux-sunxi] " Michal Suchanek 2016-06-14 4:43 ` Michal Suchanek 2016-06-14 4:43 ` Michal Suchanek 2016-06-14 4:43 ` Michal Suchanek 2016-06-13 17:46 ` [PATCH v3 11/13] dt: spi: sun4i: merge sun4i and sun6i binding doc Michal Suchanek 2016-06-13 17:46 ` Michal Suchanek 2016-06-13 23:45 ` [linux-sunxi] " Julian Calaby 2016-06-13 23:45 ` Julian Calaby 2016-06-13 23:45 ` Julian Calaby 2016-06-13 23:45 ` Julian Calaby 2016-06-14 4:40 ` [linux-sunxi] " Michal Suchanek 2016-06-14 4:40 ` Michal Suchanek 2016-06-14 4:40 ` Michal Suchanek 2016-06-14 4:40 ` Michal Suchanek 2016-06-14 4:48 ` [linux-sunxi] " Julian Calaby 2016-06-14 4:48 ` Julian Calaby 2016-06-14 4:48 ` Julian Calaby 2016-06-14 4:48 ` Julian Calaby 2016-06-13 17:46 ` [PATCH v3 10/13] spi: sunxi: merge sun4i and sun6i SPI driver Michal Suchanek 2016-06-13 17:46 ` Michal Suchanek 2016-06-13 23:43 ` [linux-sunxi] " Julian Calaby 2016-06-13 23:43 ` Julian Calaby 2016-06-13 23:43 ` Julian Calaby 2016-06-13 23:43 ` Julian Calaby 2016-06-14 4:34 ` [linux-sunxi] " Michal Suchanek 2016-06-14 4:34 ` Michal Suchanek 2016-06-14 4:34 ` Michal Suchanek 2016-06-14 4:34 ` Michal Suchanek 2016-06-14 4:47 ` [linux-sunxi] " Julian Calaby 2016-06-14 4:47 ` Julian Calaby 2016-06-14 4:47 ` Julian Calaby 2016-06-14 4:47 ` Julian Calaby 2016-06-14 5:28 ` [linux-sunxi] " Michal Suchanek 2016-06-14 5:28 ` Michal Suchanek 2016-06-14 5:28 ` Michal Suchanek 2016-06-14 5:28 ` Michal Suchanek 2016-06-14 5:45 ` [linux-sunxi] " Julian Calaby 2016-06-14 5:45 ` Julian Calaby 2016-06-14 5:45 ` Julian Calaby 2016-06-14 5:45 ` Julian Calaby 2016-06-14 6:35 ` Michal Suchanek 2016-06-14 6:35 ` Michal Suchanek 2016-06-14 6:35 ` Michal Suchanek 2016-06-14 6:35 ` Michal Suchanek 2016-06-14 11:20 ` [linux-sunxi] " Julian Calaby 2016-06-14 11:20 ` Julian Calaby 2016-06-14 11:20 ` Julian Calaby 2016-06-14 11:20 ` Julian Calaby 2016-06-13 17:46 ` [PATCH v3 13/13] spi: sun4i: add DMA support Michal 2016-06-13 17:46 ` Michal 2016-06-13 17:46 ` [PATCH v3 12/13] spi: sunxi: remove CONFIG_SPI_SUN6I Michal Suchanek 2016-06-13 17:46 ` Michal Suchanek 2016-06-13 19:57 ` [PATCH v3 00/13] sunxi spi fixes Maxime Ripard 2016-06-13 19:57 ` Maxime Ripard 2016-06-13 19:57 ` Maxime Ripard 2016-06-14 4:50 ` Michal Suchanek 2016-06-14 4:50 ` Michal Suchanek 2016-06-14 4:50 ` Michal Suchanek 2016-06-14 4:50 ` Michal Suchanek 2016-06-14 4:50 ` Michal Suchanek 2016-06-17 10:34 ` Michal Suchanek 2016-06-17 10:34 ` Michal Suchanek 2016-06-17 10:34 ` Michal Suchanek 2016-06-17 10:34 ` Michal Suchanek 2016-06-17 10:34 ` Michal Suchanek 2016-07-25 7:32 ` Maxime Ripard 2016-07-25 7:32 ` Maxime Ripard 2016-07-25 7:32 ` Maxime Ripard 2016-07-25 7:32 ` Maxime Ripard 2016-07-25 7:32 ` Maxime Ripard 2016-07-25 8:03 ` Michal Suchanek 2016-07-25 8:03 ` Michal Suchanek 2016-07-25 8:03 ` Michal Suchanek 2016-07-25 8:03 ` Michal Suchanek 2016-07-25 8:03 ` Michal Suchanek 2016-07-29 20:22 ` Maxime Ripard 2016-07-29 20:22 ` Maxime Ripard 2016-07-29 20:22 ` Maxime Ripard 2016-07-29 20:22 ` Maxime Ripard 2016-07-29 20:22 ` Maxime Ripard 2016-07-30 17:32 ` Michal Suchanek 2016-07-30 17:32 ` Michal Suchanek 2016-07-30 17:32 ` Michal Suchanek 2016-07-30 17:32 ` Michal Suchanek 2016-07-30 17:32 ` Michal Suchanek
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=2db0ce0ea1ddc17e9bb790c8cc50bcb4bb97be58.1465490774.git.hramrach@gmail.com \ --to=hramrach@gmail.com \ --cc=arnd@arndb.de \ --cc=b18965@freescale.com \ --cc=broonie@kernel.org \ --cc=galak@codeaurora.org \ --cc=horms+renesas@verge.net.au \ --cc=ijc+devicetree@hellion.org.uk \ --cc=info@gerhard-bertelsmann. \ --cc=javier@osg.samsung.com \ --cc=k.kozlowski@samsung.com \ --cc=linux-sunxi@googlegroups.com \ --cc=linux@armlinux.org.uk \ --cc=mark.rutland@arm.com \ --cc=maxime.ripard@free-electrons.com \ --cc=net147@gmail.com \ --cc=olof@lixom.net \ --cc=pawel.moll@arm.com \ --cc=public_timo.s@silentcreek.de \ --cc=robh+dt@kernel.org \ --cc=sjoerd.simons@collabora.co.uk \ --cc=stable@vger.kernel.org \ --cc=treding@nvidia.com \ --cc=wens@csie.org \ /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.