RE: [RFC PATCH 1/2] mmc: renesas_sdhi: Add manual correction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wolfram-san,

> From: Wolfram Sang, Sent: Wednesday, December 4, 2019 5:33 AM
> 
> This patch adds a manual correction mechanism for SDHI. Currently, SDHI
> uses automatic TAP position correction. However, TAP position can also
> be corrected manually via correction error status flags.
> 
> Signed-off-by: Takeshi Saito <takeshi.saito.xv@xxxxxxxxxxx>
> Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
> ---
> 
> Pretty much like the BSP patch. Just some rebasing, refactorization and
> updates of the commit message. I especially changed the original
> calculation from:
> 
> +               host->tap_set = (host->tap_set +
> +                                host->tap_num + 1) % host->tap_num;
> 
>  to:
> 
> +		host->tap_set = (host->tap_set + 1) % host->tap_num;
> 
> (same for -1). Because "+ tap_num % tap_num" is a NOOP. Or did I miss
> something?

Thank you for the patch! I checked your calculation and it's no problem
because the type of host->tap_set is unsigned long.

example 1 (set = 0, num = 8, down):
 BSP code:  (0 + 8 - 1) % 8 = 7 % 8 = 7
 your code: (0 - 1) % 8 = 0xffffffffffffffff % 8 = 7

example 2 (set = 7, num = 8, up):
 BSP code:  (7 + 8 + 1) % 8 = 16 % 8 = 0
 your code: (7 + 1) % 8 = 8 % 8 = 0

So,

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>

I have a nit comment below:

<snip>
>  static bool renesas_sdhi_check_scc_error(struct tmio_mmc_host *host)
>  {
>  	struct renesas_sdhi *priv = host_to_priv(host);
>  	bool use_4tap = priv->quirks && priv->quirks->hs400_4taps;
> 
> -

nit: This deleting a blank line is not needed after the following patch was fixed :)
https://patchwork.kernel.org/patch/11271859/

Best regards,
Yoshihiro Shimoda





[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux