mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Serge Semin <fancer.lancer@gmail.com>
To: Lars Povlsen <lars.povlsen@microchip.com>
Cc: Mark Brown <broonie@kernel.org>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: dw: Fix spi registration for controllers overriding CS
Date: Wed, 25 Nov 2020 15:39:35 +0300	[thread overview]
Message-ID: <20201125123935.akerf6mlgiwdemmm@mobilestation> (raw)
In-Reply-To: <20201120213414.339701-1-lars.povlsen@microchip.com>

Hello Lars

On Fri, Nov 20, 2020 at 10:34:14PM +0100, Lars Povlsen wrote:
> When SPI DW memory ops support was introduced, there was a check for
> excluding controllers which supplied their own CS function. Even so,
> the mem_ops pointer is *always* presented to the SPI core.
> 
> This causes the SPI core sanity check in spi_controller_check_ops() to
> refuse registration, since a mem_ops pointer is being supplied without
> an exec_op member function.
> 
> The end result is failure of the SPI DW driver on sparx5 and similar
> platforms.
> 
> The fix in the core SPI DW driver is to avoid presenting the mem_ops
> pointer if the exec_op function is not set.

Thanks for sending the patch fixing the regression.
Acked-by: Serge Semin <fancer.lancer@gmail.com>

> 
> Fixes: 6423207e57ea (spi: dw: Add memory operations support)
> Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>
> ---
>  drivers/spi/spi-dw-core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c
> index 2e50cc0a9291..a0794eac2094 100644
> --- a/drivers/spi/spi-dw-core.c
> +++ b/drivers/spi/spi-dw-core.c
> @@ -875,7 +875,8 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
>  		master->set_cs = dw_spi_set_cs;
>  	master->transfer_one = dw_spi_transfer_one;
>  	master->handle_err = dw_spi_handle_err;
> -	master->mem_ops = &dws->mem_ops;
> +	if (dws->mem_ops.exec_op)
> +		master->mem_ops = &dws->mem_ops;
>  	master->max_speed_hz = dws->max_freq;
>  	master->dev.of_node = dev->of_node;
>  	master->dev.fwnode = dev->fwnode;
> --
> 2.25.1

  reply	other threads:[~2020-11-25 12:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 21:34 Lars Povlsen
2020-11-25 12:39 ` Serge Semin [this message]
2020-11-25 13:58 ` Mark Brown

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=20201125123935.akerf6mlgiwdemmm@mobilestation \
    --to=fancer.lancer@gmail.com \
    --cc=broonie@kernel.org \
    --cc=lars.povlsen@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®