Skip to contentSkip to conversation

commands: ubi: ubiupdatevol: Reduce error code to 0 or 1

PATCH Applied Daniel Schultz 2 participants 9 messages Jan 29, 2018 – Feb 23, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 commands: ubi: ubiupdatevol: Reduce error code to 0 or 1

do_ubiupdatevol can either return 0 or the ioctl return value. This is not in conformity with the other ubi comannds return values.

---
 commands/ubi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
commands/ubi.c +1 -1
index 5e27584..de5633c 100644
@@ -82,7 +82,7 @@ error:
 	close(fd_vol);
 error_img:
 	close(fd_img);
-	return ret;
+	return ret ? 1 : 0;
 }
 
 
Signature · 7 lines
2.7.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 3/3 drivers: mtd: nand: omap: Return stat value

The read page function should return the total count of flipped bits, otherwise the caller always thinks no bitflip occured.

---
 drivers/mtd/nand/nand_omap_gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/nand_omap_gpmc.c +1 -1
index e18ce63..38f4960 100644
@@ -712,7 +712,7 @@ static int omap_gpmc_read_page_bch_rom_mode(struct mtd_info *mtd,
 	else
 		mtd->ecc_stats.corrected += stat;
 
-	return 0;
+	return stat;
 }
 
 static int omap_gpmc_eccmode(struct gpmc_nand_info *oinfo,
Signature · 7 lines
2.7.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 2/3 ARM: configs: am335x_defconfig: Reorder configs

In reply to Daniel Schultz

These configs were added directly in the config file and not with menuconfig. Reorder these like menuconfig would place them.

---
 arch/arm/configs/am335x_defconfig | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/configs/am335x_defconfig +3 -3
index 5a236fb..09dde90 100644
@@ -29,12 +29,14 @@ CONFIG_BOOTM_OFTREE=y
 CONFIG_BLSPEC=y
 CONFIG_CONSOLE_ACTIVATE_NONE=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
+CONFIG_STATE=y
 CONFIG_RESET_SOURCE=y
 CONFIG_DEBUG_INFO=y
 CONFIG_LONGHELP=y
 CONFIG_CMD_IOMEM=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_ARM_MMUINFO=y
+CONFIG_CMD_MMC_EXTCSD=y
 # CONFIG_CMD_BOOTU is not set
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GO=y
@@ -87,7 +89,6 @@ CONFIG_CMD_OF_DISPLAY_TIMINGS=y
 CONFIG_CMD_OF_FIXUP_STATUS=y
 CONFIG_CMD_OFTREE=y
 CONFIG_CMD_TIME=y
-CONFIG_CMD_MMC_EXTCSD=y
 CONFIG_CMD_STATE=y
 CONFIG_NET=y
 CONFIG_NET_NFS=y
@@ -124,6 +125,7 @@ CONFIG_USB_MUSB_GADGET=y
 CONFIG_MCI=y
 CONFIG_MCI_STARTUP=y
 CONFIG_MCI_OMAP_HSMMC=y
+CONFIG_STATE_DRV=y
 CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_LED_GPIO_OF=y
@@ -143,5 +145,3 @@ CONFIG_FS_FAT_LFN=y
 CONFIG_FS_UBIFS=y
 CONFIG_FS_UBIFS_COMPRESSION_LZO=y
 CONFIG_FS_UBIFS_COMPRESSION_ZLIB=y
-CONFIG_STATE=y
-CONFIG_STATE_DRV=y
Signature · 7 lines
2.7.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#7 lore raw
In reply to Daniel Schultz
Quoted 7 lines · Daniel Schultz

do_ubiupdatevol can either return 0 or the ioctl return value. This is not in conformity with the other ubi comannds return values.

---
 commands/ubi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

Sascha

Quoted 23 lines
commands/ubi.c +1 -1
index 5e27584..de5633c 100644
@@ -82,7 +82,7 @@ error:
 	close(fd_vol);
 error_img:
 	close(fd_img);
-	return ret;
+	return ret ? 1 : 0;
 }
 
 
Signature · 7 lines
2.7.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

Re: [PATCH 3/3] drivers: mtd: nand: omap: Return stat value

In reply to Daniel Schultz
Quoted 13 lines · Daniel Schultz

The read page function should return the total count of flipped bits, otherwise the caller always thinks no bitflip occured.

---
 drivers/mtd/nand/nand_omap_gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/nand_omap_gpmc.c +0 -0
index e18ce63..38f4960 100644

drivers/mtd/nand/nand_omap_gpmc.c static int omap_gpmc_read_page_bch_rom_mode(struct mtd_info *mtd, · line 716

Quoted 6 lines
drivers/mtd/nand/nand_omap_gpmc.c +1 -1
@@ -712,7 +712,7 @@ static int omap_gpmc_read_page_bch_rom_mode(struct mtd_info *mtd,
 	else
 		mtd->ecc_stats.corrected += stat;
 
-	return 0;
+	return stat;
 }

I'm afraid this is not enough. read_page should return the maximum number of bitflips in any ECC step. You first have to change omap_correct_bch() so that it returns this number.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw
In reply to Sascha Hauer
Quoted 10 lines · Sascha Hauer
Quoted 7 lines · Daniel Schultz

do_ubiupdatevol can either return 0 or the ioctl return value. This is not in conformity with the other ubi comannds return values.

---
 commands/ubi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

I meant I Applied 1 & 2.

Sascha

Quoted 38 lines

Sascha

Quoted 23 lines
commands/ubi.c +1 -1
index 5e27584..de5633c 100644
@@ -82,7 +82,7 @@ error:
 	close(fd_vol);
 error_img:
 	close(fd_img);
-	return ret;
+	return ret ? 1 : 0;
 }
 
 
Signature · 7 lines
2.7.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

Re: [PATCH 3/3] drivers: mtd: nand: omap: Return stat value

In reply to Sascha Hauer

Hi Sascha,

Quoted 17 lines · Sascha Hauer
Quoted 16 lines · Daniel Schultz

The read page function should return the total count of flipped bits, otherwise the caller always thinks no bitflip occured.

---
  drivers/mtd/nand/nand_omap_gpmc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/nand_omap_gpmc.c +0 -0
index e18ce63..38f4960 100644
@@ -712,7 +712,7 @@ static int omap_gpmc_read_page_bch_rom_mode(struct mtd_info *mtd,
  	else
  		mtd->ecc_stats.corrected += stat;
 
Quoted 6 lines

drivers/mtd/nand/nand_omap_gpmc.c static int omap_gpmc_read_page_bch_rom_mode(struct mtd_info *mtd, · line 716

Quoted 3 lines
drivers/mtd/nand/nand_omap_gpmc.c +1 -1
-	return 0;
+	return stat;
  }

I'm afraid this is not enough. read_page should return the maximum number of bitflips in any ECC step. You first have to change omap_correct_bch() so that it returns this number.

ahh, we worked on this problem a half year ago and it seems like three patches are missing upstream:

http://lists.infradead.org/pipermail/barebox/2017-June/030385.html
http://lists.infradead.org/pipermail/barebox/2017-June/030384.html
http://lists.infradead.org/pipermail/barebox/2017-June/030355.html

Daniel

Quoted 3 lines

Sascha

Signature · 26 lines
Mit freundlichen Grüßen,
With best regards,
  Daniel Schultz

- Entwicklung -
Tel.: 	+49 6131 92 21 457
[email protected]
www.phytec.de

Sie finden uns auch auf: Facebook, LinkedIn, Xing, YouTube

PHYTEC Messtechnik GmbH | Robert-Koch-Str. 39 | 55129 Mainz, Germany
Geschäftsführer: Dipl.-Ing. Michael Mitezki, Dipl.-Ing. Bodo Huber |
Handelsregister Mainz HRB 4656 | Finanzamt Mainz-Mitte | St.Nr. 266500608,
DE 149059855
This E-Mail may contain confidential or privileged information. If you are
not the intended recipient (or have received this E-Mail in error) please
notify the sender immediately and destroy this E-Mail. Any unauthorized
copying, disclosure or distribution of the material in this E-Mail is
strictly forbidden.


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

Re: [PATCH 3/3] drivers: mtd: nand: omap: Return stat value

Quoted 26 lines · Daniel Schultz

Hi Sascha,

Quoted 9 lines · Sascha Hauer
Quoted 8 lines · Daniel Schultz

The read page function should return the total count of flipped bits, otherwise the caller always thinks no bitflip occured.

---
  drivers/mtd/nand/nand_omap_gpmc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

drivers/mtd/nand/nand_omap_gpmc.c static int omap_gpmc_read_page_bch_rom_mode(struct mtd_info *mtd, · line 715

Quoted 10 lines
drivers/mtd/nand/nand_omap_gpmc.c +1 -1
index e18ce63..38f4960 100644
@@ -712,7 +712,7 @@ static int omap_gpmc_read_page_bch_rom_mode(struct mtd_info *mtd,
  	else
  		mtd->ecc_stats.corrected += stat;
-	return 0;
+	return stat;
  }

I'm afraid this is not enough. read_page should return the maximum number of bitflips in any ECC step. You first have to change omap_correct_bch() so that it returns this number.

Quoted 6 lines

ahh, we worked on this problem a half year ago and it seems like three patches are missing upstream:

http://lists.infradead.org/pipermail/barebox/2017-June/030385.html
http://lists.infradead.org/pipermail/barebox/2017-June/030384.html
http://lists.infradead.org/pipermail/barebox/2017-June/030355.html

Oh, I see. It seems I have either forgotten to merge them or I have waited for feedback. Could you create a series for all missing patches including your new patch and resend it, provided it works as expected of course?

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw

Re: [PATCH 3/3] drivers: mtd: nand: omap: Return stat value

Quoted 30 lines · Sascha Hauer
Quoted 29 lines · Daniel Schultz

Hi Sascha,

Quoted 9 lines · Sascha Hauer
Quoted 8 lines · Daniel Schultz

The read page function should return the total count of flipped bits, otherwise the caller always thinks no bitflip occured.

---
   drivers/mtd/nand/nand_omap_gpmc.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

drivers/mtd/nand/nand_omap_gpmc.c static int omap_gpmc_read_page_bch_rom_mode(struct mtd_info *mtd, · line 715

Quoted 10 lines
drivers/mtd/nand/nand_omap_gpmc.c +1 -1
index e18ce63..38f4960 100644
@@ -712,7 +712,7 @@ static int omap_gpmc_read_page_bch_rom_mode(struct mtd_info *mtd,
   	else
   		mtd->ecc_stats.corrected += stat;
-	return 0;
+	return stat;
   }

I'm afraid this is not enough. read_page should return the maximum number of bitflips in any ECC step. You first have to change omap_correct_bch() so that it returns this number.

ahh, we worked on this problem a half year ago and it seems like three patches are missing upstream:

Quoted 7 lines
Quoted 3 lines

http://lists.infradead.org/pipermail/barebox/2017-June/030385.html
http://lists.infradead.org/pipermail/barebox/2017-June/030384.html
http://lists.infradead.org/pipermail/barebox/2017-June/030355.html

Oh, I see. It seems I have either forgotten to merge them or I have waited for feedback. Could you create a series for all missing patches including your new patch and resend it, provided it works as expected of course?

Yes, I will do this as soon as I have time for it.

Signature · 10 lines
Mit freundlichen Grüßen,
With best regards,
  Daniel Schultz



_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox