public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>,
	Sergey Shtylyov <s.shtylyov@omp.ru>,
	Dung Nguyen <dung.nguyen.zy@renesas.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Andrew Gabbasov <andrew_gabbasov@mentor.com>,
	Mark Brown <broonie@kernel.org>,
	linux-renesas-soc@vger.kernel.org, linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] memory: renesas-rpc-if: Fix HF/OSPI data transfer in Manual mode
Date: Fri, 18 Mar 2022 11:14:05 +0100	[thread overview]
Message-ID: <YjRbbbn9U9bff48m@shikoro> (raw)
In-Reply-To: <b409ea3fae4a6778fd6b44815ad17c9e8e10df87.1647512831.git.geert+renesas@glider.be>

[-- Attachment #1: Type: text/plain, Size: 1495 bytes --]

Hi Geert,

thank you for the patch!

> Lightly (read-only) tested on:
>   - Salvator-XS with R-Car M3-W ES1.0 with HyperFLASH,
>   - Falcon with R-Car V3U ES1.0 with QSPI.

I (also lightly) tested writing on the V3U and it seems to still work,
even with the problematic cases we needed to fix earlier.

>       Note: Alternatively, rpcif_manual_xfer() could bypass regmap and
>       use {read,write}[bwl]() directly, cfr. commit 0d37f69cacb33435
>       ("memory: renesas-rpc-if: Correct QSPI data transfer in Manual
>       mode") in the BSP.

As discuseed via IRC, I don't like bypassing regmap. I prefer your
solution here.

> @@ -171,18 +171,32 @@ static int rpcif_reg_read(void *context, unsigned int reg, unsigned int *val)

Before this function is a comment which needs to be updated (away from
SMENR_SPIDE to xfer_size).

> +		switch (rpc->xfer_size) {
> +		case 1:
>  			*val = readb(rpc->base + reg);
>  			return 0;
> -		} else if (spide == 0xC) {
> +
> +		case 2:
>  			*val = readw(rpc->base + reg);
>  			return 0;
> -		} else if (spide != 0xF) {
> +
> +		case 4:
> +		case 8:

I think it is more readable to add here:

  			*val = readl(rpc->base + reg);
  			return 0;

> +			break;

... and remove this break ...


> +
> +		default:
>  			return -EILSEQ;
>  		}
> +		break;

... and this one. Same for the write function. I am not strict on this
one, but I think this make following the logic easier.

Rest looks good. I like the additional checks!

All the best,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-03-18 10:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17 10:33 [PATCH v2] memory: renesas-rpc-if: Fix HF/OSPI data transfer in Manual mode Geert Uytterhoeven
2022-03-18 10:14 ` Wolfram Sang [this message]
2022-03-21 10:24 ` Lad, Prabhakar

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=YjRbbbn9U9bff48m@shikoro \
    --to=wsa+renesas@sang-engineering.com \
    --cc=andrew_gabbasov@mentor.com \
    --cc=broonie@kernel.org \
    --cc=dung.nguyen.zy@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=s.shtylyov@omp.ru \
    /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