All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Sergey Shtylyov <s.shtylyov@omp.ru>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Richard Weinberger <richard@nod.at>,
	Mark Brown <broonie@kernel.org>,
	linux-mtd@lists.infradead.org, linux-renesas-soc@vger.kernel.org,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/7] memory: renesas-rpc-if: Pass device instead of rpcif to rpcif_*()
Date: Thu, 30 Jun 2022 10:58:51 +0200	[thread overview]
Message-ID: <20220630105851.59e12f77@xps-13> (raw)
In-Reply-To: <2df6673b-6f8d-19c2-90ca-342e3ba72040@linaro.org>

Hi Krzysztof,

krzysztof.kozlowski@linaro.org wrote on Thu, 30 Jun 2022 10:46:51 +0200:

> On 30/06/2022 09:25, Miquel Raynal wrote:
> > Hi Krzysztof,
> > 
> > geert+renesas@glider.be wrote on Mon, 27 Jun 2022 17:31:13 +0200:
> >   
> >> Most rpcif_*() API functions do not need access to any other fields in
> >> the rpcif structure than the device pointer.  Simplify dependencies by
> >> passing the device pointer instead.
> >>
> >> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >> ---
> >>  drivers/memory/renesas-rpc-if.c | 32 ++++++++++++++++----------------
> >>  drivers/mtd/hyperbus/rpc-if.c   | 18 +++++++++---------  
> > 
> > [...]
> >   
> >> diff --git a/drivers/mtd/hyperbus/rpc-if.c b/drivers/mtd/hyperbus/rpc-if.c
> >> index d00d302434030b20..41734e337ac00e40 100644
> >> --- a/drivers/mtd/hyperbus/rpc-if.c
> >> +++ b/drivers/mtd/hyperbus/rpc-if.c
> >> @@ -56,7 +56,7 @@ static void rpcif_hb_prepare_read(struct rpcif *rpc, void *to,
> >>  	op.data.nbytes = len;
> >>  	op.data.buf.in = to;
> >>  
> >> -	rpcif_prepare(rpc, &op, NULL, NULL);
> >> +	rpcif_prepare(rpc->dev, &op, NULL, NULL);
> >>  }
> >>  
> >>  static void rpcif_hb_prepare_write(struct rpcif *rpc, unsigned long to,
> >> @@ -70,7 +70,7 @@ static void rpcif_hb_prepare_write(struct rpcif *rpc, unsigned long to,
> >>  	op.data.nbytes = len;
> >>  	op.data.buf.out = from;
> >>  
> >> -	rpcif_prepare(rpc, &op, NULL, NULL);
> >> +	rpcif_prepare(rpc->dev, &op, NULL, NULL);
> >>  }
> >>  
> >>  static u16 rpcif_hb_read16(struct hyperbus_device *hbdev, unsigned long addr)
> >> @@ -81,7 +81,7 @@ static u16 rpcif_hb_read16(struct hyperbus_device *hbdev, unsigned long addr)
> >>  
> >>  	rpcif_hb_prepare_read(&hyperbus->rpc, &data, addr, 2);
> >>  
> >> -	rpcif_manual_xfer(&hyperbus->rpc);
> >> +	rpcif_manual_xfer(hyperbus->rpc.dev);
> >>  
> >>  	return data.x[0];
> >>  }
> >> @@ -94,7 +94,7 @@ static void rpcif_hb_write16(struct hyperbus_device *hbdev, unsigned long addr,
> >>  
> >>  	rpcif_hb_prepare_write(&hyperbus->rpc, addr, &data, 2);
> >>  
> >> -	rpcif_manual_xfer(&hyperbus->rpc);
> >> +	rpcif_manual_xfer(hyperbus->rpc.dev);
> >>  }
> >>  
> >>  static void rpcif_hb_copy_from(struct hyperbus_device *hbdev, void *to,
> >> @@ -105,7 +105,7 @@ static void rpcif_hb_copy_from(struct hyperbus_device *hbdev, void *to,
> >>  
> >>  	rpcif_hb_prepare_read(&hyperbus->rpc, to, from, len);
> >>  
> >> -	rpcif_dirmap_read(&hyperbus->rpc, from, len, to);
> >> +	rpcif_dirmap_read(hyperbus->rpc.dev, from, len, to);
> >>  }
> >>  
> >>  static const struct hyperbus_ops rpcif_hb_ops = {
> >> @@ -130,9 +130,9 @@ static int rpcif_hb_probe(struct platform_device *pdev)
> >>  
> >>  	platform_set_drvdata(pdev, hyperbus);
> >>  
> >> -	rpcif_enable_rpm(&hyperbus->rpc);
> >> +	rpcif_enable_rpm(hyperbus->rpc.dev);
> >>  
> >> -	error = rpcif_hw_init(&hyperbus->rpc, true);
> >> +	error = rpcif_hw_init(hyperbus->rpc.dev, true);
> >>  	if (error)
> >>  		goto out_disable_rpm;
> >>  
> >> @@ -150,7 +150,7 @@ static int rpcif_hb_probe(struct platform_device *pdev)
> >>  	return 0;
> >>  
> >>  out_disable_rpm:
> >> -	rpcif_disable_rpm(&hyperbus->rpc);
> >> +	rpcif_disable_rpm(hyperbus->rpc.dev);
> >>  	return error;
> >>  }  
> > 
> > This will only apply on top of mtd/next, because that
> > rpcif_disable_rpm() balance call was very recently contributed by Geert:
> > https://lore.kernel.org/linux-mtd/f3070e1af480cb252ae183d479a593dbbf947685.1655457790.git.geert+renesas@glider.be/
> > 
> > So we need to first share an immutable tag on the current mtd/next
> > branch. Richard, that is my vacation gift for you :)  
> 
> I don't want entire mtd/next. I could take Renesas hyperbus specific
> commits.

I applied this patch a week ago and did not remembered there was a
possibly conflicting series aside.

> Another solution is me to rebase on some rcX, if that commit
> was sent as fix for current cycle.

Unfortunately, no.

> The third option is to simply resolve a conflict - which should looks
> pretty easy and compile-testable. In that case the commit should be
> rebased on my v5.19-rc1.

I believe it should work. As this is mostly a cleanup, you can also
wait 5.20-rc1.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Sergey Shtylyov <s.shtylyov@omp.ru>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Richard Weinberger <richard@nod.at>,
	Mark Brown <broonie@kernel.org>,
	linux-mtd@lists.infradead.org, linux-renesas-soc@vger.kernel.org,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/7] memory: renesas-rpc-if: Pass device instead of rpcif to rpcif_*()
Date: Thu, 30 Jun 2022 10:58:51 +0200	[thread overview]
Message-ID: <20220630105851.59e12f77@xps-13> (raw)
In-Reply-To: <2df6673b-6f8d-19c2-90ca-342e3ba72040@linaro.org>

Hi Krzysztof,

krzysztof.kozlowski@linaro.org wrote on Thu, 30 Jun 2022 10:46:51 +0200:

> On 30/06/2022 09:25, Miquel Raynal wrote:
> > Hi Krzysztof,
> > 
> > geert+renesas@glider.be wrote on Mon, 27 Jun 2022 17:31:13 +0200:
> >   
> >> Most rpcif_*() API functions do not need access to any other fields in
> >> the rpcif structure than the device pointer.  Simplify dependencies by
> >> passing the device pointer instead.
> >>
> >> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >> ---
> >>  drivers/memory/renesas-rpc-if.c | 32 ++++++++++++++++----------------
> >>  drivers/mtd/hyperbus/rpc-if.c   | 18 +++++++++---------  
> > 
> > [...]
> >   
> >> diff --git a/drivers/mtd/hyperbus/rpc-if.c b/drivers/mtd/hyperbus/rpc-if.c
> >> index d00d302434030b20..41734e337ac00e40 100644
> >> --- a/drivers/mtd/hyperbus/rpc-if.c
> >> +++ b/drivers/mtd/hyperbus/rpc-if.c
> >> @@ -56,7 +56,7 @@ static void rpcif_hb_prepare_read(struct rpcif *rpc, void *to,
> >>  	op.data.nbytes = len;
> >>  	op.data.buf.in = to;
> >>  
> >> -	rpcif_prepare(rpc, &op, NULL, NULL);
> >> +	rpcif_prepare(rpc->dev, &op, NULL, NULL);
> >>  }
> >>  
> >>  static void rpcif_hb_prepare_write(struct rpcif *rpc, unsigned long to,
> >> @@ -70,7 +70,7 @@ static void rpcif_hb_prepare_write(struct rpcif *rpc, unsigned long to,
> >>  	op.data.nbytes = len;
> >>  	op.data.buf.out = from;
> >>  
> >> -	rpcif_prepare(rpc, &op, NULL, NULL);
> >> +	rpcif_prepare(rpc->dev, &op, NULL, NULL);
> >>  }
> >>  
> >>  static u16 rpcif_hb_read16(struct hyperbus_device *hbdev, unsigned long addr)
> >> @@ -81,7 +81,7 @@ static u16 rpcif_hb_read16(struct hyperbus_device *hbdev, unsigned long addr)
> >>  
> >>  	rpcif_hb_prepare_read(&hyperbus->rpc, &data, addr, 2);
> >>  
> >> -	rpcif_manual_xfer(&hyperbus->rpc);
> >> +	rpcif_manual_xfer(hyperbus->rpc.dev);
> >>  
> >>  	return data.x[0];
> >>  }
> >> @@ -94,7 +94,7 @@ static void rpcif_hb_write16(struct hyperbus_device *hbdev, unsigned long addr,
> >>  
> >>  	rpcif_hb_prepare_write(&hyperbus->rpc, addr, &data, 2);
> >>  
> >> -	rpcif_manual_xfer(&hyperbus->rpc);
> >> +	rpcif_manual_xfer(hyperbus->rpc.dev);
> >>  }
> >>  
> >>  static void rpcif_hb_copy_from(struct hyperbus_device *hbdev, void *to,
> >> @@ -105,7 +105,7 @@ static void rpcif_hb_copy_from(struct hyperbus_device *hbdev, void *to,
> >>  
> >>  	rpcif_hb_prepare_read(&hyperbus->rpc, to, from, len);
> >>  
> >> -	rpcif_dirmap_read(&hyperbus->rpc, from, len, to);
> >> +	rpcif_dirmap_read(hyperbus->rpc.dev, from, len, to);
> >>  }
> >>  
> >>  static const struct hyperbus_ops rpcif_hb_ops = {
> >> @@ -130,9 +130,9 @@ static int rpcif_hb_probe(struct platform_device *pdev)
> >>  
> >>  	platform_set_drvdata(pdev, hyperbus);
> >>  
> >> -	rpcif_enable_rpm(&hyperbus->rpc);
> >> +	rpcif_enable_rpm(hyperbus->rpc.dev);
> >>  
> >> -	error = rpcif_hw_init(&hyperbus->rpc, true);
> >> +	error = rpcif_hw_init(hyperbus->rpc.dev, true);
> >>  	if (error)
> >>  		goto out_disable_rpm;
> >>  
> >> @@ -150,7 +150,7 @@ static int rpcif_hb_probe(struct platform_device *pdev)
> >>  	return 0;
> >>  
> >>  out_disable_rpm:
> >> -	rpcif_disable_rpm(&hyperbus->rpc);
> >> +	rpcif_disable_rpm(hyperbus->rpc.dev);
> >>  	return error;
> >>  }  
> > 
> > This will only apply on top of mtd/next, because that
> > rpcif_disable_rpm() balance call was very recently contributed by Geert:
> > https://lore.kernel.org/linux-mtd/f3070e1af480cb252ae183d479a593dbbf947685.1655457790.git.geert+renesas@glider.be/
> > 
> > So we need to first share an immutable tag on the current mtd/next
> > branch. Richard, that is my vacation gift for you :)  
> 
> I don't want entire mtd/next. I could take Renesas hyperbus specific
> commits.

I applied this patch a week ago and did not remembered there was a
possibly conflicting series aside.

> Another solution is me to rebase on some rcX, if that commit
> was sent as fix for current cycle.

Unfortunately, no.

> The third option is to simply resolve a conflict - which should looks
> pretty easy and compile-testable. In that case the commit should be
> rebased on my v5.19-rc1.

I believe it should work. As this is mostly a cleanup, you can also
wait 5.20-rc1.

Thanks,
Miquèl

  reply	other threads:[~2022-06-30  8:59 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 15:31 [PATCH 0/7] memory: renesas-rpc-if: Rebind and s2ram fixes Geert Uytterhoeven
2022-06-27 15:31 ` Geert Uytterhoeven
2022-06-27 15:31 ` [PATCH 1/7] memory: renesas-rpc-if: Always use dev in rpcif_sw_init() Geert Uytterhoeven
2022-06-27 15:31   ` Geert Uytterhoeven
2022-06-27 15:31 ` [PATCH 2/7] memory: renesas-rpc-if: Add dev helper to rpcif_probe() Geert Uytterhoeven
2022-06-27 15:31   ` Geert Uytterhoeven
2022-06-27 15:31 ` [PATCH 3/7] memory: renesas-rpc-if: Improve Runtime PM handling Geert Uytterhoeven
2022-06-27 15:31   ` Geert Uytterhoeven
2022-06-27 15:31 ` [PATCH 4/7] memory: renesas-rpc-if: Split-off private data from struct rpcif Geert Uytterhoeven
2022-06-27 15:31   ` Geert Uytterhoeven
2022-06-27 15:31 ` [PATCH 5/7] memory: renesas-rpc-if: Move resource acquisition to .probe() Geert Uytterhoeven
2022-06-27 15:31   ` Geert Uytterhoeven
2022-06-29 17:44   ` Krzysztof Kozlowski
2022-06-29 17:44     ` Krzysztof Kozlowski
2022-06-29 17:55     ` Geert Uytterhoeven
2022-06-29 17:55       ` Geert Uytterhoeven
2022-06-29 18:25       ` Krzysztof Kozlowski
2022-06-29 18:25         ` Krzysztof Kozlowski
2022-06-29 18:48         ` Geert Uytterhoeven
2022-06-29 18:48           ` Geert Uytterhoeven
2022-06-30  8:48           ` Krzysztof Kozlowski
2022-06-30  8:48             ` Krzysztof Kozlowski
2022-06-30  9:15             ` Geert Uytterhoeven
2022-06-30  9:15               ` Geert Uytterhoeven
2022-06-27 15:31 ` [PATCH 6/7] memory: renesas-rpc-if: Pass device instead of rpcif to rpcif_*() Geert Uytterhoeven
2022-06-27 15:31   ` Geert Uytterhoeven
2022-06-29 18:26   ` Krzysztof Kozlowski
2022-06-29 18:26     ` Krzysztof Kozlowski
2022-06-30  7:25   ` Miquel Raynal
2022-06-30  7:25     ` Miquel Raynal
2022-06-30  8:46     ` Krzysztof Kozlowski
2022-06-30  8:46       ` Krzysztof Kozlowski
2022-06-30  8:58       ` Miquel Raynal [this message]
2022-06-30  8:58         ` Miquel Raynal
2022-06-27 15:31 ` [PATCH 7/7] memory: renesas-rpc-if: Reinitialize registers during system resume Geert Uytterhoeven
2022-06-27 15:31   ` Geert Uytterhoeven
2022-11-23 14:49   ` Geert Uytterhoeven
2022-11-23 14:49     ` Geert Uytterhoeven

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=20220630105851.59e12f77@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=broonie@kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=richard@nod.at \
    --cc=s.shtylyov@omp.ru \
    --cc=vigneshr@ti.com \
    --cc=wsa+renesas@sang-engineering.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.