* [PATCH 0/2] nvmem: brcm_nvram: use buffered nvram data for cell values
@ 2023-02-06 10:05 Willem-Jan de Hoog
2023-02-06 10:05 ` [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data Willem-Jan de Hoog
2023-02-06 10:05 ` [PATCH 2/2] nvmem: brcm_nvram: use bcm47xx buffered data Willem-Jan de Hoog
0 siblings, 2 replies; 7+ messages in thread
From: Willem-Jan de Hoog @ 2023-02-06 10:05 UTC (permalink / raw)
To: Rafał Miłecki, Srinivas Kandagatla, Linus Walleij,
Willem-Jan de Hoog, Florian Fainelli
Cc: Arınç ÜNAL, Rafał Miłecki, linux-mips,
linux-kernel, erkin.bozoglu
Words from Willem-Jan de Hoog:
On OpenWrt 22.03.3, Asus RT-AC88U does not boot anymore:
UBI: auto-attach mtd4
ubi0: attaching mtd4
ubi0 error: 0xc04f0b3c: PEB 0 contains corrupted VID header, and the
data does not contain all 0xFF
ubi0 error: 0xc04f0b4c: this may be a non-UBI PEB or a severe VID
header corruption which requires manual inspection
The problem seems to be that brcm_nvram_read accesses its (mapped) io
memory. When doing so the correct data is read but after that the
mtd/ubi process fails to work.
The bcm47xx_nvram.c code has buffered the nvram data so the cells value
can be read from there.
Willem-Jan de Hoog (2):
firmware: bcm47xx_nvram: allow to read from buffered nvram data
nvmem: brcm_nvram: use bcm47xx buffered data
drivers/firmware/broadcom/bcm47xx_nvram.c | 14 ++++++++++++++
drivers/nvmem/brcm_nvram.c | 8 ++++++++
include/linux/bcm47xx_nvram.h | 6 ++++++
3 files changed, 28 insertions(+)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data
2023-02-06 10:05 [PATCH 0/2] nvmem: brcm_nvram: use buffered nvram data for cell values Willem-Jan de Hoog
@ 2023-02-06 10:05 ` Willem-Jan de Hoog
2023-02-07 6:21 ` kernel test robot
` (2 more replies)
2023-02-06 10:05 ` [PATCH 2/2] nvmem: brcm_nvram: use bcm47xx buffered data Willem-Jan de Hoog
1 sibling, 3 replies; 7+ messages in thread
From: Willem-Jan de Hoog @ 2023-02-06 10:05 UTC (permalink / raw)
To: Rafał Miłecki, Srinivas Kandagatla, Linus Walleij,
Willem-Jan de Hoog, Florian Fainelli
Cc: Arınç ÜNAL, Rafał Miłecki, linux-mips,
linux-kernel, erkin.bozoglu
The bcm47xx code makes a copy of the NVRAM data in ram. Allow access to
this data so property values can be read using nvmem cell api.
[ arinc.unal: Improved patch subject and log ]
Signed-off-by: Willem-Jan de Hoog <wdehoog@exalondelft.nl>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
---
drivers/firmware/broadcom/bcm47xx_nvram.c | 14 ++++++++++++++
include/linux/bcm47xx_nvram.h | 6 ++++++
2 files changed, 20 insertions(+)
diff --git a/drivers/firmware/broadcom/bcm47xx_nvram.c b/drivers/firmware/broadcom/bcm47xx_nvram.c
index 5f47dbf4889a..7e5c62dc702f 100644
--- a/drivers/firmware/broadcom/bcm47xx_nvram.c
+++ b/drivers/firmware/broadcom/bcm47xx_nvram.c
@@ -182,6 +182,20 @@ static int nvram_init(void)
return -ENXIO;
}
+int bcm47xx_nvram_read(unsigned int offset, char *val, size_t val_len)
+{
+ if (!nvram_len)
+ return -ENXIO;
+
+ if ((offset+val_len) > nvram_len)
+ return -EINVAL;
+
+ while (val_len--)
+ *val++ = nvram_buf[offset++];
+
+ return 0;
+}
+
int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len)
{
char *var, *value, *end, *eq;
diff --git a/include/linux/bcm47xx_nvram.h b/include/linux/bcm47xx_nvram.h
index 7615f8d7b1ed..b265b8ce6434 100644
--- a/include/linux/bcm47xx_nvram.h
+++ b/include/linux/bcm47xx_nvram.h
@@ -20,6 +20,7 @@ static inline void bcm47xx_nvram_release_contents(char *nvram)
{
vfree(nvram);
};
+int bcm47xx_nvram_read(unsigned int offset, char *val, size_t val_len);
#else
static inline int bcm47xx_nvram_init_from_iomem(void __iomem *nvram_start,
size_t res_size)
@@ -48,6 +49,11 @@ static inline char *bcm47xx_nvram_get_contents(size_t *val_len)
static inline void bcm47xx_nvram_release_contents(char *nvram)
{
};
+
+static inline int bcm47xx_nvram_read(unsigned int offset, char *val, size_t val_len)
+{
+ return -ENOTSUPP;
+}:
#endif
#endif /* __BCM47XX_NVRAM_H */
--
2.37.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] nvmem: brcm_nvram: use bcm47xx buffered data
2023-02-06 10:05 [PATCH 0/2] nvmem: brcm_nvram: use buffered nvram data for cell values Willem-Jan de Hoog
2023-02-06 10:05 ` [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data Willem-Jan de Hoog
@ 2023-02-06 10:05 ` Willem-Jan de Hoog
1 sibling, 0 replies; 7+ messages in thread
From: Willem-Jan de Hoog @ 2023-02-06 10:05 UTC (permalink / raw)
To: Rafał Miłecki, Srinivas Kandagatla, Linus Walleij,
Willem-Jan de Hoog, Florian Fainelli
Cc: Arınç ÜNAL, Rafał Miłecki, linux-mips,
linux-kernel, erkin.bozoglu
The bcm47xx module has a copy of the NVRAM data in ram. When available, use
this one instead of reading from io memory since it causes mtd/ubi to fail.
[ arinc.unal: Improved patch subject and log ]
Signed-off-by: Willem-Jan de Hoog <wdehoog@exalondelft.nl>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
---
drivers/nvmem/brcm_nvram.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/nvmem/brcm_nvram.c b/drivers/nvmem/brcm_nvram.c
index 34130449f2d2..f74bcb1c948e 100644
--- a/drivers/nvmem/brcm_nvram.c
+++ b/drivers/nvmem/brcm_nvram.c
@@ -33,6 +33,12 @@ struct brcm_nvram_header {
static int brcm_nvram_read(void *context, unsigned int offset, void *val,
size_t bytes)
{
+#ifdef CONFIG_BCM47XX_NVRAM
+
+ return bcm47xx_nvram_read(offset, val, bytes);
+
+#else
+
struct brcm_nvram *priv = context;
u8 *dst = val;
@@ -40,6 +46,8 @@ static int brcm_nvram_read(void *context, unsigned int offset, void *val,
*dst++ = readb(priv->base + offset++);
return 0;
+
+#endif
}
static int brcm_nvram_add_cells(struct brcm_nvram *priv, uint8_t *data,
--
2.37.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data
2023-02-06 10:05 ` [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data Willem-Jan de Hoog
@ 2023-02-07 6:21 ` kernel test robot
2023-02-08 16:49 ` kernel test robot
2023-02-15 14:50 ` kernel test robot
2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-02-07 6:21 UTC (permalink / raw)
To: Willem-Jan de Hoog, Rafał Miłecki, Srinivas Kandagatla,
Linus Walleij, Willem-Jan de Hoog, Florian Fainelli
Cc: oe-kbuild-all, Arınç ÜNAL, linux-mips,
linux-kernel, erkin.bozoglu
Hi Willem-Jan,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.2-rc7 next-20230206]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Willem-Jan-de-Hoog/firmware-bcm47xx_nvram-allow-to-read-from-buffered-nvram-data/20230206-180737
patch link: https://lore.kernel.org/r/20230206100502.20243-2-wdehoog%40exalondelft.nl
patch subject: [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data
config: sparc-randconfig-r035-20230205 (https://download.01.org/0day-ci/archive/20230207/202302071414.czB7JMnU-lkp@intel.com/config)
compiler: sparc-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/763f6661565b50b967e4f22e41cf46d27e14e58f
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Willem-Jan-de-Hoog/firmware-bcm47xx_nvram-allow-to-read-from-buffered-nvram-data/20230206-180737
git checkout 763f6661565b50b967e4f22e41cf46d27e14e58f
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sparc olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sparc SHELL=/bin/bash drivers/mtd/parsers/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from drivers/mtd/parsers/ofpart_linksys_ns.c:6:
include/linux/bcm47xx_nvram.h:56:2: error: expected identifier or '(' before ':' token
56 | }:
| ^
In file included from include/linux/uio.h:10,
from include/linux/mtd/mtd.h:10,
from drivers/mtd/parsers/ofpart_linksys_ns.c:7:
>> include/linux/mm_types.h:704:48: error: 'NR_MM_COUNTERS' undeclared here (not in a function)
704 | struct percpu_counter rss_stat[NR_MM_COUNTERS];
| ^~~~~~~~~~~~~~
vim +/NR_MM_COUNTERS +704 include/linux/mm_types.h
227a4aadc75ba2 Mathieu Desnoyers 2019-09-19 628
b279ddc3382426 Vegard Nossum 2017-02-27 629 /**
b279ddc3382426 Vegard Nossum 2017-02-27 630 * @mm_users: The number of users including userspace.
b279ddc3382426 Vegard Nossum 2017-02-27 631 *
c1a2f7f0c06454 Rik van Riel 2018-07-16 632 * Use mmget()/mmget_not_zero()/mmput() to modify. When this
c1a2f7f0c06454 Rik van Riel 2018-07-16 633 * drops to 0 (i.e. when the task exits and there are no other
c1a2f7f0c06454 Rik van Riel 2018-07-16 634 * temporary reference holders), we also release a reference on
c1a2f7f0c06454 Rik van Riel 2018-07-16 635 * @mm_count (which may then free the &struct mm_struct if
c1a2f7f0c06454 Rik van Riel 2018-07-16 636 * @mm_count also drops to 0).
b279ddc3382426 Vegard Nossum 2017-02-27 637 */
b279ddc3382426 Vegard Nossum 2017-02-27 638 atomic_t mm_users;
b279ddc3382426 Vegard Nossum 2017-02-27 639
b279ddc3382426 Vegard Nossum 2017-02-27 640 /**
b279ddc3382426 Vegard Nossum 2017-02-27 641 * @mm_count: The number of references to &struct mm_struct
b279ddc3382426 Vegard Nossum 2017-02-27 642 * (@mm_users count as 1).
b279ddc3382426 Vegard Nossum 2017-02-27 643 *
b279ddc3382426 Vegard Nossum 2017-02-27 644 * Use mmgrab()/mmdrop() to modify. When this drops to 0, the
b279ddc3382426 Vegard Nossum 2017-02-27 645 * &struct mm_struct is freed.
b279ddc3382426 Vegard Nossum 2017-02-27 646 */
b279ddc3382426 Vegard Nossum 2017-02-27 647 atomic_t mm_count;
b279ddc3382426 Vegard Nossum 2017-02-27 648
c4812909f5d5a9 Kirill A. Shutemov 2017-11-15 649 #ifdef CONFIG_MMU
af5b0f6a09e42c Kirill A. Shutemov 2017-11-15 650 atomic_long_t pgtables_bytes; /* PTE page table pages */
5a3fbef325e872 Kirill A. Shutemov 2015-04-14 651 #endif
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 652 int map_count; /* number of VMAs */
481b4bb5e370aa Richard Kennedy 2011-03-22 653
c1a2f7f0c06454 Rik van Riel 2018-07-16 654 spinlock_t page_table_lock; /* Protects page tables and some
c1a2f7f0c06454 Rik van Riel 2018-07-16 655 * counters
c1a2f7f0c06454 Rik van Riel 2018-07-16 656 */
2e3025434a6ba0 Feng Tang 2021-06-11 657 /*
2e3025434a6ba0 Feng Tang 2021-06-11 658 * With some kernel config, the current mmap_lock's offset
2e3025434a6ba0 Feng Tang 2021-06-11 659 * inside 'mm_struct' is at 0x120, which is very optimal, as
2e3025434a6ba0 Feng Tang 2021-06-11 660 * its two hot fields 'count' and 'owner' sit in 2 different
2e3025434a6ba0 Feng Tang 2021-06-11 661 * cachelines, and when mmap_lock is highly contended, both
2e3025434a6ba0 Feng Tang 2021-06-11 662 * of the 2 fields will be accessed frequently, current layout
2e3025434a6ba0 Feng Tang 2021-06-11 663 * will help to reduce cache bouncing.
2e3025434a6ba0 Feng Tang 2021-06-11 664 *
2e3025434a6ba0 Feng Tang 2021-06-11 665 * So please be careful with adding new fields before
2e3025434a6ba0 Feng Tang 2021-06-11 666 * mmap_lock, which can easily push the 2 fields into one
2e3025434a6ba0 Feng Tang 2021-06-11 667 * cacheline.
2e3025434a6ba0 Feng Tang 2021-06-11 668 */
da1c55f1b272f4 Michel Lespinasse 2020-06-08 669 struct rw_semaphore mmap_lock;
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 670
c1a2f7f0c06454 Rik van Riel 2018-07-16 671 struct list_head mmlist; /* List of maybe swapped mm's. These
c1a2f7f0c06454 Rik van Riel 2018-07-16 672 * are globally strung together off
c1a2f7f0c06454 Rik van Riel 2018-07-16 673 * init_mm.mmlist, and are protected
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 674 * by mmlist_lock
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 675 */
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 676
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 677
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 678 unsigned long hiwater_rss; /* High-watermark of RSS usage */
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 679 unsigned long hiwater_vm; /* High-water virtual memory usage */
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 680
e10d59f2c3deca Christoph Lameter 2011-10-31 681 unsigned long total_vm; /* Total pages mapped */
e10d59f2c3deca Christoph Lameter 2011-10-31 682 unsigned long locked_vm; /* Pages that have PG_mlocked set */
70f8a3ca68d3e1 Davidlohr Bueso 2019-02-06 683 atomic64_t pinned_vm; /* Refcount permanently increased */
30bdbb78009e67 Konstantin Khlebnikov 2016-02-02 684 unsigned long data_vm; /* VM_WRITE & ~VM_SHARED & ~VM_STACK */
30bdbb78009e67 Konstantin Khlebnikov 2016-02-02 685 unsigned long exec_vm; /* VM_EXEC & ~VM_WRITE & ~VM_STACK */
30bdbb78009e67 Konstantin Khlebnikov 2016-02-02 686 unsigned long stack_vm; /* VM_STACK */
e10d59f2c3deca Christoph Lameter 2011-10-31 687 unsigned long def_flags;
88aa7cc688d48d Yang Shi 2018-06-07 688
2e3025434a6ba0 Feng Tang 2021-06-11 689 /**
2e3025434a6ba0 Feng Tang 2021-06-11 690 * @write_protect_seq: Locked when any thread is write
2e3025434a6ba0 Feng Tang 2021-06-11 691 * protecting pages mapped by this mm to enforce a later COW,
2e3025434a6ba0 Feng Tang 2021-06-11 692 * for instance during page table copying for fork().
2e3025434a6ba0 Feng Tang 2021-06-11 693 */
2e3025434a6ba0 Feng Tang 2021-06-11 694 seqcount_t write_protect_seq;
2e3025434a6ba0 Feng Tang 2021-06-11 695
88aa7cc688d48d Yang Shi 2018-06-07 696 spinlock_t arg_lock; /* protect the below fields */
2e3025434a6ba0 Feng Tang 2021-06-11 697
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 698 unsigned long start_code, end_code, start_data, end_data;
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 699 unsigned long start_brk, brk, start_stack;
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 700 unsigned long arg_start, arg_end, env_start, env_end;
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 701
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 702 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 703
f1a7941243c102 Shakeel Butt 2022-10-24 @704 struct percpu_counter rss_stat[NR_MM_COUNTERS];
d559db086ff5be KAMEZAWA Hiroyuki 2010-03-05 705
801460d0cf5c52 Hiroshi Shimamoto 2009-09-23 706 struct linux_binfmt *binfmt;
801460d0cf5c52 Hiroshi Shimamoto 2009-09-23 707
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 708 /* Architecture-specific MM context */
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 709 mm_context_t context;
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 710
c1a2f7f0c06454 Rik van Riel 2018-07-16 711 unsigned long flags; /* Must use atomic bitops to access */
c92ff1bde06f69 Martin Schwidefsky 2007-10-16 712
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data
2023-02-06 10:05 ` [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data Willem-Jan de Hoog
2023-02-07 6:21 ` kernel test robot
@ 2023-02-08 16:49 ` kernel test robot
2023-02-15 14:50 ` kernel test robot
2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-02-08 16:49 UTC (permalink / raw)
To: Willem-Jan de Hoog, Rafał Miłecki, Srinivas Kandagatla,
Linus Walleij, Willem-Jan de Hoog, Florian Fainelli
Cc: llvm, oe-kbuild-all, Arınç ÜNAL, linux-mips,
linux-kernel, erkin.bozoglu
Hi Willem-Jan,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.2-rc7 next-20230208]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Willem-Jan-de-Hoog/firmware-bcm47xx_nvram-allow-to-read-from-buffered-nvram-data/20230206-180737
patch link: https://lore.kernel.org/r/20230206100502.20243-2-wdehoog%40exalondelft.nl
patch subject: [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data
config: x86_64-randconfig-a006-20230206 (https://download.01.org/0day-ci/archive/20230209/202302090020.TxUXGMeJ-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/763f6661565b50b967e4f22e41cf46d27e14e58f
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Willem-Jan-de-Hoog/firmware-bcm47xx_nvram-allow-to-read-from-buffered-nvram-data/20230206-180737
git checkout 763f6661565b50b967e4f22e41cf46d27e14e58f
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:12:
>> include/linux/bcm47xx_nvram.h:56:2: error: expected identifier or '('
}:
^
In file included from drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:14:
In file included from drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h:9:
In file included from include/linux/net.h:24:
In file included from include/linux/mm.h:15:
>> include/linux/mmap_lock.h:28:6: error: use of undeclared identifier '__tracepoint_mmap_lock_start_locking'; did you mean '__tracepoint_mmap_lock_released'?
if (tracepoint_enabled(mmap_lock_start_locking))
^
include/linux/tracepoint-defs.h:85:21: note: expanded from macro 'tracepoint_enabled'
static_key_false(&(__tracepoint_##tp).key)
^
<scratch space>:48:1: note: expanded from here
__tracepoint_mmap_lock_start_locking
^
include/linux/mmap_lock.h:16:1: note: '__tracepoint_mmap_lock_released' declared here
DECLARE_TRACEPOINT(mmap_lock_released);
^
include/linux/tracepoint-defs.h:81:27: note: expanded from macro 'DECLARE_TRACEPOINT'
extern struct tracepoint __tracepoint_##tp
^
<scratch space>:47:1: note: expanded from here
__tracepoint_mmap_lock_released
^
2 errors generated.
vim +56 include/linux/bcm47xx_nvram.h
52
53 static inline int bcm47xx_nvram_read(unsigned int offset, char *val, size_t val_len)
54 {
55 return -ENOTSUPP;
> 56 }:
57 #endif
58
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data
2023-02-06 10:05 ` [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data Willem-Jan de Hoog
2023-02-07 6:21 ` kernel test robot
2023-02-08 16:49 ` kernel test robot
@ 2023-02-15 14:50 ` kernel test robot
2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-02-15 14:50 UTC (permalink / raw)
To: Willem-Jan de Hoog, Rafał Miłecki, Srinivas Kandagatla,
Linus Walleij, Willem-Jan de Hoog, Florian Fainelli
Cc: oe-kbuild-all, Arınç ÜNAL, linux-mips,
linux-kernel, erkin.bozoglu
Hi Willem-Jan,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v6.2-rc8 next-20230215]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Willem-Jan-de-Hoog/firmware-bcm47xx_nvram-allow-to-read-from-buffered-nvram-data/20230206-180737
patch link: https://lore.kernel.org/r/20230206100502.20243-2-wdehoog%40exalondelft.nl
patch subject: [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data
config: arm64-defconfig (https://download.01.org/0day-ci/archive/20230215/202302152222.wtVZ1npH-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/763f6661565b50b967e4f22e41cf46d27e14e58f
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Willem-Jan-de-Hoog/firmware-bcm47xx_nvram-allow-to-read-from-buffered-nvram-data/20230206-180737
git checkout 763f6661565b50b967e4f22e41cf46d27e14e58f
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/net/ethernet/broadcom/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202302152222.wtVZ1npH-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/net/ethernet/broadcom/bgmac.c:15:
include/linux/bcm47xx_nvram.h:56:2: error: expected identifier or '(' before ':' token
56 | }:
| ^
In file included from include/linux/ethtool.h:19,
from include/linux/phy.h:16,
from drivers/net/ethernet/broadcom/bgmac.c:16:
>> include/uapi/linux/ethtool.h:125:49: warning: 'struct ethtool_cmd' declared inside parameter list will not be visible outside of this definition or declaration
125 | static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
| ^~~~~~~~~~~
include/uapi/linux/ethtool.h: In function 'ethtool_cmd_speed_set':
include/uapi/linux/ethtool.h:128:11: error: invalid use of undefined type 'struct ethtool_cmd'
128 | ep->speed = (__u16)(speed & 0xFFFF);
| ^~
include/uapi/linux/ethtool.h:129:11: error: invalid use of undefined type 'struct ethtool_cmd'
129 | ep->speed_hi = (__u16)(speed >> 16);
| ^~
include/uapi/linux/ethtool.h: At top level:
include/uapi/linux/ethtool.h:132:52: warning: 'struct ethtool_cmd' declared inside parameter list will not be visible outside of this definition or declaration
132 | static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
| ^~~~~~~~~~~
include/uapi/linux/ethtool.h: In function 'ethtool_cmd_speed':
include/uapi/linux/ethtool.h:134:19: error: invalid use of undefined type 'const struct ethtool_cmd'
134 | return (ep->speed_hi << 16) | ep->speed;
| ^~
include/uapi/linux/ethtool.h:134:41: error: invalid use of undefined type 'const struct ethtool_cmd'
134 | return (ep->speed_hi << 16) | ep->speed;
| ^~
vim +125 include/uapi/linux/ethtool.h
607ca46e97a1b6 David Howells 2012-10-13 124
607ca46e97a1b6 David Howells 2012-10-13 @125 static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
607ca46e97a1b6 David Howells 2012-10-13 126 __u32 speed)
607ca46e97a1b6 David Howells 2012-10-13 127 {
85a624403c77c3 Jesse Brandeburg 2016-10-13 128 ep->speed = (__u16)(speed & 0xFFFF);
607ca46e97a1b6 David Howells 2012-10-13 129 ep->speed_hi = (__u16)(speed >> 16);
607ca46e97a1b6 David Howells 2012-10-13 130 }
607ca46e97a1b6 David Howells 2012-10-13 131
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data
@ 2023-02-10 4:47 kernel test robot
0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-02-10 4:47 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "low confidence static check first_new_problem: include/linux/sockptr.h:20:3: error: type defaults to 'int' in declaration of 'sockptr_t' [-Werror=implicit-int]"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20230206100502.20243-2-wdehoog@exalondelft.nl>
References: <20230206100502.20243-2-wdehoog@exalondelft.nl>
TO: "Willem-Jan de Hoog" <arinc9.unal@gmail.com>
TO: "Rafał Miłecki" <zajec5@gmail.com>
TO: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
TO: Linus Walleij <linus.walleij@linaro.org>
TO: "Willem-Jan de Hoog" <wdehoog@exalondelft.nl>
TO: Florian Fainelli <f.fainelli@gmail.com>
CC: "Arınç ÜNAL" <arinc.unal@arinc9.com>
CC: linux-mips@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: erkin.bozoglu@xeront.com
Hi Willem-Jan,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.2-rc7 next-20230209]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Willem-Jan-de-Hoog/firmware-bcm47xx_nvram-allow-to-read-from-buffered-nvram-data/20230206-180737
patch link: https://lore.kernel.org/r/20230206100502.20243-2-wdehoog%40exalondelft.nl
patch subject: [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: nios2-randconfig-s041-20230209 (https://download.01.org/0day-ci/archive/20230210/202302101250.npfH2mOz-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://github.com/intel-lab-lkp/linux/commit/763f6661565b50b967e4f22e41cf46d27e14e58f
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Willem-Jan-de-Hoog/firmware-bcm47xx_nvram-allow-to-read-from-buffered-nvram-data/20230206-180737
git checkout 763f6661565b50b967e4f22e41cf46d27e14e58f
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=nios2 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=nios2 SHELL=/bin/bash drivers/net/wireless/broadcom/brcm80211/brcmfmac/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/r/202302101250.npfH2mOz-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
In file included from drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:12:
include/linux/bcm47xx_nvram.h:56:2: error: expected identifier or '(' before ':' token
56 | }:
| ^
In file included from include/linux/net.h:25,
from drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h:9,
from drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:14:
>> include/linux/sockptr.h:20:3: warning: data definition has no type or storage class
20 | } sockptr_t;
| ^~~~~~~~~
>> include/linux/sockptr.h:20:3: error: type defaults to 'int' in declaration of 'sockptr_t' [-Werror=implicit-int]
>> include/linux/sockptr.h:22:38: error: expected declaration specifiers or '...' before 'sockptr_t'
22 | static inline bool sockptr_is_kernel(sockptr_t sockptr)
| ^~~~~~~~~
>> include/linux/sockptr.h:27:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'KERNEL_SOCKPTR'
27 | static inline sockptr_t KERNEL_SOCKPTR(void *p)
| ^~~~~~~~~~~~~~
>> include/linux/sockptr.h:32:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'USER_SOCKPTR'
32 | static inline sockptr_t USER_SOCKPTR(void __user *p)
| ^~~~~~~~~~~~
include/linux/sockptr.h:37:36: error: expected declaration specifiers or '...' before 'sockptr_t'
37 | static inline bool sockptr_is_null(sockptr_t sockptr)
| ^~~~~~~~~
include/linux/sockptr.h:44:55: error: expected declaration specifiers or '...' before 'sockptr_t'
44 | static inline int copy_from_sockptr_offset(void *dst, sockptr_t src,
| ^~~~~~~~~
include/linux/sockptr.h:53:48: error: expected declaration specifiers or '...' before 'sockptr_t'
53 | static inline int copy_from_sockptr(void *dst, sockptr_t src, size_t size)
| ^~~~~~~~~
include/linux/sockptr.h:58:42: error: expected declaration specifiers or '...' before 'sockptr_t'
58 | static inline int copy_to_sockptr_offset(sockptr_t dst, size_t offset,
| ^~~~~~~~~
include/linux/sockptr.h:67:35: error: expected declaration specifiers or '...' before 'sockptr_t'
67 | static inline int copy_to_sockptr(sockptr_t dst, const void *src, size_t size)
| ^~~~~~~~~
include/linux/sockptr.h:72:36: error: expected declaration specifiers or '...' before 'sockptr_t'
72 | static inline void *memdup_sockptr(sockptr_t src, size_t len)
| ^~~~~~~~~
include/linux/sockptr.h:85:40: error: expected declaration specifiers or '...' before 'sockptr_t'
85 | static inline void *memdup_sockptr_nul(sockptr_t src, size_t len)
| ^~~~~~~~~
include/linux/sockptr.h:99:52: error: expected declaration specifiers or '...' before 'sockptr_t'
99 | static inline long strncpy_from_sockptr(char *dst, sockptr_t src, size_t count)
| ^~~~~~~~~
include/linux/sockptr.h:110:40: error: expected declaration specifiers or '...' before 'sockptr_t'
110 | static inline int check_zeroed_sockptr(sockptr_t src, size_t offset,
| ^~~~~~~~~
>> include/linux/net.h:190:52: error: expected declaration specifiers or '...' before 'sockptr_t'
190 | int optname, sockptr_t optval,
| ^~~~~~~~~
In file included from include/net/scm.h:8,
from include/linux/netlink.h:9,
from include/linux/ethtool.h:18,
from include/net/cfg80211.h:13,
from drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h:13,
from drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:16:
>> include/linux/security.h:1588:53: error: expected declaration specifiers or '...' before 'sockptr_t'
1588 | sockptr_t optval,
| ^~~~~~~~~
include/linux/security.h:1589:53: error: expected declaration specifiers or '...' before 'sockptr_t'
1589 | sockptr_t optlen,
| ^~~~~~~~~
cc1: some warnings being treated as errors
vim +20 include/linux/sockptr.h
ba423fdaa589d97 Christoph Hellwig 2020-07-23 13
ba423fdaa589d97 Christoph Hellwig 2020-07-23 14 typedef struct {
ba423fdaa589d97 Christoph Hellwig 2020-07-23 15 union {
ba423fdaa589d97 Christoph Hellwig 2020-07-23 16 void *kernel;
ba423fdaa589d97 Christoph Hellwig 2020-07-23 17 void __user *user;
ba423fdaa589d97 Christoph Hellwig 2020-07-23 18 };
ba423fdaa589d97 Christoph Hellwig 2020-07-23 19 bool is_kernel : 1;
ba423fdaa589d97 Christoph Hellwig 2020-07-23 @20 } sockptr_t;
ba423fdaa589d97 Christoph Hellwig 2020-07-23 21
ba423fdaa589d97 Christoph Hellwig 2020-07-23 @22 static inline bool sockptr_is_kernel(sockptr_t sockptr)
ba423fdaa589d97 Christoph Hellwig 2020-07-23 23 {
ba423fdaa589d97 Christoph Hellwig 2020-07-23 24 return sockptr.is_kernel;
ba423fdaa589d97 Christoph Hellwig 2020-07-23 25 }
ba423fdaa589d97 Christoph Hellwig 2020-07-23 26
ba423fdaa589d97 Christoph Hellwig 2020-07-23 @27 static inline sockptr_t KERNEL_SOCKPTR(void *p)
ba423fdaa589d97 Christoph Hellwig 2020-07-23 28 {
ba423fdaa589d97 Christoph Hellwig 2020-07-23 29 return (sockptr_t) { .kernel = p, .is_kernel = true };
ba423fdaa589d97 Christoph Hellwig 2020-07-23 30 }
ba423fdaa589d97 Christoph Hellwig 2020-07-23 31
519a8a6cf91dda0 Christoph Hellwig 2020-08-10 @32 static inline sockptr_t USER_SOCKPTR(void __user *p)
ba423fdaa589d97 Christoph Hellwig 2020-07-23 33 {
519a8a6cf91dda0 Christoph Hellwig 2020-08-10 34 return (sockptr_t) { .user = p };
ba423fdaa589d97 Christoph Hellwig 2020-07-23 35 }
ba423fdaa589d97 Christoph Hellwig 2020-07-23 36
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-02-15 14:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-06 10:05 [PATCH 0/2] nvmem: brcm_nvram: use buffered nvram data for cell values Willem-Jan de Hoog
2023-02-06 10:05 ` [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data Willem-Jan de Hoog
2023-02-07 6:21 ` kernel test robot
2023-02-08 16:49 ` kernel test robot
2023-02-15 14:50 ` kernel test robot
2023-02-06 10:05 ` [PATCH 2/2] nvmem: brcm_nvram: use bcm47xx buffered data Willem-Jan de Hoog
2023-02-10 4:47 [PATCH 1/2] firmware: bcm47xx_nvram: allow to read from buffered nvram data kernel test robot
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.