Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp224839imj; Wed, 13 Feb 2019 07:20:14 -0800 (PST) X-Google-Smtp-Source: AHgI3IbqIxqKcTwctqUD/ZUJpyc7lp12lJ1R512jtZln0PqAZIW9XngEWnyKbqIkfK4+VMHU5khd X-Received: by 2002:a62:4c5:: with SMTP id 188mr1033228pfe.130.1550071214212; Wed, 13 Feb 2019 07:20:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550071214; cv=none; d=google.com; s=arc-20160816; b=zVf9zva1gH07QZ27I7/slS2I/Kn8kUgl2fimo0+nGJCvnD/KTLQIvRSRUbzqul7+TF H99GpZcgbfgNBIOnp4o62QeZj13DZmIR8Xx20waACtdLpGaa9G52XT4qLNsRKpN8i2wm GAkEF9ldZszgUixd5SBo4AqSY6qwFqlBjj3M1MaYQYmzU+Pn5C1DndgPyOZ/zMA/inym joWB88KUQMhRp0yq0pyLALJiojU5fHtGxy2YO+5jrraumbmASHneJhZS/JWXkmQnkmqc lgALwLOcIm30spdGjuTqelcG00JE+yE30+ocuT7qxcFycrYGJRbOVLpJ9q+MO8vzW5Wr UXqA== 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=A83HwLkscd+n/ThJxRWxJ32yY+Lg5D0jBF/2KpDB3qY=; b=SoV+Zdtb1fWgnBsZspmmrgt1FRDTBZ6yDfUIvziJYgFLXtI89ubConTivZqRwk5mYA H3J4LEnI/fKwt3Tvm7IUiqiHSpp5orAkRhsGKEJOL8i8+mlJAi10a7AxiCnY/zXzHilj PXScNyb/Sfgp3bDmaCIHXGdH8KqqqwNVMWNN/FMmnjk+P/tE/z4oZ434wrH68cznkawn gY89olwCbbJTKLMSQWoGxXdEFXpBjToFyTLngQAFPg6mqFfwMpvJSTnJ41Ql4hr7s9hn PpzDzwWRjzq7uyY+6gR5veGdDUlhX6pg8oJ/Vhqre+0UyxGWpzc0O3TUG9ihii9Z89UJ 3NrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="r/PaWOEg"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h186si776068pfb.73.2019.02.13.07.19.57; Wed, 13 Feb 2019 07:20:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="r/PaWOEg"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392382AbfBMOlI (ORCPT + 99 others); Wed, 13 Feb 2019 09:41:08 -0500 Received: from mail-ua1-f65.google.com ([209.85.222.65]:42559 "EHLO mail-ua1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390248AbfBMOlH (ORCPT ); Wed, 13 Feb 2019 09:41:07 -0500 Received: by mail-ua1-f65.google.com with SMTP id d21so838426uap.9; Wed, 13 Feb 2019 06:41:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=A83HwLkscd+n/ThJxRWxJ32yY+Lg5D0jBF/2KpDB3qY=; b=r/PaWOEgaZqRchY5b+f2Aqpg3NUrIWco/uoRwXLcLhwB8B5qxyiDnFz9uo/U11TGio DLiYX102zjFQJuOVt+VmeaDlP9sWXmdSM0sr4W8/95cKua5UW4jLkzRmx0GNOJh3cXHp Smkp6lUiv/O9736wsh1aY7pkMqcaJlNMKV5puOBAk0lQUBjCbKz5NS5TwmBxg8kA5+SW ecmblUU10D37/LSTNzre+sDf3PpicU9xKYrlfz3vDLgu7Rx6bpBhPGlCgg7WFntkxPcn ZENXkhbUqyCnPm24fUhWVa3nqsxNXr8tPIES5eAJIhnAdyN9ioZcYclnNgOKi+RX2+PD qqyg== 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=A83HwLkscd+n/ThJxRWxJ32yY+Lg5D0jBF/2KpDB3qY=; b=D6pJ99STplA2qgzrDKkPPe9e7C5Y902a5vWwI9h8Wtjs5sbSIGa9fwOVWeP4pSE5tB NV1BisKRDWMgwOdC2CAEhkqfrgbHRYAVVHoTeE0YJeRe9Xqj4grmchTJOKifT/SFdstO Y+vRH7M14pNWdrZ+yq3yEWce6t/Y/PgLI2mJ658rc/YgCWwFpNQBq85WuPOAGOfqnau0 12Kd7kYoVcbjpI1nrb7I5Q5zTNmP28gPTwDiEo4jwPgJdnOd7l0ZIloRX/22mf408/vK i9UAVGXz8g3sChxAZlOCA7fvI/9L+4zxjo7bkCBZIsuayjhotRofzBpqvux+sP1is85O 1nVA== X-Gm-Message-State: AHQUAubFAsc5WUSrwN9oYZ2RKIF9oRHbOF11QhSvsVETel3iaofyAElm ZZNU2Km80F3lc02il7ReOtUqwM3Yfd03rnbrJ+o= X-Received: by 2002:ab0:5a71:: with SMTP id m46mr316889uad.123.1550068866332; Wed, 13 Feb 2019 06:41:06 -0800 (PST) MIME-Version: 1.0 References: <6183c865-2e90-5fb9-9e10-1339ae491b71@codeaurora.org> In-Reply-To: <6183c865-2e90-5fb9-9e10-1339ae491b71@codeaurora.org> From: Pintu Agarwal Date: Wed, 13 Feb 2019 20:10:55 +0530 Message-ID: Subject: Re: BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:65 To: Sai Prakash Ranjan Cc: open list , linux-arm-kernel@lists.infradead.org, linux-rt-users@vger.kernel.org, linux-mm@kvack.org, Jorge Ramirez , "Xenomai@xenomai.org" 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, Feb 13, 2019 at 3:21 PM Sai Prakash Ranjan wrote: > > Hi Pintu, > > On 2/13/2019 2:04 PM, Pintu Agarwal wrote: > > > > This is the complete logs at the time of crash: > > > > [ 21.681020] VFS: Mounted root (ext4 filesystem) readonly on device 8:6. > > [ 21.690441] devtmpfs: mounted > > [ 21.702517] Freeing unused kernel memory: 6528K > > [ 21.766665] BUG: sleeping function called from invalid context at > > kernel/locking/rwsem.c:65 > > [ 21.775108] in_atomic(): 0, irqs_disabled(): 128, pid: 1, name: init > > [ 21.781532] ------------[ cut here ]------------ > > [ 21.786209] kernel BUG at kernel/sched/core.c:8490! > > [ 21.791157] ------------[ cut here ]------------ > > [ 21.795831] kernel BUG at kernel/sched/core.c:8490! > > [ 21.800763] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP > > [ 21.806319] Modules linked in: > > [ 21.809474] CPU: 0 PID: 1 Comm: init Not tainted 4.9.103+ #115 > > [ 21.815375] Hardware name: Qualcomm Technologies, Inc. MSM XXXX > > [ 21.822584] task: ffffffe330440080 task.stack: ffffffe330448000 > > [ 21.828584] PC is at ___might_sleep+0x140/0x188 > > [ 21.833175] LR is at ___might_sleep+0x128/0x188 > > [ 21.837759] pc : [] lr : [] > > pstate: 604001c5 > > > > > 0000000000000000 ffffffe33044b8d0 > > [ 22.135279] bac0: 0000000000000462 0000000000000006 > > [ 22.140224] [] ___might_sleep+0x140/0x188 > > [ 22.145862] [] __might_sleep+0x58/0x90 > > [ 22.151249] [] down_write_killable+0x2c/0x80 > > [ 22.157155] [] setup_arg_pages+0xb8/0x208 > > [ 22.162792] [] load_elf_binary+0x434/0x1298 > > [ 22.168600] [] search_binary_handler+0xac/0x1f0 > > [ 22.174763] [] do_execveat_common.isra.15+0x504/0x6c8 > > [ 22.181452] [] do_execve+0x44/0x58 > > [ 22.186481] [] run_init_process+0x38/0x48 > > [ 22.192122] [] kernel_init+0x8c/0x108 > > [ 22.197411] [] ret_from_fork+0x10/0x50 > > [ 22.202790] Code: b9453800 0b000020 6b00027f 540000c1 (d4210000) > > [ 22.208965] ---[ end trace d775a851176a61ec ]--- > > [ 22.220051] Kernel panic - not syncing: Attempted to kill init! > > exitcode=0x0000000b > > > > This might be the work of CONFIG_PANIC_ON_SCHED_BUG which is extra debug > option enabled in *sdm845_defconfig*. You can disable it or better > I would suggest to use *sdm845-perf_defconfig* instead of > sdm845_defconfig since there are a lot of debug options enabled > in the latter which may be not compatible when IPIPE patches > are applied. OK thanks for your suggestions. sdm845-perf_defconfig did not work for me. The target did not boot. However, disabling CONFIG_PANIC_ON_SCHED_BUG works, and I got a root shell at least. This at least proves that there is no issue in core ipipe patches, and I can proceed. But this seems to be a work around. I still get a back trace in kernel logs from many different places. So, it looks like there is some code in qualcomm specific drivers that is calling a sleeping method from invalid context. How to find that... If this fix is already available in latest version, please let me know. Thanks, Pintu