public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] dfu: Fix handling of UBI partitions in MTD backend
@ 2020-09-02 11:06 Guillermo Rodriguez
  2020-09-04  8:31 ` Patrick DELAUNAY
  0 siblings, 1 reply; 4+ messages in thread
From: Guillermo Rodriguez @ 2020-09-02 11:06 UTC (permalink / raw)
  To: u-boot

For UBI partitions ("partubi" in dfu_alt_info), dfu_fill_entity_mtd sets
the mtd.ubi flag; however other functions incorrectly check for nand.ubi
instead. Fix this by checking for the correct flag.

Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
Cc: Lukasz Majewski <lukma@denx.de>
---
 drivers/dfu/dfu_mtd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd.c
index 36cd4e945b..2811ae8463 100644
--- a/drivers/dfu/dfu_mtd.c
+++ b/drivers/dfu/dfu_mtd.c
@@ -190,7 +190,7 @@ static int dfu_flush_medium_mtd(struct dfu_entity *dfu)
 	int ret;
 
 	/* in case of ubi partition, erase rest of the partition */
-	if (dfu->data.nand.ubi) {
+	if (dfu->data.mtd.ubi) {
 		struct erase_info erase_op = {};
 
 		erase_op.mtd = dfu->data.mtd.info;
@@ -228,7 +228,7 @@ static unsigned int dfu_polltimeout_mtd(struct dfu_entity *dfu)
 	 * ubi partition, as sectors which are not used need
 	 * to be erased
 	 */
-	if (dfu->data.nand.ubi)
+	if (dfu->data.mtd.ubi)
 		return DFU_MANIFEST_POLL_TIMEOUT;
 
 	return DFU_DEFAULT_POLL_TIMEOUT;
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] dfu: Fix handling of UBI partitions in MTD backend
  2020-09-02 11:06 [PATCH] dfu: Fix handling of UBI partitions in MTD backend Guillermo Rodriguez
@ 2020-09-04  8:31 ` Patrick DELAUNAY
  2020-10-23 15:48   ` Patrick DELAUNAY
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick DELAUNAY @ 2020-09-04  8:31 UTC (permalink / raw)
  To: u-boot

Hi,

> From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Guillermo Rodriguez
> Sent: mercredi 2 septembre 2020 13:06
> To: u-boot at lists.denx.de
> Cc: Guillermo Rodriguez <guille.rodriguez@gmail.com>; Lukasz Majewski
> <lukma@denx.de>
> Subject: [PATCH] dfu: Fix handling of UBI partitions in MTD backend
> 
> For UBI partitions ("partubi" in dfu_alt_info), dfu_fill_entity_mtd sets the mtd.ubi
> flag; however other functions incorrectly check for nand.ubi instead. Fix this by
> checking for the correct flag.
> 
> Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
> Cc: Lukasz Majewski <lukma@denx.de>
> ---

Fixes: 6015af28ee6d ("dfu: add backend for MTD device")
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>

Thanks for the correction.

Patrick

>  drivers/dfu/dfu_mtd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd.c index
> 36cd4e945b..2811ae8463 100644
> --- a/drivers/dfu/dfu_mtd.c
> +++ b/drivers/dfu/dfu_mtd.c
> @@ -190,7 +190,7 @@ static int dfu_flush_medium_mtd(struct dfu_entity *dfu)
>  	int ret;
> 
>  	/* in case of ubi partition, erase rest of the partition */
> -	if (dfu->data.nand.ubi) {
> +	if (dfu->data.mtd.ubi) {
>  		struct erase_info erase_op = {};
> 
>  		erase_op.mtd = dfu->data.mtd.info;
> @@ -228,7 +228,7 @@ static unsigned int dfu_polltimeout_mtd(struct dfu_entity
> *dfu)
>  	 * ubi partition, as sectors which are not used need
>  	 * to be erased
>  	 */
> -	if (dfu->data.nand.ubi)
> +	if (dfu->data.mtd.ubi)
>  		return DFU_MANIFEST_POLL_TIMEOUT;
> 
>  	return DFU_DEFAULT_POLL_TIMEOUT;
> --
> 2.21.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] dfu: Fix handling of UBI partitions in MTD backend
  2020-09-04  8:31 ` Patrick DELAUNAY
@ 2020-10-23 15:48   ` Patrick DELAUNAY
  2020-10-26 15:33     ` Lukasz Majewski
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick DELAUNAY @ 2020-10-23 15:48 UTC (permalink / raw)
  To: u-boot

Hi Lukasz,

> From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Patrick DELAUNAY
> Sent: vendredi 4 septembre 2020 10:31
> 
> Hi,
> 
> > From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Guillermo
> > Rodriguez
> > Sent: mercredi 2 septembre 2020 13:06
> > To: u-boot at lists.denx.de
> > Cc: Guillermo Rodriguez <guille.rodriguez@gmail.com>; Lukasz Majewski
> > <lukma@denx.de>
> > Subject: [PATCH] dfu: Fix handling of UBI partitions in MTD backend
> >
> > For UBI partitions ("partubi" in dfu_alt_info), dfu_fill_entity_mtd
> > sets the mtd.ubi flag; however other functions incorrectly check for
> > nand.ubi instead. Fix this by checking for the correct flag.
> >
> > Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
> > Cc: Lukasz Majewski <lukma@denx.de>
> > ---
> 
> Fixes: 6015af28ee6d ("dfu: add backend for MTD device")
> Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
> 
> Thanks for the correction.
> 
> Patrick
> 
> >  drivers/dfu/dfu_mtd.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >

This correction will be integrated in the next u-boot-dfu v2021.01 pull request ?
Or I can include it in stm32 custodians master branch ?

Patrick

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] dfu: Fix handling of UBI partitions in MTD backend
  2020-10-23 15:48   ` Patrick DELAUNAY
@ 2020-10-26 15:33     ` Lukasz Majewski
  0 siblings, 0 replies; 4+ messages in thread
From: Lukasz Majewski @ 2020-10-26 15:33 UTC (permalink / raw)
  To: u-boot

On Fri, 23 Oct 2020 15:48:24 +0000
Patrick DELAUNAY <patrick.delaunay@st.com> wrote:

> Hi Lukasz,
> 
> > From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Patrick
> > DELAUNAY Sent: vendredi 4 septembre 2020 10:31
> > 
> > Hi,
> >   
> > > From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Guillermo
> > > Rodriguez
> > > Sent: mercredi 2 septembre 2020 13:06
> > > To: u-boot at lists.denx.de
> > > Cc: Guillermo Rodriguez <guille.rodriguez@gmail.com>; Lukasz
> > > Majewski <lukma@denx.de>
> > > Subject: [PATCH] dfu: Fix handling of UBI partitions in MTD
> > > backend
> > >
> > > For UBI partitions ("partubi" in dfu_alt_info),
> > > dfu_fill_entity_mtd sets the mtd.ubi flag; however other
> > > functions incorrectly check for nand.ubi instead. Fix this by
> > > checking for the correct flag.
> > >
> > > Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
> > > Cc: Lukasz Majewski <lukma@denx.de>
> > > ---  
> > 
> > Fixes: 6015af28ee6d ("dfu: add backend for MTD device")
> > Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
> > 
> > Thanks for the correction.
> > 
> > Patrick
> >   
> > >  drivers/dfu/dfu_mtd.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >  
> 
> This correction will be integrated in the next u-boot-dfu v2021.01
> pull request ? Or I can include it in stm32 custodians master branch ?
> 

Please pull it via stm32.

> Patrick
> 




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201026/e30e3d00/attachment.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-26 15:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-02 11:06 [PATCH] dfu: Fix handling of UBI partitions in MTD backend Guillermo Rodriguez
2020-09-04  8:31 ` Patrick DELAUNAY
2020-10-23 15:48   ` Patrick DELAUNAY
2020-10-26 15:33     ` Lukasz Majewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox