Re: [PATCH RFC v1] spi: realtek-rtl: Fix clearing some register bits

From: Martin Blumenstingl
Date: Thu Jul 28 2022 - 11:27:24 EST


Hi Birger,

(sorry for replying late, I missed your mail)

On Mon, Jul 25, 2022 at 10:19 PM Birger Koblitz <mail@xxxxxxxxxxxxxxxxx> wrote:
[...]
> > I stumbled across this while reading the driver. This patch is untested
> > because I don't have any hardware with this controller.
> I believe your fix is correct. In the meantime, more information has been
> learned about this hardware, in particular, newer SoC versions and the possibility
> to have parallel IO and hardware which uses different chip selects.
As Sander pointed out (thanks again!) there's actually an issue with my patch.
I just sent v2 with a fix for RTL_SPI_SFCSR_LEN_MASK.

> I came up with the following patch for supporting this, and it achieves
> what you also propose:
> https://github.com/bkobl/openwrt/blob/rtl8214qf_merge/target/linux/realtek/patches-5.10/317-spi-cs-support-for-spi-realtek-rtl.patch
> It is still is a bit rough, reading it I immediately saw 2 things that
> would need to be fixed, but it also improves e.g. that RTL_SPI_SFCSR
> is now configured independently of what u-boot did to it.
Your patch actually addresses an issue which I have seen with RTL_SPI_SFCSR_CS.
Since you seem to have boards with these Realtek SoCs: could you
please clean up your patch and upstream it (splitting into smaller
patches if/where needed)? That would be a win-win: upstream gains
improved SPI support and I won't be confused the next time I look at
the spi-realtek-rtl driver.


Thank you!
Best regards,
Martin