Re: [PATCH net v2] net: phy: spi_ks8995: Do not overwrite SPI mode flags

From: Sven Van Asbroeck
Date: Wed Nov 11 2020 - 11:03:53 EST


A spi core fix has been accepted which makes this patch unnecessary.

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/commit/?id=766c6b63aa044e84b045803b40b14754d69a2a1d

On Tue, Nov 10, 2020 at 9:20 AM Sven Van Asbroeck <thesven73@xxxxxxxxx> wrote:
>
>
> This driver makes sure the underlying SPI bus is set to "mode 0"
> by assigning SPI_MODE_0 to spi->mode. Which overwrites all other
> SPI mode flags.
>
> In some circumstances, this can break the underlying SPI bus driver.
> For example, if SPI_CS_HIGH is set on the SPI bus, the driver
> will clear that flag, which results in a chip-select polarity issue.
>
> Fix by changing only the SPI_MODE_N bits, i.e. SPI_CPHA and SPI_CPOL.
>
> Fixes: a8e510f682fe ("phy: Micrel KS8995MA 5-ports 10/100 managed Ethernet switch support added")
> Fixes: f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs")
> Link: https://patchwork.kernel.org/project/spi-devel-general/patch/20201106150706.29089-1-TheSven73@xxxxxxxxx/#23747737
> Signed-off-by: Sven Van Asbroeck <thesven73@xxxxxxxxx>
> ---