* Re: [PATCH v3 01/13] spi: sunxi: set maximum and minimum speed of SPI master
[not found] ` <2db0ce0ea1ddc17e9bb790c8cc50bcb4bb97be58.1465490774.git.hramrach@gmail.com>
@ 2016-06-13 19:55 ` Maxime Ripard
0 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2016-06-13 19:55 UTC (permalink / raw)
To: Michal Suchanek
Cc: linux-sunxi, stable, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Chen-Yu Tsai, Russell King, Mark Brown,
Arnd Bergmann, Olof Johansson, Krzysztof Kozlowski,
Javier Martinez Canillas, Simon Horman, Sjoerd Simons,
Thierry Reding, Alison Wang, Timo Sigurdsson, Jonathan Liu,
Gerhard Bertelsmann, Priit Laes, devicetree, linux-arm-kernel,
linux-kernel, linux-spi
[-- Attachment #1: Type: text/plain, Size: 2114 bytes --]
On Mon, Jun 13, 2016 at 05:46:49PM -0000, Michal Suchanek wrote:
> 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;
I really don't get why you want to do that kind of padding, when no
one does in the rest of the driver, or the rest of the kernel.
Once properly changed,
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 02/13] spi: sunxi: fix transfer timeout
[not found] ` <064955d033503f129c3e138b0563817d1fffab27.1465490774.git.hramrach@gmail.com>
@ 2016-06-13 19:55 ` Maxime Ripard
0 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2016-06-13 19:55 UTC (permalink / raw)
To: Michal Suchanek
Cc: linux-sunxi, stable, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Chen-Yu Tsai, Russell King, Mark Brown,
Arnd Bergmann, Olof Johansson, Krzysztof Kozlowski,
Javier Martinez Canillas, Simon Horman, Sjoerd Simons,
Thierry Reding, Alison Wang, Timo Sigurdsson, Jonathan Liu,
Gerhard Bertelsmann, Priit Laes, devicetree, linux-arm-kernel,
linux-kernel, linux-spi
[-- Attachment #1: Type: text/plain, Size: 544 bytes --]
On Mon, Jun 13, 2016 at 05:46:49PM -0000, Michal Suchanek wrote:
> The trasfer timeout is fixed at 1000 ms. Reading a 4Mbyte flash over
> 1MHz SPI bus takes way longer than that. Calculate the timeout from the
> actual time the transfer is supposed to take and multiply by 2 for good
> measure.
>
> Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 03/13] spi: sun4i: fix FIFO limit
[not found] ` <6495575d7c7e14da06f86d88a6a15042b4c6b96a.1465490774.git.hramrach@gmail.com>
@ 2016-06-13 19:56 ` Maxime Ripard
0 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2016-06-13 19:56 UTC (permalink / raw)
To: Michal Suchanek
Cc: linux-sunxi, stable, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Chen-Yu Tsai, Russell King, Mark Brown,
Arnd Bergmann, Olof Johansson, Krzysztof Kozlowski,
Javier Martinez Canillas, Simon Horman, Sjoerd Simons,
Thierry Reding, Alison Wang, Timo Sigurdsson, Jonathan Liu,
Gerhard Bertelsmann, Priit Laes, devicetree, linux-arm-kernel,
linux-kernel, linux-spi
[-- Attachment #1: Type: text/plain, Size: 475 bytes --]
On Mon, Jun 13, 2016 at 05:46:49PM -0000, Michal Suchanek wrote:
> When testing SPI without DMA I noticed that filling the FIFO on the
> spi controller causes timeout.
>
> Always leave room for one byte in the FIFO.
>
> Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 00/13] sunxi spi fixes
[not found] <cover.1465490774.git.hramrach@gmail.com>
` (2 preceding siblings ...)
[not found] ` <6495575d7c7e14da06f86d88a6a15042b4c6b96a.1465490774.git.hramrach@gmail.com>
@ 2016-06-13 19:57 ` Maxime Ripard
2016-06-14 4:50 ` Michal Suchanek
2016-06-17 10:34 ` Michal Suchanek
3 siblings, 2 replies; 10+ messages in thread
From: Maxime Ripard @ 2016-06-13 19:57 UTC (permalink / raw)
To: Michal Suchanek
Cc: linux-sunxi, stable, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Chen-Yu Tsai, Russell King, Mark Brown,
Arnd Bergmann, Olof Johansson, Krzysztof Kozlowski,
Javier Martinez Canillas, Simon Horman, Sjoerd Simons,
Thierry Reding, Alison Wang, Timo Sigurdsson, Jonathan Liu,
Gerhard Bertelsmann, Priit Laes, devicetree, linux-arm-kernel,
linux-kernel, linux-spi
[-- Attachment #1: Type: text/plain, Size: 1103 bytes --]
On Mon, Jun 13, 2016 at 05:46:48PM -0000, Michal Suchanek wrote:
> Hello,
>
> This is update of the sunxi spi patches that should give full-featured SPI
> driver.
>
> First three patches fix issues with the current driver and can be of use for
> stable kernels so adding cc for those.
>
> I merged the sun4i and sun6i driver because there several issues that need to
> be fixed in both separately and they are even out of sync wrt some fixes.
> I guess some of the merge patches can be squashed.
>
> I tested this with A10s Olinuxino Micro. I have no sun6i device so I cannot
> tell if that side was broken by this patchset - especially the last patch that
> adds DMA was afaik never tested on sun6i.
So, you didn't run that code through checkpatch and you rewrite the
whole thing entirely without even testing it... Awesome.
For the record, I'm still very much opposed to such a merge.
The first fixes are very welcome though, can and should go in.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 00/13] sunxi spi fixes
2016-06-13 19:57 ` [PATCH v3 00/13] sunxi spi fixes Maxime Ripard
@ 2016-06-14 4:50 ` Michal Suchanek
2016-06-17 10:34 ` Michal Suchanek
1 sibling, 0 replies; 10+ messages in thread
From: Michal Suchanek @ 2016-06-14 4:50 UTC (permalink / raw)
To: Maxime Ripard
Cc: linux-sunxi, stable, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Chen-Yu Tsai, Russell King, Mark Brown,
Arnd Bergmann, Olof Johansson, Krzysztof Kozlowski,
Javier Martinez Canillas, Simon Horman, Sjoerd Simons,
Thierry Reding, Alison Wang, Timo Sigurdsson, Jonathan Liu,
Gerhard Bertelsmann, Priit Laes, devicetree,
linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List,
linux-spi
Hello,
On 13 June 2016 at 21:57, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Mon, Jun 13, 2016 at 05:46:48PM -0000, Michal Suchanek wrote:
>> Hello,
>>
>> This is update of the sunxi spi patches that should give full-featured SPI
>> driver.
>>
>> First three patches fix issues with the current driver and can be of use for
>> stable kernels so adding cc for those.
>>
>> I merged the sun4i and sun6i driver because there several issues that need to
>> be fixed in both separately and they are even out of sync wrt some fixes.
>> I guess some of the merge patches can be squashed.
>>
>> I tested this with A10s Olinuxino Micro. I have no sun6i device so I cannot
>> tell if that side was broken by this patchset - especially the last patch that
>> adds DMA was afaik never tested on sun6i.
>
> So, you didn't run that code through checkpatch and you rewrite the
> whole thing entirely without even testing it... Awesome.
Aside from the DMA part this is not a rewrite.
And I did run the code through checkpatch. It still gives some
warnings about BUG_ON and overly long lines, sure. II don't think
those are that serious or that fixing them would improve the code.
Thanks
Michal
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 00/13] sunxi spi fixes
2016-06-13 19:57 ` [PATCH v3 00/13] sunxi spi fixes Maxime Ripard
2016-06-14 4:50 ` Michal Suchanek
@ 2016-06-17 10:34 ` Michal Suchanek
2016-07-25 7:32 ` Maxime Ripard
1 sibling, 1 reply; 10+ messages in thread
From: Michal Suchanek @ 2016-06-17 10:34 UTC (permalink / raw)
To: Maxime Ripard
Cc: linux-sunxi, stable, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Chen-Yu Tsai, Russell King, Mark Brown,
Arnd Bergmann, Olof Johansson, Krzysztof Kozlowski,
Javier Martinez Canillas, Simon Horman, Sjoerd Simons,
Thierry Reding, Alison Wang, Timo Sigurdsson, Jonathan Liu,
Gerhard Bertelsmann, Priit Laes, devicetree,
linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List,
linux-spi
Hello,
On 13 June 2016 at 21:57, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Mon, Jun 13, 2016 at 05:46:48PM -0000, Michal Suchanek wrote:
>> Hello,
>>
>> This is update of the sunxi spi patches that should give full-featured SPI
>> driver.
>>
>> First three patches fix issues with the current driver and can be of use for
>> stable kernels so adding cc for those.
>>
>> I merged the sun4i and sun6i driver because there several issues that need to
>> be fixed in both separately and they are even out of sync wrt some fixes.
>> I guess some of the merge patches can be squashed.
>>
>> I tested this with A10s Olinuxino Micro. I have no sun6i device so I cannot
>> tell if that side was broken by this patchset - especially the last patch that
>> adds DMA was afaik never tested on sun6i.
>
>
> For the record, I'm still very much opposed to such a merge.
>
What is the reason against the merge? I did not find the original discussion.
I tried to rename everything in the drivers from sun4i and sun6i to
sunxi to look at a clean diff and found about 5 differences 2 of which
look like a bug.
Thanks
Michal
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 00/13] sunxi spi fixes
2016-06-17 10:34 ` Michal Suchanek
@ 2016-07-25 7:32 ` Maxime Ripard
2016-07-25 8:03 ` Michal Suchanek
0 siblings, 1 reply; 10+ messages in thread
From: Maxime Ripard @ 2016-07-25 7:32 UTC (permalink / raw)
To: Michal Suchanek
Cc: linux-sunxi, stable, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Chen-Yu Tsai, Russell King, Mark Brown,
Arnd Bergmann, Olof Johansson, Krzysztof Kozlowski,
Javier Martinez Canillas, Simon Horman, Sjoerd Simons,
Thierry Reding, Alison Wang, Timo Sigurdsson, Jonathan Liu,
Gerhard Bertelsmann, Priit Laes, devicetree,
linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List,
linux-spi
[-- Attachment #1: Type: text/plain, Size: 1769 bytes --]
On Fri, Jun 17, 2016 at 12:34:44PM +0200, Michal Suchanek wrote:
> Hello,
>
> On 13 June 2016 at 21:57, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > On Mon, Jun 13, 2016 at 05:46:48PM -0000, Michal Suchanek wrote:
> >> Hello,
> >>
> >> This is update of the sunxi spi patches that should give full-featured SPI
> >> driver.
> >>
> >> First three patches fix issues with the current driver and can be of use for
> >> stable kernels so adding cc for those.
> >>
> >> I merged the sun4i and sun6i driver because there several issues that need to
> >> be fixed in both separately and they are even out of sync wrt some fixes.
> >> I guess some of the merge patches can be squashed.
> >>
> >> I tested this with A10s Olinuxino Micro. I have no sun6i device so I cannot
> >> tell if that side was broken by this patchset - especially the last patch that
> >> adds DMA was afaik never tested on sun6i.
> >
> >
> > For the record, I'm still very much opposed to such a merge.
>
> What is the reason against the merge? I did not find the original
> discussion.
I really prefer some code that is concise and clear but a little
duplicated over some code that shares every possible lines of code but
is a giant mess impossible to understand.
I just came across the reg_field stuff in regmap that would allow to
partially address that problem though, there's still the bit indices
issue to overcome though.
> I tried to rename everything in the drivers from sun4i and sun6i to
> sunxi to look at a clean diff and found about 5 differences 2 of which
> look like a bug.
It's hard to tell without testing.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 00/13] sunxi spi fixes
2016-07-25 7:32 ` Maxime Ripard
@ 2016-07-25 8:03 ` Michal Suchanek
2016-07-29 20:22 ` Maxime Ripard
0 siblings, 1 reply; 10+ messages in thread
From: Michal Suchanek @ 2016-07-25 8:03 UTC (permalink / raw)
To: Maxime Ripard
Cc: linux-sunxi, stable, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Chen-Yu Tsai, Russell King, Mark Brown,
Arnd Bergmann, Olof Johansson, Krzysztof Kozlowski,
Javier Martinez Canillas, Simon Horman, Sjoerd Simons,
Thierry Reding, Alison Wang, Timo Sigurdsson, Jonathan Liu,
Gerhard Bertelsmann, Priit Laes, devicetree,
linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List,
linux-spi
Hello,
On 25 July 2016 at 09:32, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Fri, Jun 17, 2016 at 12:34:44PM +0200, Michal Suchanek wrote:
>> Hello,
>>
>> On 13 June 2016 at 21:57, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>> > On Mon, Jun 13, 2016 at 05:46:48PM -0000, Michal Suchanek wrote:
>> >> Hello,
>> >>
>> >> This is update of the sunxi spi patches that should give full-featured SPI
>> >> driver.
>> >>
>> >> First three patches fix issues with the current driver and can be of use for
>> >> stable kernels so adding cc for those.
>> >>
>> >> I merged the sun4i and sun6i driver because there several issues that need to
>> >> be fixed in both separately and they are even out of sync wrt some fixes.
>> >> I guess some of the merge patches can be squashed.
>> >>
>> >> I tested this with A10s Olinuxino Micro. I have no sun6i device so I cannot
>> >> tell if that side was broken by this patchset - especially the last patch that
>> >> adds DMA was afaik never tested on sun6i.
>> >
>> >
>> > For the record, I'm still very much opposed to such a merge.
>>
>> What is the reason against the merge? I did not find the original
>> discussion.
>
> I really prefer some code that is concise and clear but a little
> duplicated over some code that shares every possible lines of code but
> is a giant mess impossible to understand.
Yes, it's been tried. In the case of this driver there is more duplication
than differences. Also bitrot due to different variants receiving different
updates and fixes crept in already.
Adding the remap layer certainly does not make the driver easier to
understand but it's not becoming giant mess either.
>
> I just came across the reg_field stuff in regmap that would allow to
> partially address that problem though, there's still the bit indices
> issue to overcome though.
>
>> I tried to rename everything in the drivers from sun4i and sun6i to
>> sunxi to look at a clean diff and found about 5 differences 2 of which
>> look like a bug.
>
> It's hard to tell without testing.
I tested the merged (and separate) driver on a H3 board and found a
type bug in the remap layer.
I also found I can transfer at most 68 bytes without DMA although
the manuals claim 128 byte FIFO. DMA transfers weren't very reliable
which may or may not be a wiring issue. I have seen similar issues
intermittently with SPI on A10s.
Thanks
Michal
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 00/13] sunxi spi fixes
2016-07-25 8:03 ` Michal Suchanek
@ 2016-07-29 20:22 ` Maxime Ripard
2016-07-30 17:32 ` Michal Suchanek
0 siblings, 1 reply; 10+ messages in thread
From: Maxime Ripard @ 2016-07-29 20:22 UTC (permalink / raw)
To: Michal Suchanek
Cc: linux-sunxi, stable, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Chen-Yu Tsai, Russell King, Mark Brown,
Arnd Bergmann, Olof Johansson, Krzysztof Kozlowski,
Javier Martinez Canillas, Simon Horman, Sjoerd Simons,
Thierry Reding, Alison Wang, Timo Sigurdsson, Jonathan Liu,
Gerhard Bertelsmann, Priit Laes, devicetree,
linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List,
linux-spi
[-- Attachment #1: Type: text/plain, Size: 2220 bytes --]
On Mon, Jul 25, 2016 at 10:03:14AM +0200, Michal Suchanek wrote:
> Hello,
>
> On 25 July 2016 at 09:32, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > On Fri, Jun 17, 2016 at 12:34:44PM +0200, Michal Suchanek wrote:
> >> Hello,
> >>
> >> On 13 June 2016 at 21:57, Maxime Ripard
> >> <maxime.ripard@free-electrons.com> wrote:
> >> > On Mon, Jun 13, 2016 at 05:46:48PM -0000, Michal Suchanek wrote:
> >> >> Hello,
> >> >>
> >> >> This is update of the sunxi spi patches that should give full-featured SPI
> >> >> driver.
> >> >>
> >> >> First three patches fix issues with the current driver and can be of use for
> >> >> stable kernels so adding cc for those.
> >> >>
> >> >> I merged the sun4i and sun6i driver because there several issues that need to
> >> >> be fixed in both separately and they are even out of sync wrt some fixes.
> >> >> I guess some of the merge patches can be squashed.
> >> >>
> >> >> I tested this with A10s Olinuxino Micro. I have no sun6i device so I cannot
> >> >> tell if that side was broken by this patchset - especially the last patch that
> >> >> adds DMA was afaik never tested on sun6i.
> >> >
> >> >
> >> > For the record, I'm still very much opposed to such a merge.
> >>
> >> What is the reason against the merge? I did not find the original
> >> discussion.
> >
> > I really prefer some code that is concise and clear but a little
> > duplicated over some code that shares every possible lines of code but
> > is a giant mess impossible to understand.
>
> Yes, it's been tried. In the case of this driver there is more duplication
> than differences. Also bitrot due to different variants receiving different
> updates and fixes crept in already.
>
> Adding the remap layer certainly does not make the driver easier to
> understand but it's not becoming giant mess either.
Well, when you say that you're not quite fond of using your structure
all over the place because "it makes your eyes bleed", I wouldn't call
that a good sales pitch.
But again, reg_field seems like a good solution for that.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 00/13] sunxi spi fixes
2016-07-29 20:22 ` Maxime Ripard
@ 2016-07-30 17:32 ` Michal Suchanek
0 siblings, 0 replies; 10+ messages in thread
From: Michal Suchanek @ 2016-07-30 17:32 UTC (permalink / raw)
To: Maxime Ripard
Cc: linux-sunxi, stable, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Chen-Yu Tsai, Russell King, Mark Brown,
Arnd Bergmann, Olof Johansson, Krzysztof Kozlowski,
Javier Martinez Canillas, Simon Horman, Sjoerd Simons,
Thierry Reding, Alison Wang, Timo Sigurdsson, Jonathan Liu,
Gerhard Bertelsmann, Priit Laes, devicetree,
linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List,
linux-spi
On 29 July 2016 at 22:22, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Mon, Jul 25, 2016 at 10:03:14AM +0200, Michal Suchanek wrote:
>> Hello,
>>
>> On 25 July 2016 at 09:32, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>> > On Fri, Jun 17, 2016 at 12:34:44PM +0200, Michal Suchanek wrote:
>> >> Hello,
>> >>
>> >> On 13 June 2016 at 21:57, Maxime Ripard
>> >> <maxime.ripard@free-electrons.com> wrote:
>> >> > On Mon, Jun 13, 2016 at 05:46:48PM -0000, Michal Suchanek wrote:
>> >> >> Hello,
>> >> >>
>> >> >> This is update of the sunxi spi patches that should give full-featured SPI
>> >> >> driver.
>> >> >>
>> >> >> First three patches fix issues with the current driver and can be of use for
>> >> >> stable kernels so adding cc for those.
>> >> >>
>> >> >> I merged the sun4i and sun6i driver because there several issues that need to
>> >> >> be fixed in both separately and they are even out of sync wrt some fixes.
>> >> >> I guess some of the merge patches can be squashed.
>> >> >>
>> >> >> I tested this with A10s Olinuxino Micro. I have no sun6i device so I cannot
>> >> >> tell if that side was broken by this patchset - especially the last patch that
>> >> >> adds DMA was afaik never tested on sun6i.
>> >> >
>> >> >
>> >> > For the record, I'm still very much opposed to such a merge.
>> >>
>> >> What is the reason against the merge? I did not find the original
>> >> discussion.
>> >
>> > I really prefer some code that is concise and clear but a little
>> > duplicated over some code that shares every possible lines of code but
>> > is a giant mess impossible to understand.
>>
>> Yes, it's been tried. In the case of this driver there is more duplication
>> than differences. Also bitrot due to different variants receiving different
>> updates and fixes crept in already.
>>
>> Adding the remap layer certainly does not make the driver easier to
>> understand but it's not becoming giant mess either.
>
> Well, when you say that you're not quite fond of using your structure
> all over the place because "it makes your eyes bleed", I wouldn't call
> that a good sales pitch.
That's why put dereferencing it inside the read function. It reduces the noise
throughout the code and make it easier to add checks or change the remap
implementation.
>
> But again, reg_field seems like a good solution for that.
I will look at reg_field.
I saw some drivers using remap layers that are way more heavyweight than
looking up an integer in a table so I wanted to avoid that.
Thanks
Michal
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2016-07-30 17:33 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1465490774.git.hramrach@gmail.com>
[not found] ` <2db0ce0ea1ddc17e9bb790c8cc50bcb4bb97be58.1465490774.git.hramrach@gmail.com>
2016-06-13 19:55 ` [PATCH v3 01/13] spi: sunxi: set maximum and minimum speed of SPI master Maxime Ripard
[not found] ` <064955d033503f129c3e138b0563817d1fffab27.1465490774.git.hramrach@gmail.com>
2016-06-13 19:55 ` [PATCH v3 02/13] spi: sunxi: fix transfer timeout Maxime Ripard
[not found] ` <6495575d7c7e14da06f86d88a6a15042b4c6b96a.1465490774.git.hramrach@gmail.com>
2016-06-13 19:56 ` [PATCH v3 03/13] spi: sun4i: fix FIFO limit Maxime Ripard
2016-06-13 19:57 ` [PATCH v3 00/13] sunxi spi fixes Maxime Ripard
2016-06-14 4:50 ` Michal Suchanek
2016-06-17 10:34 ` Michal Suchanek
2016-07-25 7:32 ` Maxime Ripard
2016-07-25 8:03 ` Michal Suchanek
2016-07-29 20:22 ` Maxime Ripard
2016-07-30 17:32 ` Michal Suchanek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).