Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Wunused-const-variable in drivers/usb/host/xhci-tegra.c #533

Closed
nhukc opened this issue Jun 12, 2019 · 3 comments
Closed

-Wunused-const-variable in drivers/usb/host/xhci-tegra.c #533

nhukc opened this issue Jun 12, 2019 · 3 comments
Assignees
Labels
-Wunused-const-variable [ARCH] arm64 This bug impacts ARCH=arm64 [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 5.3 This bug was fixed in Linux 5.3

Comments

@nhukc
Copy link

nhukc commented Jun 12, 2019

drivers/usb/host/xhci-tegra.c:357:27: warning: unused variable 'mbox_cmd_name' [-Wunused-const-variable]
static const char * const mbox_cmd_name[] = {
                          ^

Each entry of the array holds a string value that matches with command request enums. I would guess that this was intended for logging and was never implemented.

@nhukc nhukc added [BUG] linux A bug that should be fixed in the mainline kernel. [ARCH] arm64 This bug impacts ARCH=arm64 low priority This bug is not critical and not a priority -Wunused-const-variable labels Jun 12, 2019
@nhukc nhukc self-assigned this Jun 12, 2019
@nhukc
Copy link
Author

nhukc commented Jun 13, 2019

Reached out to author+maintainers: https://groups.google.com/forum/#!topic/clang-built-linux/Jh6Y6k0bR_Q

@nhukc
Copy link
Author

nhukc commented Jun 13, 2019

@nhukc nhukc added the [PATCH] Submitted A patch has been submitted for review label Jun 13, 2019
fengguang pushed a commit to 0day-ci/linux that referenced this issue Jun 14, 2019
Clang produces the following warning

drivers/usb/host/xhci-tegra.c:357:27: warning: unused variable
'mbox_cmd_name' [-Wunused-const-variable]
static const char * const mbox_cmd_name[] = {

Looks like it was intended for logging or debugging, but was
never implemented. Removing mbox_cmd_name.

Cc: clang-built-linux@googlegroups.com
Link: ClangBuiltLinux#533
Signed-off-by: Nathan Huckleberry <nhuck@google.com>
fengguang pushed a commit to 0day-ci/linux that referenced this issue Jun 18, 2019
Clang produces the following warning

drivers/usb/host/xhci-tegra.c:357:27: warning: unused variable
'mbox_cmd_name' [-Wunused-const-variable]
static const char * const mbox_cmd_name[] = {

Looks like it was intended for logging or debugging, but was
never implemented. Removing mbox_cmd_name.

Cc: clang-built-linux@googlegroups.com
Link: ClangBuiltLinux#533
Signed-off-by: Nathan Huckleberry <nhuck@google.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
@nhukc nhukc added [PATCH] Accepted A submitted patch has been accepted upstream and removed [PATCH] Submitted A patch has been submitted for review labels Jun 18, 2019
@nickdesaulniers nickdesaulniers added [FIXED][LINUX] 5.3 This bug was fixed in Linux 5.3 and removed [PATCH] Accepted A submitted patch has been accepted upstream labels Jul 21, 2019
@tpimh tpimh removed the low priority This bug is not critical and not a priority label Sep 28, 2019
nathanchance pushed a commit that referenced this issue Sep 11, 2020
Allocating memory with regulator_list_mutex held makes lockdep unhappy
when memory pressure makes the system do fs_reclaim on eg. eMMC using
a regulator. Push the lock inside regulator_init_coupling() after the
allocation.

======================================================
WARNING: possible circular locking dependency detected
5.7.13+ #533 Not tainted
------------------------------------------------------
kswapd0/383 is trying to acquire lock:
cca78ca4 (&sbi->write_io[i][j].io_rwsem){++++}-{3:3}, at: __submit_merged_write_cond+0x104/0x154
but task is already holding lock:
c0e38518 (fs_reclaim){+.+.}-{0:0}, at: __fs_reclaim_acquire+0x0/0x50
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (fs_reclaim){+.+.}-{0:0}:
       fs_reclaim_acquire.part.11+0x40/0x50
       fs_reclaim_acquire+0x24/0x28
       __kmalloc+0x54/0x218
       regulator_register+0x860/0x1584
       dummy_regulator_probe+0x60/0xa8
[...]
other info that might help us debug this:

Chain exists of:
  &sbi->write_io[i][j].io_rwsem --> regulator_list_mutex --> fs_reclaim

Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(fs_reclaim);
                               lock(regulator_list_mutex);
                               lock(fs_reclaim);
  lock(&sbi->write_io[i][j].io_rwsem);
 *** DEADLOCK ***

1 lock held by kswapd0/383:
 #0: c0e38518 (fs_reclaim){+.+.}-{0:0}, at: __fs_reclaim_acquire+0x0/0x50
[...]

Fixes: d8ca7d1 ("regulator: core: Introduce API for regulators coupling customization")
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/1a889cf7f61c6429c9e6b34ddcdde99be77a26b6.1597195321.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Mark Brown <broonie@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Wunused-const-variable [ARCH] arm64 This bug impacts ARCH=arm64 [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 5.3 This bug was fixed in Linux 5.3
Projects
None yet
Development

No branches or pull requests

3 participants