From fd074a7a7961af9db076f2b82ccb9d9ba2a63f43 Mon Sep 17 00:00:00 2001 From: 张忠山 Date: Tue, 9 Apr 2019 17:56:53 +0800 Subject: ddr_spd: Fix mod_ranks test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ((x & 0x10) == 1) can never be true. Test for the bit at 0x10 instead. Signed-off-by: 张忠山 Signed-off-by: Sascha Hauer --- common/ddr_spd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/ddr_spd.c b/common/ddr_spd.c index 0ba5eaceae..23df3e7119 100644 --- a/common/ddr_spd.c +++ b/common/ddr_spd.c @@ -325,7 +325,7 @@ void ddr_spd_print(uint8_t *record) printf("Error module type\n"); printf("%-48s ", "DRAM Package "); - if ((s->mod_ranks & 0x10) == 1) + if ((s->mod_ranks & 0x10) != 0) printf("Stack\n"); else printf("Planar\n"); -- cgit v1.2.3 From 1e8ff7b5025120aedd915dbbdf6b534a446b3827 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Wed, 10 Apr 2019 10:37:37 +0100 Subject: ARM: socfpga: Cyclone5: remove watchdog_disable() watchdog_disable() is left over from the original SoCFPGA commit and nothing calls it. Remove it to avoid a '-Wmissing-prototypes' warning from the compiler. Signed-off-by: Ian Abbott Signed-off-by: Sascha Hauer --- arch/arm/mach-socfpga/cyclone5-reset-manager.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/arch/arm/mach-socfpga/cyclone5-reset-manager.c b/arch/arm/mach-socfpga/cyclone5-reset-manager.c index 4bbe1a8101..8635806846 100644 --- a/arch/arm/mach-socfpga/cyclone5-reset-manager.c +++ b/arch/arm/mach-socfpga/cyclone5-reset-manager.c @@ -22,23 +22,6 @@ #include #include -/* Disable the watchdog (toggle reset to watchdog) */ -void watchdog_disable(void) -{ - void __iomem *rm = (void *)CYCLONE5_RSTMGR_ADDRESS; - uint32_t val; - - /* assert reset for watchdog */ - val = readl(rm + RESET_MGR_PER_MOD_RESET_OFS); - val |= 1 << RSTMGR_PERMODRST_L4WD0_LSB; - writel(val, rm + RESET_MGR_PER_MOD_RESET_OFS); - - /* deassert watchdog from reset (watchdog in not running state) */ - val = readl(rm + RESET_MGR_PER_MOD_RESET_OFS); - val &= ~(1 << RSTMGR_PERMODRST_L4WD0_LSB); - writel(val, rm + RESET_MGR_PER_MOD_RESET_OFS); -} - /* Write the reset manager register to cause reset */ static void __noreturn socfpga_restart_soc(struct restart_handler *rst) { -- cgit v1.2.3 From 6fcf89d932676951dac05c9c92fcdd54b0ab84a9 Mon Sep 17 00:00:00 2001 From: Tomaz Solc Date: Tue, 16 Apr 2019 11:47:48 +0200 Subject: doc: variables: nv vars are saved automatically. In recent barebox versions, nv variables are saved automatically upon reset or kernel start (console message "nv variable modified, will save nv variables on shutdown" warns about that). There is no need to explicitly call saveenv. This change was introduced in 3fadbdae. Signed-off-by: Sascha Hauer --- Documentation/user/variables.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Documentation/user/variables.rst b/Documentation/user/variables.rst index ddfd485740..cb1296c06d 100644 --- a/Documentation/user/variables.rst +++ b/Documentation/user/variables.rst @@ -46,9 +46,11 @@ currently running barebox, while changing a nv variable changes the behaviour persistently over reboots. nv variables can be created or removed with the :ref:`command_nv` -command. The nv variables are made persistent using the environment -facilities of barebox, so a :ref:`command_saveenv` must be issued to store the -actual values. +command. + +The nv variables are made persistent using the environment facilities of +barebox. They are saved automatically to the storage medium whenever barebox +shuts down (that is, a :ref:`command_reset` is issued or a kernel is started). examples: -- cgit v1.2.3 From 17ab16933959bf8722c6cb353f31fc06926e2ad4 Mon Sep 17 00:00:00 2001 From: Moritz Augsburger Date: Tue, 23 Apr 2019 21:56:08 +0200 Subject: doc: clarify state framework driver requirement --- Documentation/user/state.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/user/state.rst b/Documentation/user/state.rst index 07743df0cb..78ce24f9ed 100644 --- a/Documentation/user/state.rst +++ b/Documentation/user/state.rst @@ -21,7 +21,13 @@ RAUC_. .. _RAUC: https://rauc.readthedocs.io/en/latest/ barebox itself uses a *state* driver to access the variables in the -persistent memory. For the Linux run-time there is a userspace tool_ to do +persistent memory. + +Currently there is only one implementation, enabled by +``CONFIG_STATE_DRV=y``. Without driver, the state framework will silently +fail and be non-functional. + +For the Linux run-time there is a userspace tool_ to do the same. .. _tool: https://git.pengutronix.de/cgit/tools/dt-utils/ -- cgit v1.2.3 From 3a9ea929d89cacd14bbdf73a031d1eaf23abecdc Mon Sep 17 00:00:00 2001 From: Marco Felsch Date: Fri, 26 Apr 2019 14:58:33 +0200 Subject: fs: nfs: ensure rpc_req message is send Currently we send a rpc message without checking if the send was succesful and poll for a answer from the server. If the server didn't answer within the NFS_TIMEOUT window we send the package again. In case the package send wasn't successful we always run in that timeout. This gets even worse if the package send fails more than one time. Check if the package send was successful and resend the package if it wasn't to fix this behaviour. Signed-off-by: Marco Felsch Signed-off-by: Sascha Hauer --- fs/nfs.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fs/nfs.c b/fs/nfs.c index 574fb85fb6..d606ccd1e9 100644 --- a/fs/nfs.c +++ b/fs/nfs.c @@ -436,9 +436,20 @@ static struct packet *rpc_req(struct nfs_priv *npriv, int rpc_prog, npriv->con->udp->uh_dport = hton16(dport); + nfs_timer_start = get_time_ns(); + again: ret = net_udp_send(npriv->con, sizeof(pkt) + datalen * sizeof(uint32_t)); + if (ret) { + if (is_timeout(nfs_timer_start, NFS_TIMEOUT)) { + tries++; + if (tries == NFS_MAX_RESEND) + return ERR_PTR(-ETIMEDOUT); + } + + goto again; + } nfs_timer_start = get_time_ns(); -- cgit v1.2.3 From 41cfc409fd80a2b2f57da89031dfb925329b8487 Mon Sep 17 00:00:00 2001 From: Jan Remmet Date: Tue, 30 Apr 2019 17:14:07 +0200 Subject: UBI: remove Kconfig entry from include CONFIG_MTD_UBI_WL_THRESHOLD can be set via Kconfig. default there is also 4096. So remove the leftover here. Signed-off-by: Jan Remmet Signed-off-by: Sascha Hauer --- drivers/mtd/ubi/ubi-barebox.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/mtd/ubi/ubi-barebox.h b/drivers/mtd/ubi/ubi-barebox.h index 557ad88316..7ee87ffd3e 100644 --- a/drivers/mtd/ubi/ubi-barebox.h +++ b/drivers/mtd/ubi/ubi-barebox.h @@ -30,7 +30,6 @@ #define crc32(seed, data, length) crc32_no_comp(seed, (unsigned char * const)data, length) /* configurable */ -#define CONFIG_MTD_UBI_WL_THRESHOLD 4096 #define UBI_IO_DEBUG 0 /* upd.c */ -- cgit v1.2.3 From b933013b65df63a6607253d1162c770c835c5e59 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 8 May 2019 14:17:22 +0200 Subject: crypto: digest: fix digesting file windows When digesting a file we always try toread PAGE_SIZE bytes. When we get a short read because we reached the file end then the code works correctly. If instead we only want to digest a part of the file then we must make sure to only read up to 'size' bytes. Fixes: b77582effd ("crypto: digest: Split memory vs. file code into separate functions") Signed-off-by: Sascha Hauer --- crypto/digest.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crypto/digest.c b/crypto/digest.c index 2c4de2e4f1..360c261e40 100644 --- a/crypto/digest.c +++ b/crypto/digest.c @@ -233,17 +233,18 @@ static int digest_update_from_fd(struct digest *d, int fd, } while (size) { - const ssize_t now = read(fd, buf, PAGE_SIZE); - if (now < 0) { - ret = now; + unsigned long now = min_t(typeof(size), PAGE_SIZE, size); + + ret = read(fd, buf, now); + if (ret < 0) { perror("read"); goto out_free; } - if (!now) + if (!ret) break; - ret = digest_update_interruptible(d, buf, now); + ret = digest_update_interruptible(d, buf, ret); if (ret) goto out_free; -- cgit v1.2.3 From a306c1c0bd09e7ee074d113b8a86bd815ef64017 Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Thu, 9 May 2019 09:42:00 +0300 Subject: commands/hwclock: align -n option help Help string for hwclock -n option isn't aligned: barebox@barebox sandbox:/ help hwclock hwclock - query or set the hardware clock (RTC) Options: -f NAME RTC device name (default rtc0) -e VARNAME store RTC readout into variable VARNAME -n NTPSERVER set RTC from NTP server -s ccyymmddHHMM[.SS] set time Signed-off-by: Antony Pavlov Signed-off-by: Sascha Hauer --- commands/hwclock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/hwclock.c b/commands/hwclock.c index 5073618675..1b5c2cd100 100644 --- a/commands/hwclock.c +++ b/commands/hwclock.c @@ -175,7 +175,7 @@ BAREBOX_CMD_HELP_START(hwclock) BAREBOX_CMD_HELP_TEXT("Options:") BAREBOX_CMD_HELP_OPT ("-f NAME\t\t\t", "RTC device name (default rtc0)") BAREBOX_CMD_HELP_OPT ("-e VARNAME\t\t", "store RTC readout into variable VARNAME") -BAREBOX_CMD_HELP_OPT ("-n NTPSERVER\t", "set RTC from NTP server") +BAREBOX_CMD_HELP_OPT ("-n NTPSERVER\t\t", "set RTC from NTP server") BAREBOX_CMD_HELP_OPT ("-s ccyymmddHHMM[.SS]\t", "set time") BAREBOX_CMD_HELP_END -- cgit v1.2.3