2021-03-03 01:11:35

by Yang Li

[permalink] [raw]
Subject: [PATCH] driver core: Switch to using the new API kobj_to_dev()

fixed the following coccicheck:
./include/linux/device.h:590:46-47: WARNING opportunity for
kobj_to_dev()

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
---
include/linux/device.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/device.h b/include/linux/device.h
index ba66073..31d7137 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -587,7 +587,7 @@ struct device_link {

static inline struct device *kobj_to_dev(struct kobject *kobj)
{
- return container_of(kobj, struct device, kobj);
+ return kobj_to_dev(kobj);
}

/**
--
1.8.3.1


2021-03-03 01:21:53

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] driver core: Switch to using the new API kobj_to_dev()

On Mon, Mar 01, 2021 at 05:13:24PM +0800, Yang Li wrote:
> fixed the following coccicheck:
> ./include/linux/device.h:590:46-47: WARNING opportunity for
> kobj_to_dev()
>
> Reported-by: Abaci Robot <[email protected]>
> Signed-off-by: Yang Li <[email protected]>
> ---
> include/linux/device.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/device.h b/include/linux/device.h
> index ba66073..31d7137 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -587,7 +587,7 @@ struct device_link {
>
> static inline struct device *kobj_to_dev(struct kobject *kobj)
> {
> - return container_of(kobj, struct device, kobj);
> + return kobj_to_dev(kobj);
> }

Did you test this change? Please do so...

{sigh}

greg k-h

2021-09-29 14:44:32

by Oliver Sang

[permalink] [raw]
Subject: [driver core] eedc73d4f3: BUG:kernel_reboot-without-warning_in_boot_stage



Greeting,

FYI, we noticed the following commit (built with gcc-9):

commit: eedc73d4f330cf7a8d18d64f327837ae9a00d003 ("[PATCH] driver core: Switch to using the new API kobj_to_dev()")
url: https://github.com/0day-ci/linux/commits/Yang-Li/driver-core-Switch-to-using-the-new-API-kobj_to_dev/20210929-102216
base: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git 5816b3e6577eaa676ceb00a848f0fd65fe2adc29

in testcase: rcutorture
version:
with following parameters:

runtime: 300s
test: cpuhotplug
torture_type: tasks

test-description: rcutorture is rcutorture kernel module load/unload test.
test-url: https://www.kernel.org/doc/Documentation/RCU/torture.txt


on test machine: qemu-system-i386 -enable-kvm -cpu SandyBridge -smp 2 -m 4G

caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):


+--------------------------------------------------------------------+-----------+------------+
| | v5.15-rc3 | eedc73d4f3 |
+--------------------------------------------------------------------+-----------+------------+
| boot_successes | 221 | 0 |
| BUG:kernel_reboot-without-warning_in_boot_stage | 0 | 7 |
+--------------------------------------------------------------------+-----------+------------+


If you fix the issue, kindly add following tag
Reported-by: kernel test robot <[email protected]>


[ 1.879942][ T17] kvm-guest: stealtime: cpu 1, msr b4fe9b40
[ 1.883976][ T1] smp: Brought up 1 node, 2 CPUs
[ 1.884516][ T1] smpboot: Max logical packages: 2
[ 1.884997][ T1] smpboot: Total of 2 processors activated (8782.62 BogoMIPS)
[ 1.887450][ T1] devtmpfs: initialized
BUG: kernel reboot-without-warning in boot stage

Kboot worker: lkp-worker43
Elapsed time: 60

kvm=(


To reproduce:

# build kernel
cd linux
cp config-5.15.0-rc3-00001-geedc73d4f330 .config
make HOSTCC=gcc-9 CC=gcc-9 ARCH=i386 olddefconfig prepare modules_prepare bzImage

git clone https://github.com/intel/lkp-tests.git
cd lkp-tests
bin/lkp qemu -k <bzImage> job-script # job-script is attached in this email

# if come across any failure that blocks the test,
# please remove ~/.lkp and /lkp dir to run from a clean state.



---
0DAY/LKP+ Test Infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/[email protected] Intel Corporation

Thanks,
Oliver Sang


Attachments:
(No filename) (2.61 kB)
config-5.15.0-rc3-00001-geedc73d4f330 (149.59 kB)
job-script (4.85 kB)
dmesg.xz (6.25 kB)
Download all attachments

2021-09-29 17:25:52

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [driver core] eedc73d4f3: BUG:kernel_reboot-without-warning_in_boot_stage

On Wed, Sep 29, 2021 at 11:02:40PM +0800, kernel test robot wrote:
>
>
> Greeting,
>
> FYI, we noticed the following commit (built with gcc-9):
>
> commit: eedc73d4f330cf7a8d18d64f327837ae9a00d003 ("[PATCH] driver core: Switch to using the new API kobj_to_dev()")
> url: https://github.com/0day-ci/linux/commits/Yang-Li/driver-core-Switch-to-using-the-new-API-kobj_to_dev/20210929-102216
> base: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git 5816b3e6577eaa676ceb00a848f0fd65fe2adc29

There is no such commit in my tree, or anywhere else I can see, so I
have no idea what is happening here :(

2021-09-30 05:42:03

by Oliver Sang

[permalink] [raw]
Subject: Re: [driver core] eedc73d4f3: BUG:kernel_reboot-without-warning_in_boot_stage

Hi, Greg KH,

On Wed, Sep 29, 2021 at 05:13:55PM +0200, Greg KH wrote:
> On Wed, Sep 29, 2021 at 11:02:40PM +0800, kernel test robot wrote:
> >
> >
> > Greeting,
> >
> > FYI, we noticed the following commit (built with gcc-9):
> >
> > commit: eedc73d4f330cf7a8d18d64f327837ae9a00d003 ("[PATCH] driver core: Switch to using the new API kobj_to_dev()")
> > url: https://github.com/0day-ci/linux/commits/Yang-Li/driver-core-Switch-to-using-the-new-API-kobj_to_dev/20210929-102216
> > base: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git 5816b3e6577eaa676ceb00a848f0fd65fe2adc29
>
> There is no such commit in my tree, or anywhere else I can see, so I
> have no idea what is happening here :(
>

this report was sent to Yang Li, who is the patch author.
https://lore.kernel.org/lkml/[email protected]/

since Yang sent the patch to you, so our Rot automatically add you in
the Cc list.

2021-09-30 06:26:00

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [driver core] eedc73d4f3: BUG:kernel_reboot-without-warning_in_boot_stage

On Thu, Sep 30, 2021 at 01:59:44PM +0800, Oliver Sang wrote:
> Hi, Greg KH,
>
> On Wed, Sep 29, 2021 at 05:13:55PM +0200, Greg KH wrote:
> > On Wed, Sep 29, 2021 at 11:02:40PM +0800, kernel test robot wrote:
> > >
> > >
> > > Greeting,
> > >
> > > FYI, we noticed the following commit (built with gcc-9):
> > >
> > > commit: eedc73d4f330cf7a8d18d64f327837ae9a00d003 ("[PATCH] driver core: Switch to using the new API kobj_to_dev()")
> > > url: https://github.com/0day-ci/linux/commits/Yang-Li/driver-core-Switch-to-using-the-new-API-kobj_to_dev/20210929-102216
> > > base: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git 5816b3e6577eaa676ceb00a848f0fd65fe2adc29
> >
> > There is no such commit in my tree, or anywhere else I can see, so I
> > have no idea what is happening here :(
> >
>
> this report was sent to Yang Li, who is the patch author.
> https://lore.kernel.org/lkml/[email protected]/
>
> since Yang sent the patch to you, so our Rot automatically add you in
> the Cc list.

That patch was sent back on March 1. And was instantly rejected for the
obvious reason it was never tested :)

Why is 0-day running on such old changes now?

And it is not obvious that this is being run on an email submission at
all, where would I have found that information in this response? I see
a git id that points to a kernel tree. No email link at all.

thanks,

greg k-h

2021-09-30 08:08:44

by Philip Li

[permalink] [raw]
Subject: Re: [driver core] eedc73d4f3: BUG:kernel_reboot-without-warning_in_boot_stage

On Thu, Sep 30, 2021 at 08:23:26AM +0200, Greg KH wrote:
> On Thu, Sep 30, 2021 at 01:59:44PM +0800, Oliver Sang wrote:
> > Hi, Greg KH,
> >
> > On Wed, Sep 29, 2021 at 05:13:55PM +0200, Greg KH wrote:
> > > On Wed, Sep 29, 2021 at 11:02:40PM +0800, kernel test robot wrote:
> > > >
> > > >
> > > > Greeting,
> > > >
> > > > FYI, we noticed the following commit (built with gcc-9):
> > > >
> > > > commit: eedc73d4f330cf7a8d18d64f327837ae9a00d003 ("[PATCH] driver core: Switch to using the new API kobj_to_dev()")
> > > > url: https://github.com/0day-ci/linux/commits/Yang-Li/driver-core-Switch-to-using-the-new-API-kobj_to_dev/20210929-102216
> > > > base: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git 5816b3e6577eaa676ceb00a848f0fd65fe2adc29
> > >
> > > There is no such commit in my tree, or anywhere else I can see, so I
> > > have no idea what is happening here :(
> > >
> >
> > this report was sent to Yang Li, who is the patch author.
> > https://lore.kernel.org/lkml/[email protected]/
> >
> > since Yang sent the patch to you, so our Rot automatically add you in
> > the Cc list.
>
> That patch was sent back on March 1. And was instantly rejected for the
> obvious reason it was never tested :)
>
> Why is 0-day running on such old changes now?
sorry about this Greg, that we have a storage crash in last 5 days, and
the data seems not consistent after we recovered that old patches are
re-scanned to be tested. We will manually check the existing data to
avoid test old ones.

>
> And it is not obvious that this is being run on an email submission at
> all, where would I have found that information in this response? I see
> a git id that points to a kernel tree. No email link at all.
We will improve this in our report to point out the original patch mail
link whenever possible. Currently we show the git to provide the branch
that we apply such mail patch for author to reproduce. But definitely,
it is clearer to show explicitly that this is test against the mail patch.

>
> thanks,
>
> greg k-h

2021-11-07 10:04:47

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] driver core: Switch to using the new API kobj_to_dev()

Hi Yang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.15 next-20211106]
[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]

url: https://github.com/0day-ci/linux/commits/Yang-Li/driver-core-Switch-to-using-the-new-API-kobj_to_dev/20210929-102216
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5816b3e6577eaa676ceb00a848f0fd65fe2adc29
config: arm64-buildonly-randconfig-r006-20210928 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project dc6e8dfdfe7efecfda318d43a06fae18b40eb498)
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
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/eedc73d4f330cf7a8d18d64f327837ae9a00d003
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Yang-Li/driver-core-Switch-to-using-the-new-API-kobj_to_dev/20210929-102216
git checkout eedc73d4f330cf7a8d18d64f327837ae9a00d003
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

In file included from arch/arm64/kernel/asm-offsets.c:10:
In file included from include/linux/arm_sdei.h:8:
In file included from include/acpi/ghes.h:5:
In file included from include/acpi/apei.h:9:
In file included from include/linux/acpi.h:15:
>> include/linux/device.h:609:1: error: all paths through this function will call itself [-Werror,-Winfinite-recursion]
{
^
1 error generated.
make[2]: *** [scripts/Makefile.build:121: arch/arm64/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1219: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:219: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.


vim +609 include/linux/device.h

287905e68dd298 Saravana Kannan 2020-05-21 607
a4232963757e62 Lars-Peter Clausen 2012-07-03 608 static inline struct device *kobj_to_dev(struct kobject *kobj)
a4232963757e62 Lars-Peter Clausen 2012-07-03 @609 {
eedc73d4f330cf Yang Li 2021-03-01 610 return kobj_to_dev(kobj);
a4232963757e62 Lars-Peter Clausen 2012-07-03 611 }
a4232963757e62 Lars-Peter Clausen 2012-07-03 612

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (3.00 kB)
.config.gz (46.35 kB)
Download all attachments