From 7e932ac790b3615a67a3c24041c194aa748c0d98 Mon Sep 17 00:00:00 2001 From: Richard Genoud Date: Tue, 24 Nov 2020 18:07:52 +0100 Subject: [PATCH 01/11] fs/squashfs: sqfs_close/sqfs_read_sblk: set ctxt.sblk to NULL after free This will prevent a double free error if sqfs_close() is called twice. Signed-off-by: Richard Genoud --- fs/squashfs/sqfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c index 608a2bb454c..5de69ac3ca0 100644 --- a/fs/squashfs/sqfs.c +++ b/fs/squashfs/sqfs.c @@ -49,6 +49,7 @@ static int sqfs_read_sblk(struct squashfs_super_block **sblk) if (sqfs_disk_read(0, 1, *sblk) != 1) { free(*sblk); + sblk = NULL; return -EINVAL; } @@ -1689,9 +1690,10 @@ free_strings: void sqfs_close(void) { - free(ctxt.sblk); - ctxt.cur_dev = NULL; sqfs_decompressor_cleanup(&ctxt); + free(ctxt.sblk); + ctxt.sblk = NULL; + ctxt.cur_dev = NULL; } void sqfs_closedir(struct fs_dir_stream *dirs) From c2ba01c082b4ab21e43bb15e1c3a7e19573d1133 Mon Sep 17 00:00:00 2001 From: Zhao Qiang Date: Wed, 25 Nov 2020 12:55:47 +0800 Subject: [PATCH 02/11] watchdog: sbsa: timeout should be in "millisecond" timeout should be in "millisecond" instead of second, so divided it by 1000 when calculate the load value. Signed-off-by: Zhao Qiang --- drivers/watchdog/sbsa_gwdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/sbsa_gwdt.c b/drivers/watchdog/sbsa_gwdt.c index 2eae431ba6c..96285c1a9b4 100644 --- a/drivers/watchdog/sbsa_gwdt.c +++ b/drivers/watchdog/sbsa_gwdt.c @@ -61,7 +61,7 @@ static int sbsa_gwdt_start(struct udevice *dev, u64 timeout, ulong flags) * to half value of timeout. */ clk = get_tbclk(); - writel(clk / 2 * timeout, + writel(clk / (2 * 1000) * timeout, priv->reg_control + SBSA_GWDT_WOR); /* writing WCS will cause an explicit watchdog refresh */ From 3cbb026f17332b70d352ae3659179ca2b51f418c Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Thu, 19 Nov 2020 21:26:20 +0200 Subject: [PATCH 03/11] linux/compat.h: Remove debug() from spin_lock_irqsave() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems nobody tested the debug() option in spin_lock_irqsave(). Currently, when #define DEBUG, it spoils the compiler with In file included from drivers/usb/dwc3/gadget.c:18: drivers/usb/dwc3/gadget.c: In function ‘dwc3_gadget_set_selfpowered’: include/log.h:235:4: warning: ‘flags’ is used uninitialized in this function [-Wuninitialized] 235 | printf(pr_fmt(fmt), ##args); \ | ^~~~~~ drivers/usb/dwc3/gadget.c:1347:17: note: ‘flags’ was declared here 1347 | unsigned long flags; | ^~~~~ and so on... Drop useless debug() call to make compiler happy. Fixes: 0c06db598367 ("lib, linux: move linux specific defines to linux/compat.h") Cc: Heiko Schocher Cc: Tom Rini Signed-off-by: Andy Shevchenko Reviewed-by: Oleksandr Andrushchenko Reviewed-by: Heiko Schocher --- include/linux/compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/compat.h b/include/linux/compat.h index 38549baa251..3d0acbd582e 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -248,7 +248,7 @@ typedef int wait_queue_head_t; #define spin_lock_init(lock) do {} while (0) #define spin_lock(lock) do {} while (0) #define spin_unlock(lock) do {} while (0) -#define spin_lock_irqsave(lock, flags) do { debug("%lu\n", flags); } while (0) +#define spin_lock_irqsave(lock, flags) do {} while (0) #define spin_unlock_irqrestore(lock, flags) do { flags = 0; } while (0) #define DEFINE_MUTEX(...) From d61e784136f16e9142ccc56b34f706b6e5002c5e Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 29 Nov 2020 17:07:04 -0700 Subject: [PATCH 04/11] log: Fix comment for LOGC_BOOT This comment is in the wrong format, so reports an error with 'make htmldocs'. Fix it. Fixes: b73d61a5565 ("x86: zimage: Add a little more logging") Signed-off-by: Simon Glass Reviewed-by: Heinrich Schuchardt --- include/log.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/log.h b/include/log.h index 29f18a82dcf..e53afa490e8 100644 --- a/include/log.h +++ b/include/log.h @@ -96,8 +96,8 @@ enum log_category_t { LOGC_DEVRES, /** @LOGC_ACPI: Advanced Configuration and Power Interface (ACPI) */ LOGC_ACPI, - LOGC_BOOT, /* Related to boot process / boot image processing */ - + /** @LOGC_BOOT: Related to boot process / boot image processing */ + LOGC_BOOT, /** @LOGC_COUNT: Number of log categories */ LOGC_COUNT, /** @LOGC_END: Sentinel value for lists of log categories */ From d211e0418fed8adf4ffa7c31f067e367fb26a081 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 29 Nov 2020 17:07:05 -0700 Subject: [PATCH 05/11] global_data: Fix comment for dm_driver_rt This comment is in the wrong format, so reports an error with 'make htmldocs'. Fix it. Fixes: a294ead8d25 ("dm: Use an allocated array for run-time device info") Signed-off-by: Simon Glass Reviewed-by: Heinrich Schuchardt --- include/asm-generic/global_data.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index 87d827d0f43..887b5c268de 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -196,7 +196,7 @@ struct global_data { */ struct list_head uclass_root; # if CONFIG_IS_ENABLED(OF_PLATDATA) - /** Dynamic info about the driver */ + /** @dm_driver_rt: Dynamic info about the driver */ struct driver_rt *dm_driver_rt; # endif #endif From 50efdf2c6ffe82a14cb7bf20a1abf55cff2ad135 Mon Sep 17 00:00:00 2001 From: AKASHI Takahiro Date: Thu, 19 Nov 2020 09:37:19 +0900 Subject: [PATCH 06/11] common: update: fix an "unused" warning against update_flash() Since update_flash() is used only in update_tftp(), it should be guarded with appropriate config options. After the commit 3149e524fc1e, common/update.c will be built under either CONFIG_UDATE_TFTP, CONFIG_DFU_TFTP or CONFIG_UPDATE_FIT. Since CONFIG_UPDATE_FIT, hence fit_update(), doesn't rely on update_flash(), the compiler may cause an "unused" warning if CONFIG_UPDATE_FIT=y and CONFIG_UPDATE_TFTP=n and CONFIG_DFU_TFTP=n. This is, for example, the case for sandbox defconfig where EFI_CAPSULE_FIRMWARE_FIT is enabled for test purpose. Fixes: 3149e524fc1e ("common: update: add a generic interface for FIT image") Signed-off-by: AKASHI Takahiro --- common/update.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/update.c b/common/update.c index 808be0880df..a5879cb52c4 100644 --- a/common/update.c +++ b/common/update.c @@ -29,7 +29,7 @@ #include #include -#ifdef CONFIG_DFU_TFTP +#if defined(CONFIG_DFU_TFTP) || defined(CONFIG_UPDATE_TFTP) /* env variable holding the location of the update file */ #define UPDATE_FILE_ENV "updatefile" @@ -99,7 +99,6 @@ static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr) return rv; } -#endif /* CONFIG_DFU_TFTP */ #ifdef CONFIG_MTD_NOR_FLASH static int update_flash_protect(int prot, ulong addr_first, ulong addr_last) @@ -216,6 +215,7 @@ static int update_flash(ulong addr_source, ulong addr_first, ulong size) #endif return 0; } +#endif /* CONFIG_DFU_TFTP || CONFIG_UPDATE_TFTP */ static int update_fit_getparams(const void *fit, int noffset, ulong *addr, ulong *fladdr, ulong *size) @@ -233,7 +233,7 @@ static int update_fit_getparams(const void *fit, int noffset, ulong *addr, return 0; } -#ifdef CONFIG_DFU_TFTP +#if defined(CONFIG_DFU_TFTP) || defined(CONFIG_UPDATE_TFTP) int update_tftp(ulong addr, char *interface, char *devstring) { char *filename, *env_addr, *fit_image_name; @@ -340,7 +340,7 @@ next_node: return ret; } -#endif /* CONFIG_DFU_UPDATE */ +#endif /* CONFIG_DFU_UPDATE || CONFIG_UPDATE_TFTP */ #ifdef CONFIG_UPDATE_FIT /** From 9e925d0c47871c5e38e70334d6485c504c0552e0 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 30 Nov 2020 09:04:48 +0100 Subject: [PATCH 07/11] log: typos in include/log.h Correct several typos. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- include/log.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/log.h b/include/log.h index e53afa490e8..6bce5606489 100644 --- a/include/log.h +++ b/include/log.h @@ -29,7 +29,7 @@ enum log_level_t { LOGL_CRIT, /** @LOGL_ERR: Error that prevents something from working */ LOGL_ERR, - /** @LOGL_WARNING: Warning may prevent optimial operation */ + /** @LOGL_WARNING: Warning may prevent optimal operation */ LOGL_WARNING, /** @LOGL_NOTICE: Normal but significant condition, printf() */ LOGL_NOTICE, @@ -322,7 +322,7 @@ void __assert_fail(const char *assertion, const char *file, unsigned int line, * * Members marked as 'not allocated' are stored as pointers and the caller is * responsible for making sure that the data pointed to is not overwritten. - * Memebers marked as 'allocated' are allocated (e.g. via strdup()) by the log + * Members marked as 'allocated' are allocated (e.g. via strdup()) by the log * system. * * TODO(sjg@chromium.org): Compress this struct down a bit to reduce space, e.g. @@ -379,7 +379,7 @@ struct log_driver { * the run-time aspects of drivers (currently just a list of filters to apply * to records send to this device). * - * @next_filter_num: Seqence number of next filter filter added (0=no filters + * @next_filter_num: Sequence number of next filter filter added (0=no filters * yet). This increments with each new filter on the device, but never * decrements * @flags: Flags for this filter (enum log_device_flags) @@ -412,7 +412,7 @@ enum log_filter_flags { }; /** - * struct log_filter - criterial to filter out log messages + * struct log_filter - criteria to filter out log messages * * If a message matches all criteria, then it is allowed. If LOGFF_DENY is set, * then it is denied instead. From e405efcf4b62810bdd08974d2a928353dba8d6ae Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 30 Nov 2020 09:08:12 +0100 Subject: [PATCH 08/11] MAINTAINERS: assign include/log.h include/log.h belongs to LOGGING. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 874cf2c0e57..2625fc629c4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -758,6 +758,7 @@ T: git https://gitlab.denx.de/u-boot/u-boot.git F: common/log* F: cmd/log.c F: doc/develop/logging.rst +F: include/log.h F: lib/getopt.c F: test/log/ F: test/py/tests/test_log.py From 382985675c7576d05969f61edbe14fb0a5ef1f0a Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Tue, 1 Dec 2020 00:12:39 +0100 Subject: [PATCH 09/11] mtd: spi-nor-ids: add Winbond W25Q32JW-IM flash The Kontron SMARC-sAL28 board uses that flash. This is the same change as in the linux commit f3418718c0ec ("mtd: spi-nor: Add support for w25q32jwm"). Signed-off-by: Michael Walle Reported-by: Leo Krueger --- drivers/mtd/spi/spi-nor-ids.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c index bc9d4f7e9f8..09e81960488 100644 --- a/drivers/mtd/spi/spi-nor-ids.c +++ b/drivers/mtd/spi/spi-nor-ids.c @@ -278,6 +278,11 @@ const struct flash_info spi_nor_ids[] = { SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) }, + { + INFO("w25q32jwm", 0xef8016, 0, 64 * 1024, 64, + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | + SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) + }, { INFO("w25x64", 0xef3017, 0, 64 * 1024, 128, SECT_4K) }, { INFO("w25q64dw", 0xef6017, 0, 64 * 1024, 128, From 4cb8a10f7e6f50a8c71e41df1207264266bfa305 Mon Sep 17 00:00:00 2001 From: Holger Brunck Date: Thu, 5 Nov 2020 10:15:37 +0100 Subject: [PATCH 10/11] remove obsolete option CONFIG_JFFS2_CMDLINE This option is obsolete since 2009 and can be removed globally. CC: Stefan Roese Signed-off-by: Holger Brunck Reviewed-by: Stefan Roese --- include/configs/ethernut5.h | 1 - include/configs/km/km-powerpc.h | 2 -- include/configs/kmp204x.h | 3 --- include/configs/pm9263.h | 1 - include/configs/stmark2.h | 1 - scripts/config_whitelist.txt | 1 - 6 files changed, 9 deletions(-) diff --git a/include/configs/ethernut5.h b/include/configs/ethernut5.h index b513b4bc68a..ca249d9d2b5 100644 --- a/include/configs/ethernut5.h +++ b/include/configs/ethernut5.h @@ -62,7 +62,6 @@ /* JFFS2 */ #ifdef CONFIG_CMD_JFFS2 -#define CONFIG_JFFS2_CMDLINE #define CONFIG_JFFS2_NAND #endif diff --git a/include/configs/km/km-powerpc.h b/include/configs/km/km-powerpc.h index 7bfe12fecbb..3be926c1031 100644 --- a/include/configs/km/km-powerpc.h +++ b/include/configs/km/km-powerpc.h @@ -9,8 +9,6 @@ /* Do boardspecific init for all boards */ -#define CONFIG_JFFS2_CMDLINE - /* EEprom support 24C08, 24C16, 24C64 */ #define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3 /* 8 Byte write page */ diff --git a/include/configs/kmp204x.h b/include/configs/kmp204x.h index ec1254e747b..d1eb7b574b4 100644 --- a/include/configs/kmp204x.h +++ b/include/configs/kmp204x.h @@ -337,9 +337,6 @@ int get_scl(void); * additionnal command line configuration. */ -/* we don't need flash support */ -#undef CONFIG_JFFS2_CMDLINE - /* * For booting Linux, the board info and command line data * have to be in the first 64 MB of memory, since this is diff --git a/include/configs/pm9263.h b/include/configs/pm9263.h index 0ed4b1aaa27..6c882b6ff94 100644 --- a/include/configs/pm9263.h +++ b/include/configs/pm9263.h @@ -190,7 +190,6 @@ #endif -#define CONFIG_JFFS2_CMDLINE 1 #define CONFIG_JFFS2_NAND 1 #define CONFIG_JFFS2_DEV "nand0" /* NAND device jffs2 lives on */ #define CONFIG_JFFS2_PART_OFFSET 0 /* start of jffs2 partition */ diff --git a/include/configs/stmark2.h b/include/configs/stmark2.h index d9a2f75e738..da162cbb114 100644 --- a/include/configs/stmark2.h +++ b/include/configs/stmark2.h @@ -49,7 +49,6 @@ #define CONFIG_SYS_MCFRRTC_BASE 0xFC0A8000 /* spi not partitions */ -#define CONFIG_JFFS2_CMDLINE #define CONFIG_JFFS2_DEV "nor0" /* Timer */ diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 8b4fcba395a..c0339dcc00d 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -848,7 +848,6 @@ CONFIG_IRAM_STACK CONFIG_IRAM_TOP CONFIG_IRDA_BASE CONFIG_IS_ENABLED -CONFIG_JFFS2_CMDLINE CONFIG_JFFS2_DEV CONFIG_JFFS2_LZO CONFIG_JFFS2_NAND From a6cd384b9c37596ca9035f26922dd65991ddcb85 Mon Sep 17 00:00:00 2001 From: Holger Brunck Date: Thu, 5 Nov 2020 10:28:51 +0100 Subject: [PATCH 11/11] km/common: remove CONFIG_MTD_CONCAT This was used for a board which is not supproted anymore and can therefore be dropped. CC: Stefan Roese Signed-off-by: Holger Brunck Reviewed-by: Stefan Roese --- include/configs/km/keymile-common.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/configs/km/keymile-common.h b/include/configs/km/keymile-common.h index 851b13e063d..ad0041d8a94 100644 --- a/include/configs/km/keymile-common.h +++ b/include/configs/km/keymile-common.h @@ -32,9 +32,6 @@ */ #define CONFIG_BOOTP_BOOTFILESIZE -/* UBI Support for all Keymile boards */ -#define CONFIG_MTD_CONCAT - #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS #define CONFIG_KM_DEF_ENV_BOOTPARAMS \ "actual_bank=0\0"