All of lore.kernel.org
 help / color / mirror / Atom feed
From: Koichiro Den <den@valinux.co.jp>
To: Marek Vasut <marek.vasut+renesas@mailbox.org>
Cc: linux-pci@vger.kernel.org,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Magnus Damm" <magnus.damm@gmail.com>,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] PCI: rcar-gen4: Set SRIS mode in rcar_gen4_pcie_common_init()
Date: Mon, 30 Nov 2026 17:34:34 +0900	[thread overview]
Message-ID: <aw0wuZd7GEyuH6R1@z790sl> (raw)
In-Reply-To: <20261129154135.277882-1-marek.vasut+renesas@mailbox.org>

Hi Marek, thanks for informing me via cc.

On Sun, Nov 29, 2026 at 04:40:52PM +0100, Marek Vasut wrote:
> Except for R-Car S4 variant of this controller, all other variants of
> this PCIe controller set PCIEMSR0 APP_SRIS_MODE bit as part of their
> .link_up callback. Simplify this, introduce .sris_mode flag in driver
  ^^^^^^^^
nit: is this a typo for .ltssm_control?

> data and set it for all but R-Car S4 controller, and then set PCIEMSR0
> APP_SRIS_MODE bit based on this flag in rcar_gen4_pcie_common_init()
> already. Removes one read-modify-write round. No functional change.

For R-Car Gen5 PCIe4, is this really no functional change? If not, would it be
better to split the Gen5 change into a separate patch?

> 
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> ---
> Cc: "Krzysztof Wilczyński" <kwilczynski@kernel.org>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Koichiro Den <den@valinux.co.jp>
> Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
> Cc: Magnus Damm <magnus.damm@gmail.com>
> Cc: Manivannan Sadhasivam <mani@kernel.org>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-renesas-soc@vger.kernel.org
> ---

I'm not sure if everyone involved except me already knows, but is this patch
meant to go on top of the three patches below? (no functional dependency but.)
- https://lore.kernel.org/r/20261028172133.20903-1-marek.vasut+renesas@mailbox.org/
- https://lore.kernel.org/r/20261028172133.20903-2-marek.vasut+renesas@mailbox.org/
- https://lore.kernel.org/r/20261028172208.20948-1-marek.vasut+renesas@mailbox.org/

Best regards,
Koichiro Den

>  drivers/pci/controller/dwc/pcie-rcar-gen4.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-rcar-gen4.c b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> index 2e640110e3910..6fd745099103c 100644
> --- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> +++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> @@ -100,6 +100,7 @@ struct rcar_gen4_pcie_drvdata {
>  	int (*speed_control)(struct rcar_gen4_pcie *rcar);
>  	enum dw_pcie_device_mode mode;
>  	bool mrrs_256b_limit;
> +	bool sris_mode;
>  };
>  
>  struct rcar_gen4_pcie {
> @@ -265,6 +266,9 @@ static int rcar_gen4_pcie_common_init(struct rcar_gen4_pcie *rcar)
>  	if (dw->num_lanes < 4)
>  		val |= BIFUR_MOD_SET_ON;
>  
> +	if (rcar->drvdata->sris_mode)
> +		val |= APP_SRIS_MODE;
> +
>  	writel(val, rcar->base + PCIEMSR0);
>  
>  	ret = reset_control_deassert(dw->core_rsts[DW_PCIE_PWR_RST].rstc);
> @@ -1070,10 +1074,6 @@ static int rcar_gen4_pcie_ltssm_control(struct rcar_gen4_pcie *rcar, bool enable
>  	val |= PORT_FORCE_LINK_DDFS;
>  	dw_pcie_writel_dbi(dw, PORT_FORCE_LINK, val);
>  
> -	val = readl(rcar->base + PCIEMSR0);
> -	val |= APP_SRIS_MODE;
> -	writel(val, rcar->base + PCIEMSR0);
> -
>  	/*
>  	 * The R-Car Gen4 datasheet doesn't describe the PHY registers' name.
>  	 * But, the initialization procedure describes these offsets. So,
> @@ -1157,6 +1157,7 @@ static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen4_pcie = {
>  	.speed_control = rcar_gen4_pcie_speed_control,
>  	.mode = DW_PCIE_RC_TYPE,
>  	.mrrs_256b_limit = true,
> +	.sris_mode = true,
>  };
>  
>  static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen4_pcie_ep = {
> @@ -1166,6 +1167,7 @@ static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen4_pcie_ep = {
>  	.speed_control = rcar_gen4_pcie_speed_control,
>  	.mode = DW_PCIE_EP_TYPE,
>  	.mrrs_256b_limit = true,
> +	.sris_mode = true,
>  };
>  
>  static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen5_pcie = {
> @@ -1174,6 +1176,7 @@ static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen5_pcie = {
>  	.ltssm_control = rcar_gen5_pcie_ltssm_control,
>  	.speed_control = rcar_gen5_pcie_speed_control,
>  	.mode = DW_PCIE_RC_TYPE,
> +	.sris_mode = true,
>  };
>  
>  static const struct of_device_id rcar_gen4_pcie_of_match[] = {
> -- 
> 2.53.0
> 

  reply	other threads:[~2026-11-30  8:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 15:40 [PATCH] PCI: rcar-gen4: Set SRIS mode in rcar_gen4_pcie_common_init() Marek Vasut
2026-11-30  8:34 ` Koichiro Den [this message]
2026-12-02  3:10   ` Marek Vasut
2026-11-30 20:22 ` Niklas Cassel

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=aw0wuZd7GEyuH6R1@z790sl \
    --to=den@valinux.co.jp \
    --cc=bhelgaas@google.com \
    --cc=geert+renesas@glider.be \
    --cc=kwilczynski@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=mani@kernel.org \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=robh@kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /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.