Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Sven Van Asbroeck
On Mon, Nov 9, 2020 at 5:50 PM Jakub Kicinski wrote: > > But please at least repost for net and CC Mark and the SPI list > for input. > > Maybe Mark has a different idea on how client drivers should behave. > > Also please obviously CC the author of the patch who introduced > the breakage. I

Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Jakub Kicinski
On Mon, 9 Nov 2020 17:39:22 -0500 Sven Van Asbroeck wrote: > What I already posted (as v1) should be the minimal fix. > Can we proceed on that basis? I'll follow up with the helper > after the net -> net-next merge, as you suggested. Well, you cut off the relevant part of my email where I said:

Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Sven Van Asbroeck
On Mon, Nov 9, 2020 at 5:36 PM Jakub Kicinski wrote: > > Yes, most certainly. Especially with 5.10 being LTS. > > You can send a minimal fix (perhaps what you got already?), and follow > up with the helper as suggested by Andrew after ~a week when net is > merged into net-next. > What I already p

Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Jakub Kicinski
On Mon, 9 Nov 2020 17:27:28 -0500 Sven Van Asbroeck wrote: > On Mon, Nov 9, 2020 at 5:23 PM Jakub Kicinski wrote: > > > > Is it only broken for you in linux-next or just in the current 5.10 > > release? > > It's broken for me in the current 5.10 release. That means it should > go to net, not ne

Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Sven Van Asbroeck
On Mon, Nov 9, 2020 at 5:23 PM Jakub Kicinski wrote: > > Is it only broken for you in linux-next or just in the current 5.10 > release? It's broken for me in the current 5.10 release. That means it should go to net, not net-next, correct?

Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Jakub Kicinski
On Mon, 9 Nov 2020 17:19:48 -0500 Sven Van Asbroeck wrote: > On Mon, Nov 9, 2020 at 5:04 PM Jakub Kicinski wrote: > > > > Yup > > Just a minute. Earlier in the thread, Andrew Lunn is suggesting I > create a new spi helper function, and cross-post to the spi group(s). > > That doesn't sound lik

Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Sven Van Asbroeck
On Mon, Nov 9, 2020 at 5:04 PM Jakub Kicinski wrote: > > Yup Just a minute. Earlier in the thread, Andrew Lunn is suggesting I create a new spi helper function, and cross-post to the spi group(s). That doesn't sound like a minimal fix, should it go to net or net-next? Thanks, Sven

Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Jakub Kicinski
On Mon, 9 Nov 2020 16:29:19 -0500 Sven Van Asbroeck wrote: > On Mon, Nov 9, 2020 at 4:24 PM Jakub Kicinski wrote: > > > > the commit > > which introduced the assignment in the client driver. > > That's the commit which adds the initial driver to the tree, back in 2011. > Should I use that for F

Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Sven Van Asbroeck
On Mon, Nov 9, 2020 at 4:24 PM Jakub Kicinski wrote: > > the commit > which introduced the assignment in the client driver. That's the commit which adds the initial driver to the tree, back in 2011. Should I use that for Fixes?

Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Jakub Kicinski
On Mon, 9 Nov 2020 16:20:46 -0500 Sven Van Asbroeck wrote: > Is this a bug? If so, what should its Fixes commit be? The spi commit > upstream that enables SPI_CS_HIGH on my platform? I'd put two fixes tags one for the spi commit and one for the commit which introduced the assignment in the client

Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Sven Van Asbroeck
On Mon, Nov 9, 2020 at 4:09 PM Jakub Kicinski wrote: > > This is a fix right? You seem to be targeting net-next and there is no > Fixes tag but it sounds like a bug. I'm not sure. The original code used to work for me, until the spi bus driver I'm using to communicate to this chip was changed to

Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Jakub Kicinski
On Mon, 9 Nov 2020 14:31:17 -0500 Sven Van Asbroeck wrote: > From: Sven Van Asbroeck > > This driver makes sure the underlying SPI bus is set to "mode 0" > by assigning SPI_MODE_0 to spi->mode. This overwrites all other > SPI mode flags. > > In some circumstances, this can break the underlying

Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Sven Van Asbroeck
On Mon, Nov 9, 2020 at 3:26 PM Andrew Lunn wrote: > > Then you should consider adding it, and cross post the SPI list. > Good idea. I will give that a try.

Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Andrew Lunn
On Mon, Nov 09, 2020 at 02:56:38PM -0500, Sven Van Asbroeck wrote: > On Mon, Nov 9, 2020 at 2:49 PM Andrew Lunn wrote: > > > > Did you check to see if there is a help to set just the mode without > > changing any of the other bits? > > Absolutely, but it doesn't exist, AFAIK. > It would be great

Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Sven Van Asbroeck
On Mon, Nov 9, 2020 at 2:49 PM Andrew Lunn wrote: > > Did you check to see if there is a help to set just the mode without > changing any of the other bits? Absolutely, but it doesn't exist, AFAIK. It would be great if client spi drivers would use a helper function like that. The spi bus driver

Re: [PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Andrew Lunn
> +++ b/drivers/net/phy/spi_ks8995.c > @@ -491,7 +491,9 @@ static int ks8995_probe(struct spi_device *spi) > > spi_set_drvdata(spi, ks); > > - spi->mode = SPI_MODE_0; > + /* use SPI_MODE_0 without changing any other mode flags */ > + spi->mode &= ~(SPI_CPHA | SPI_CPOL); > +

[PATCH net-next v1] net: phy: spi_ks8995: Do not overwrite SPI mode flags

2020-11-09 Thread Sven Van Asbroeck
From: Sven Van Asbroeck This driver makes sure the underlying SPI bus is set to "mode 0" by assigning SPI_MODE_0 to spi->mode. This 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 dri