Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp303084ybh; Wed, 15 Jul 2020 02:19:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5W8kImHE1oZzyBIYNdiKqvOrwJteu0P/Px6RSN4VcvQAvQlwaai5WX/tP1g4Y3l11xH8/ X-Received: by 2002:a05:6402:134e:: with SMTP id y14mr8853639edw.4.1594804794363; Wed, 15 Jul 2020 02:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594804794; cv=none; d=google.com; s=arc-20160816; b=fzolTP9k64hrgR0+xrABbZ2j62kxskgZCtuGd5fYM7Tj+WbMvVgLbe2KepGeSGRCvG ZtYChx59SzaLHQFSR/ju46LHxBLJ5KaU8NMu2IR9KSo4V8lH34SOHRFcyWrhnpJnZlUK CHFFL4g1tDyf0JBxPrnZr8s2sYQ2KSrqtbwwLwjYTR42JWtSJovfkTnQ5gK8J3BSI0/1 nNV3Dw8Z5k9KnWHBSyKfBXRBpifGiU7Or4iJFL4JxHmjd0oTh19AnsVuRfQHG4CQtkoI DVJd9ndTzPH+qzzDT7qqtZnKs28+jygZ/VC2u5aqEy++gDKwmXC8YVoNr14CNAofdVf1 rpZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5DxZwygKRYCmXsE+0luVv+41zKfne+qnucRfjnGGZCU=; b=y3Kagg/y5I98TKUYUIzML/L2QltsoN4oc7K6x6dKYQL2+Nl+qt4RsSo2Ao48j/kz3i avtOTEJ7S0QFC+eNaWysA2o96xoFIqGA4H44IwltQ/LZCcBUFfcKeSzziWrWZcsn5/Na gcaS+9T6+F3DFDGEYCP7lj3iWYx3lutO2p/XFnAzZDgDYvmVFWZQYlXBNmyznKMA80h4 fAYBV9orML8qvQ6bnRR8xRXJJb5Pa3Mb1Jd6DECuS1/ZTRvUcE2XsgDw5nQeSCxHrDcu zWiT5bS0kDuVvjitYVrWQGUNFK+4qAOMnLm6FKzkPBYXm2fDCaFpTuAxD1KQZ0gGyhLk 5GRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fmzOBf4c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c12si898773edv.217.2020.07.15.02.19.30; Wed, 15 Jul 2020 02:19:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fmzOBf4c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728700AbgGOIyA (ORCPT + 99 others); Wed, 15 Jul 2020 04:54:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728145AbgGOIx7 (ORCPT ); Wed, 15 Jul 2020 04:53:59 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A65EFC08C5C1 for ; Wed, 15 Jul 2020 01:53:59 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id x8so2107848plm.10 for ; Wed, 15 Jul 2020 01:53:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5DxZwygKRYCmXsE+0luVv+41zKfne+qnucRfjnGGZCU=; b=fmzOBf4cL209uJFR5MPrTZjPmobtsyUFBanjNwk+XmE6SDJRoEsCgYSdo8vOXgIQbv Ldt0eRQ3vn2SiQIyQ1NbUXJjxOJLM3BWeL2gybf4GdJEJlyu/fxZXnpStsruGuF0juQ/ Glwkj0Z0jykjSkLrQYTBj3kZCVj15wRN7YL++YTph0IZMCGk72l7CUSmQtQyQs/tznjj riAqfhwmxlzldyTH/Kb/2t12HseNPZh/H7if1zYQwPKbq8xkv7BPVQAewEb+7gfjTa7Z GpuGfOpeGQcOn08uBQ4tWq3O2R6P6Iy+TSCekPHfgqhFfa5Vrwdhv3WieyhkxqevUeCY BsRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5DxZwygKRYCmXsE+0luVv+41zKfne+qnucRfjnGGZCU=; b=GTgoCHYiaLY0RphAs2vfSXhDxmmockvvTIavDDLBTGZhTCQ7Oc6Scu87Hz4Xb+pYl+ ny+wxQbwusDJEKGF0m53hL9UlBf3IimHvcsvwPnyrXklboiEl5QpnYlODs/2Gc6yYmzY XAirfTvE5l50as5IoyFxf8ErXIElFEck+BRiKJRuhhC0XfeuLhbjeK5xW5CiyFcK79KE p2hYJ/jVhHjh2dbgt7FWu+w8G0d7mF6UN/ulbkzMxNZt593Q+AmwBSHfsBhEGmAFufF7 VKetfiRIGfMhnXKHFTCRNQYmLVNwuUum55plVPp8FMax0WBBLMkBmpAw9BOd/7CcGfE5 92KA== X-Gm-Message-State: AOAM530BxfKcqcfFCCkLJc12nxs/hYzjiLMKsGMKVF6g3k7W7tK+h01F HawxvsS7rPfcjoIdvqbvAkZlI5olvXjkSd7ertO+Fg== X-Received: by 2002:a17:902:9305:: with SMTP id bc5mr7516096plb.21.1594803238887; Wed, 15 Jul 2020 01:53:58 -0700 (PDT) MIME-Version: 1.0 References: <20200521191800.136035-1-saravanak@google.com> <20200529123025.GA1710508@kroah.com> <20200710132305.GA1920995@kroah.com> In-Reply-To: From: Saravana Kannan Date: Wed, 15 Jul 2020 01:53:22 -0700 Message-ID: Subject: Re: [PATCH v3 0/3] driver core: Add device link related sysfs files To: Marek Szyprowski Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , LKML , John Stultz , Android Kernel Team , Linux Samsung SOC , Bartlomiej Zolnierkiewicz Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 15, 2020 at 1:22 AM Marek Szyprowski wrote: > > Hi Greg and Saravana, > > On 10.07.2020 15:23, Greg Kroah-Hartman wrote: > > On Mon, Jul 06, 2020 at 03:45:02PM -0700, Saravana Kannan wrote: > >> On Tue, Jun 16, 2020 at 8:45 PM Saravana Kannan wrote: > >>> On Fri, May 29, 2020 at 5:30 AM Greg Kroah-Hartman > >>> wrote: > >>>> Looks semi-sane, but it's too close to the merge window at the moment > >>>> for me to take this. If there's no objections by the time 5.8-rc1 is > >>>> out, I'll queue it up in my tree for 5.9-rc1. > >>> Another friendly reminder :) > >> *nudge* *nudge* > > Looks sane, given no objections, let's see what linux-next thinks about > > it... > > linux-next is not very happy from this patchset... Starting from > next-20200713 I see a few new issues on various Samsung Exynos based > boards. Here are examples from Exynos4412-based Odroid U3 board (ARM > 32bit, kernel compiled from exynos_defconfig): Thanks for the bug reports. > BUG: sleeping function called from invalid context at > kernel/locking/mutex.c:935 > in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 12, name: kworker/0:1 > 2 locks held by kworker/0:1/12: > #0: ee8074a8 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: > process_one_work+0x174/0x7dc > #1: ee921f20 ((work_completion)(&sdp->work)){+.+.}-{0:0}, at: > process_one_work+0x174/0x7dc > Preemption disabled at: > [] srcu_invoke_callbacks+0xc0/0x154 Sigh... probably some SRCU screw up when the device link is deleted. I'll look at it by the end of this week. If you don't mind, what SRCU debug config caught this for you? That way, I can reproduce it on my end. -Saravana > CPU: 0 PID: 12 Comm: kworker/0:1 Tainted: G W > 5.8.0-rc3-00022-g287905e68dd2 #8753 > Hardware name: Samsung Exynos (Flattened Device Tree) > Workqueue: rcu_gp srcu_invoke_callbacks > [] (unwind_backtrace) from [] (show_stack+0x10/0x14) > [] (show_stack) from [] (dump_stack+0xbc/0xe8) > [] (dump_stack) from [] (___might_sleep+0x288/0x2d8) > [] (___might_sleep) from [] (__mutex_lock+0x48/0xb18) > [] (__mutex_lock) from [] (mutex_lock_nested+0x1c/0x24) > [] (mutex_lock_nested) from [] (device_del+0x30/0x39c) > [] (device_del) from [] (device_unregister+0x24/0x64) > [] (device_unregister) from [] > (srcu_invoke_callbacks+0xcc/0x154) > [] (srcu_invoke_callbacks) from [] > (process_one_work+0x234/0x7dc) > [] (process_one_work) from [] (worker_thread+0x44/0x51c) > [] (worker_thread) from [] (kthread+0x158/0x1a0) > [] (kthread) from [] (ret_from_fork+0x14/0x20) > Exception stack(0xee921fb0 to 0xee921ff8) > > > BUG: scheduling while atomic: kworker/0:0/5/0x00000201 > 3 locks held by kworker/0:0/5: > #0: ee8074a8 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: > process_one_work+0x174/0x7dc > #1: ee907f20 ((work_completion)(&sdp->work)){+.+.}-{0:0}, at: > process_one_work+0x174/0x7dc > #2: c11367e4 (kernfs_mutex){+.+.}-{3:3}, at: > kernfs_remove_by_name_ns+0x24/0x94 > Modules linked in: > Preemption disabled at: > [] srcu_invoke_callbacks+0xc0/0x154 > CPU: 0 PID: 5 Comm: kworker/0:0 Tainted: G W > 5.8.0-rc3-00022-g287905e68dd2 #8753 > Hardware name: Samsung Exynos (Flattened Device Tree) > Workqueue: rcu_gp srcu_invoke_callbacks > [] (unwind_backtrace) from [] (show_stack+0x10/0x14) > [] (show_stack) from [] (dump_stack+0xbc/0xe8) > [] (dump_stack) from [] (__schedule_bug+0x88/0xe0) > [] (__schedule_bug) from [] (__schedule+0x5d0/0x83c) > [] (__schedule) from [] (schedule+0x64/0x124) > [] (schedule) from [] > (schedule_preempt_disabled+0x14/0x20) > [] (schedule_preempt_disabled) from [] > (__mutex_lock+0x518/0xb18) > [] (__mutex_lock) from [] (mutex_lock_nested+0x1c/0x24) > [] (mutex_lock_nested) from [] > (kernfs_remove_by_name_ns+0x24/0x94) > [] (kernfs_remove_by_name_ns) from [] > (device_remove_class_symlinks+0x70/0x94) > [] (device_remove_class_symlinks) from [] > (device_del+0xb8/0x39c) > [] (device_del) from [] (device_unregister+0x24/0x64) > [] (device_unregister) from [] > (srcu_invoke_callbacks+0xcc/0x154) > [] (srcu_invoke_callbacks) from [] > (process_one_work+0x234/0x7dc) > [] (process_one_work) from [] (worker_thread+0x44/0x51c) > [] (worker_thread) from [] (kthread+0x158/0x1a0) > [] (kthread) from [] (ret_from_fork+0x14/0x20) > Exception stack(0xee907fb0 to 0xee907ff8) > sysfs: cannot create duplicate filename > '/devices/virtual/devlink/regulator.28:cpu0' > > ------------[ cut here ]------------ > WARNING: CPU: 0 PID: 5 at kernel/sched/core.c:3897 > preempt_count_sub+0x104/0x108 > DEBUG_LOCKS_WARN_ON(val > preempt_count()) > Modules linked in: > CPU: 0 PID: 5 Comm: kworker/0:0 Tainted: G W > 5.8.0-rc3-00022-g287905e68dd2 #8753 > Hardware name: Samsung Exynos (Flattened Device Tree) > Workqueue: rcu_gp srcu_invoke_callbacks > [] (unwind_backtrace) from [] (show_stack+0x10/0x14) > [] (show_stack) from [] (dump_stack+0xbc/0xe8) > [] (dump_stack) from [] (__warn+0xf0/0x108) > [] (__warn) from [] (warn_slowpath_fmt+0x74/0xb8) > [] (warn_slowpath_fmt) from [] > (preempt_count_sub+0x104/0x108) > [] (preempt_count_sub) from [] > (__local_bh_enable_ip+0x74/0x16c) > [] (__local_bh_enable_ip) from [] > (srcu_invoke_callbacks+0xd8/0x154) > [] (srcu_invoke_callbacks) from [] > (process_one_work+0x234/0x7dc) > [] (process_one_work) from [] (worker_thread+0x44/0x51c) > [] (worker_thread) from [] (kthread+0x158/0x1a0) > [] (kthread) from [] (ret_from_fork+0x14/0x20) > Exception stack(0xee907fb0 to 0xee907ff8) > 7fa0: 00000000 00000000 00000000 > 00000000 > 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 > 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 > irq event stamp: 2274 > hardirqs last enabled at (2273): [] __slab_free+0x2b0/0x480 > hardirqs last disabled at (2274): [] > __local_bh_enable_ip+0x5c/0x16c > softirqs last enabled at (2184): [] __do_softirq+0x50c/0x608 > softirqs last disabled at (2056): [] > srcu_invoke_callbacks+0xb4/0x154 > ---[ end trace eaa99e7b5e453175 ]--- > > PU: 0 PID: 1 Comm: swapper/0 Tainted: G W > 5.8.0-rc3-00022-g287905e68dd2 #8753 > Hardware name: Samsung Exynos (Flattened Device Tree) > [] (unwind_backtrace) from [] (show_stack+0x10/0x14) > [] (show_stack) from [] (dump_stack+0xbc/0xe8) > [] (dump_stack) from [] (sysfs_warn_dup+0x58/0x64) > [] (sysfs_warn_dup) from [] > (sysfs_create_dir_ns+0xe0/0xf4) > [] (sysfs_create_dir_ns) from [] > (kobject_add_internal+0xb8/0x370) > [] (kobject_add_internal) from [] > (kobject_add+0x5c/0xbc) > [] (kobject_add) from [] (device_add+0x100/0x744) > [] (device_add) from [] (device_link_add+0x1f4/0x5d0) > [] (device_link_add) from [] (_regulator_get+0xf4/0x280) > [] (_regulator_get) from [] > (dev_pm_opp_set_regulators+0xf8/0x210) > [] (dev_pm_opp_set_regulators) from [] > (cpufreq_init+0xb8/0x304) > [] (cpufreq_init) from [] (cpufreq_online+0x2c8/0x9f8) > [] (cpufreq_online) from [] (cpufreq_add_dev+0x8c/0xc0) > [] (cpufreq_add_dev) from [] > (subsys_interface_register+0xa8/0xf4) > [] (subsys_interface_register) from [] > (cpufreq_register_driver+0x178/0x294) > [] (cpufreq_register_driver) from [] > (dt_cpufreq_probe+0xd8/0x1f4) > [] (dt_cpufreq_probe) from [] > (platform_drv_probe+0x6c/0xa4) > [] (platform_drv_probe) from [] > (really_probe+0x200/0x48c) > [] (really_probe) from [] > (driver_probe_device+0x78/0x1fc) > [] (driver_probe_device) from [] > (device_driver_attach+0x58/0x60) > [] (device_driver_attach) from [] > (__driver_attach+0xdc/0x174) > [] (__driver_attach) from [] > (bus_for_each_dev+0x68/0xb4) > [] (bus_for_each_dev) from [] > (bus_add_driver+0x158/0x214) > [] (bus_add_driver) from [] (driver_register+0x78/0x110) > [] (driver_register) from [] > (do_one_initcall+0x8c/0x424) > [] (do_one_initcall) from [] > (kernel_init_freeable+0x190/0x204) > [] (kernel_init_freeable) from [] > (kernel_init+0x8/0x118) > [] (kernel_init) from [] (ret_from_fork+0x14/0x20) > Exception stack(0xee8f1fb0 to 0xee8f1ff8) > ... > BUG: sleeping function called from invalid context at > kernel/locking/mutex.c:935 > in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 5, name: kworker/0:0 > INFO: lockdep is turned off. > Preemption disabled at: > [] srcu_invoke_callbacks+0xc0/0x154 > CPU: 0 PID: 5 Comm: kworker/0:0 Tainted: G W > 5.8.0-rc3-00022-g287905e68dd2 #8753 > Hardware name: Samsung Exynos (Flattened Device Tree) > Workqueue: rcu_gp srcu_invoke_callbacks > [] (unwind_backtrace) from [] (show_stack+0x10/0x14) > [] (show_stack) from [] (dump_stack+0xbc/0xe8) > [] (dump_stack) from [] (___might_sleep+0x288/0x2d8) > [] (___might_sleep) from [] (__mutex_lock+0x48/0xb18) > [] (__mutex_lock) from [] (mutex_lock_nested+0x1c/0x24) > [] (mutex_lock_nested) from [] (device_del+0x30/0x39c) > [] (device_del) from [] (device_unregister+0x24/0x64) > [] (device_unregister) from [] > (srcu_invoke_callbacks+0xcc/0x154) > [] (srcu_invoke_callbacks) from [] > (process_one_work+0x234/0x7dc) > [] (process_one_work) from [] (worker_thread+0x44/0x51c) > [] (worker_thread) from [] (kthread+0x158/0x1a0) > [] (kthread) from [] (ret_from_fork+0x14/0x20) > Exception stack(0xee907fb0 to 0xee907ff8) > ... > kobject_add_internal failed for regulator.28:cpu0 with -EEXIST, don't > try to register things with the same name in the same directory. > > Best regards > -- > Marek Szyprowski, PhD > Samsung R&D Institute Poland >