All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Chris Brandt <chris.brandt@renesas.com>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Ulrich Hecht <uli@fpond.eu>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH/RFC 0/4] sh-sci : Do not derive regshift from regsize
Date: Mon, 06 Aug 2018 14:37:45 +0000	[thread overview]
Message-ID: <5328542.T44L6SpoGe@avalon> (raw)
In-Reply-To: <20180806140755.24087-1-geert+renesas@glider.be>

Hi Geert,

On Monday, 6 August 2018 17:07:51 EEST Geert Uytterhoeven wrote:
> 	Hi all,
> 
> This RFC patch series was sparked by noticing that commit 2d4dd0da45401c7a

Where can that commit be found ?

> ("serial: sh-sci: Allow for compressed SCIF address") broke earlycon
> support on most Renesas ARM SoCs using SCIF ports, and by the fragility of
> deriving regshift from the register block size (which may be rounded up):

Why should it be rounded up ?

>   1. The first patch is an old patch from Sato-san, which I never really
>      understood.  But it turned out to be a dependency for patch 2.
>   2. Patch 2 makes sure regshift is initialized when using earlycon,
>      unbreaking the serial console on e.g. R-Car Gen2 and Gen3.
>   3. Patch 3 reverts the patch that started deriving regshift from the
>      register block size, and that removed the plat_sci_port.regshift
>      field.  Which is a field I needed again in patch 4.
>   4. Patch 4 removes the remaining regshift derivations on DT platforms.
>  (5. I didn't bother writing patch 5, which involves adding .regshift
>      initializations to all SH board files that need it.)
> 
> However, I'm not happy with the end result, so please DO NOT apply this!
> As I spent almost a full day on this, and would still like to know the
> story about "sh-sci: Use a separate sci_port for earlycon", I decided to
> post it anyway.
> 
> As earlycon will be broken in v4.19-rc1 on RZ/A1, RZ/G, and R-Car, assuming
> no other actions are taken, an alternative solution would be to:
>   1. Revert commit 7acece71a517cad8 ("serial: sh-sci: Remove
>      SCIx_RZ_SCIFA_REGTYPE"),
>   2. Revert commit 2d4dd0da45401c7a ("serial: sh-sci: Allow for compressed
>      SCIF address") alternative,
>   3. Add an OF_EARLYCON_DECLARE() for RZ/A2, to fix earlycon on RZ/A2.
> 
> What do you think?
> Thanks for your comments!
> 
> P.S. Apparently SCIx_SH4_SCIF_REGTYPE and SCIx_SH2_SCIF_FIFODATA_REGTYPE
>      are identical?
> 
> Geert Uytterhoeven (3):
>   [RFC] sh-sci: Take into account regshift to fix earlycon breakage
>   [RFC] Revert "serial: sh-sci: Compute the regshift value for SCI
>     ports"
>   [RFC] sh-sci: Derive regshift value from DT compatible value
> 
> Yoshinori Sato (1):
>   [RFC] sh-sci: Use a separate sci_port for earlycon
> 
>  arch/sh/kernel/cpu/sh3/setup-sh770x.c |  1 +
>  arch/sh/kernel/cpu/sh4/setup-sh7750.c |  3 +-
>  arch/sh/kernel/cpu/sh4/setup-sh7760.c | 10 +---
>  drivers/tty/serial/sh-sci.c           | 68 +++++++++++++++++----------
>  include/linux/serial_sci.h            |  1 +
>  5 files changed, 49 insertions(+), 34 deletions(-)

-- 
Regards,

Laurent Pinchart




WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Chris Brandt <chris.brandt@renesas.com>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Ulrich Hecht <uli@fpond.eu>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH/RFC 0/4] sh-sci : Do not derive regshift from regsize
Date: Mon, 06 Aug 2018 17:37:45 +0300	[thread overview]
Message-ID: <5328542.T44L6SpoGe@avalon> (raw)
In-Reply-To: <20180806140755.24087-1-geert+renesas@glider.be>

Hi Geert,

On Monday, 6 August 2018 17:07:51 EEST Geert Uytterhoeven wrote:
> 	Hi all,
> 
> This RFC patch series was sparked by noticing that commit 2d4dd0da45401c7a

Where can that commit be found ?

> ("serial: sh-sci: Allow for compressed SCIF address") broke earlycon
> support on most Renesas ARM SoCs using SCIF ports, and by the fragility of
> deriving regshift from the register block size (which may be rounded up):

Why should it be rounded up ?

>   1. The first patch is an old patch from Sato-san, which I never really
>      understood.  But it turned out to be a dependency for patch 2.
>   2. Patch 2 makes sure regshift is initialized when using earlycon,
>      unbreaking the serial console on e.g. R-Car Gen2 and Gen3.
>   3. Patch 3 reverts the patch that started deriving regshift from the
>      register block size, and that removed the plat_sci_port.regshift
>      field.  Which is a field I needed again in patch 4.
>   4. Patch 4 removes the remaining regshift derivations on DT platforms.
>  (5. I didn't bother writing patch 5, which involves adding .regshift
>      initializations to all SH board files that need it.)
> 
> However, I'm not happy with the end result, so please DO NOT apply this!
> As I spent almost a full day on this, and would still like to know the
> story about "sh-sci: Use a separate sci_port for earlycon", I decided to
> post it anyway.
> 
> As earlycon will be broken in v4.19-rc1 on RZ/A1, RZ/G, and R-Car, assuming
> no other actions are taken, an alternative solution would be to:
>   1. Revert commit 7acece71a517cad8 ("serial: sh-sci: Remove
>      SCIx_RZ_SCIFA_REGTYPE"),
>   2. Revert commit 2d4dd0da45401c7a ("serial: sh-sci: Allow for compressed
>      SCIF address") alternative,
>   3. Add an OF_EARLYCON_DECLARE() for RZ/A2, to fix earlycon on RZ/A2.
> 
> What do you think?
> Thanks for your comments!
> 
> P.S. Apparently SCIx_SH4_SCIF_REGTYPE and SCIx_SH2_SCIF_FIFODATA_REGTYPE
>      are identical?
> 
> Geert Uytterhoeven (3):
>   [RFC] sh-sci: Take into account regshift to fix earlycon breakage
>   [RFC] Revert "serial: sh-sci: Compute the regshift value for SCI
>     ports"
>   [RFC] sh-sci: Derive regshift value from DT compatible value
> 
> Yoshinori Sato (1):
>   [RFC] sh-sci: Use a separate sci_port for earlycon
> 
>  arch/sh/kernel/cpu/sh3/setup-sh770x.c |  1 +
>  arch/sh/kernel/cpu/sh4/setup-sh7750.c |  3 +-
>  arch/sh/kernel/cpu/sh4/setup-sh7760.c | 10 +---
>  drivers/tty/serial/sh-sci.c           | 68 +++++++++++++++++----------
>  include/linux/serial_sci.h            |  1 +
>  5 files changed, 49 insertions(+), 34 deletions(-)

-- 
Regards,

Laurent Pinchart

  parent reply	other threads:[~2018-08-06 14:37 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-06 14:07 [PATCH/RFC 0/4] sh-sci : Do not derive regshift from regsize Geert Uytterhoeven
2018-08-06 14:07 ` Geert Uytterhoeven
2018-08-06 14:07 ` [PATCH/RFC 1/4] sh-sci: Use a separate sci_port for earlycon Geert Uytterhoeven
2018-08-06 14:07   ` Geert Uytterhoeven
2018-08-06 14:07 ` [PATCH/RFC 2/4] sh-sci: Take into account regshift to fix earlycon breakage Geert Uytterhoeven
2018-08-06 14:07   ` Geert Uytterhoeven
2018-08-06 14:07 ` [PATCH/RFC 3/4] Revert "serial: sh-sci: Compute the regshift value for SCI ports" Geert Uytterhoeven
2018-08-06 14:07   ` Geert Uytterhoeven
2018-08-06 14:16   ` Laurent Pinchart
2018-08-06 14:16     ` Laurent Pinchart
2018-08-06 14:34     ` Geert Uytterhoeven
2018-08-06 14:34       ` Geert Uytterhoeven
2018-08-06 14:41       ` Laurent Pinchart
2018-08-06 14:41         ` Laurent Pinchart
2018-08-06 14:52         ` Geert Uytterhoeven
2018-08-06 14:52           ` Geert Uytterhoeven
2018-08-06 14:07 ` [PATCH/RFC 4/4] sh-sci: Derive regshift value from DT compatible value Geert Uytterhoeven
2018-08-06 14:07   ` Geert Uytterhoeven
2018-08-06 14:18   ` Chris Brandt
2018-08-06 14:18     ` Chris Brandt
2018-08-06 14:38     ` Geert Uytterhoeven
2018-08-06 14:38       ` Geert Uytterhoeven
2018-08-06 16:10       ` Chris Brandt
2018-08-06 16:10         ` Chris Brandt
2018-08-07 19:24       ` Chris Brandt
2018-08-07 19:24         ` Chris Brandt
2018-08-07 19:37         ` Geert Uytterhoeven
2018-08-07 19:37           ` Geert Uytterhoeven
2018-08-07 21:10           ` Chris Brandt
2018-08-07 21:10             ` Chris Brandt
2018-08-08  0:16           ` Chris Brandt
2018-08-08  0:16             ` Chris Brandt
2018-08-08 10:11             ` Geert Uytterhoeven
2018-08-08 10:11               ` Geert Uytterhoeven
2018-08-08 10:39               ` Chris Brandt
2018-08-08 10:39                 ` Chris Brandt
2018-08-08 11:05                 ` Geert Uytterhoeven
2018-08-08 11:05                   ` Geert Uytterhoeven
2018-08-06 14:37 ` Laurent Pinchart [this message]
2018-08-06 14:37   ` [PATCH/RFC 0/4] sh-sci : Do not derive regshift from regsize Laurent Pinchart
2018-08-06 14:41   ` Laurent Pinchart
2018-08-06 14:41     ` Laurent Pinchart
2018-08-06 14:41   ` Geert Uytterhoeven
2018-08-06 14:41     ` Geert Uytterhoeven
2018-08-08 11:02 ` Geert Uytterhoeven
2018-08-08 11:02   ` Geert Uytterhoeven
2018-08-08 11:32   ` Chris Brandt
2018-08-08 11:32     ` Chris Brandt
2018-08-08 20:46   ` Chris Brandt
2018-08-08 20:46     ` Chris Brandt

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=5328542.T44L6SpoGe@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=chris.brandt@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=uli@fpond.eu \
    --cc=ysato@users.sourceforge.jp \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.