Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1621111imj; Thu, 14 Feb 2019 09:16:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IYx3aCjA50zxKkl6NRi9LS53TLNn87YU8nyr+HfRLCvwG4UQQQRNvDgBL5BiwlSZxmd6mnJ X-Received: by 2002:a17:902:6949:: with SMTP id k9mr5276454plt.85.1550164605237; Thu, 14 Feb 2019 09:16:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550164605; cv=none; d=google.com; s=arc-20160816; b=h36XH3rrFxozTcf/Jt95ABLcBCegnnGdSnmPyMINsgQIcNM3C6Lmh39Fh35fiARCEx h6z9WPQtxWVUWKcWTpwvhTl9VZExgOpvmJBVRVN4EutgHrIFotqg/o7ct/lqLZcQJdsI vyDjVsi2yRnQBSeMdfzZXUNBJ4k4jtynAPQMf6RnF7UPUJ7rZo0cFqURKIW7nc6WxWcq WwhvFdUWTXHQtFDRskhzM0M8Au7BkI9bEn6OPRgJRjrb0m7yPfRS03+6C95JjFeSG11Y 26ppCVQo7bJ1Z6pmLzWVNlkln86AAv3dKElLJJj9A56CCCXeqg0t0JeJ/m6EiWhFx7qW 3n+w== 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=eFBWiFIaqtau2CVEYcyX/n7Z0Eb/ey9J9D6DfDHhgzs=; b=0F5f5qM18Qdlo08AGsn8xs5702Kz+JnIdgOhu7FttV1PiHZRSjzRZUgtpAdhkcgbvN BMwgHl9xFuJJJ1Bd2jaGipxfABIYooMZ+eGJzHdrrPJzTwnBSG98wXl20vPAsID76OLS 9FjE/LTCZJqQ8ze9X6yCCa61p9OuLIJZsSz8HumddrLSH85TKu1NnuntbN+cVJSwH9UD auW1zXnPfgB+pJUc6JJuuDEvSr1zkIf3Lbh4wW1tuvU4mdxuwFZfUCrQChhcQg8Wmlqd RDycf+75iUS565J58sTB2MUOZtfGc4TJH7BTiQR8Uw2njSbzF9GzGvZCUZ3w9YkI4dnh tHXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lXo5CZBL; 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 a8si2803130pgi.359.2019.02.14.09.16.28; Thu, 14 Feb 2019 09:16:45 -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=lXo5CZBL; 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 S2395015AbfBNJLk (ORCPT + 99 others); Thu, 14 Feb 2019 04:11:40 -0500 Received: from mail-vs1-f66.google.com ([209.85.217.66]:40065 "EHLO mail-vs1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387453AbfBNJLk (ORCPT ); Thu, 14 Feb 2019 04:11:40 -0500 Received: by mail-vs1-f66.google.com with SMTP id z18so3200483vso.7; Thu, 14 Feb 2019 01:11:39 -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=eFBWiFIaqtau2CVEYcyX/n7Z0Eb/ey9J9D6DfDHhgzs=; b=lXo5CZBLyz09qu2yMefNbmTEv9ODDQ63Nr7/pO7A4Tfecbc8tRWL0VO+sjk1MMVIGV Pds4mYWbdz5Z3vXKWVHOasiXWH5oTdLG1Yacn+Vt89SaidIlI+NVDGiUVAOrMYA4t79W XwLkB4KhGd3mHKZcJf6J7zN9Zma8ycIZPSSD9X6M4yz4zQf2QrqzUYKU7Wzt7VZU49zz xvC6XXilhC1UZM4c4WhkZoTLMVgs9nHPw+krMkylz/E/e0/lII6yEm1mU0PV4fN6awyJ m+d43bDfjZtclBp7d2MIZiuaYj/ygrn+8umOK/6hviZ3uZsSkxINGXloPRjHIwl/fU+w gT5w== 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=eFBWiFIaqtau2CVEYcyX/n7Z0Eb/ey9J9D6DfDHhgzs=; b=qY9YGvjJ8aK4ZuP+AluLMutooMoK7ATHUsdtDs36xGveG7qEs7FvsLJH4ZmpSdx+3C Yz191XeFjNBNZu57LPiYFAV4Huf5u1NwlXThWKetyzKK8Fp0ENNPNPVlpqtC+o3alGc9 waXEBZyxz6vV0dpS1vzPLpZFdSlcj9OwahC+cLqfgB2j+3cgEqw2uIEvg+lTTcX668Fr ev0Tki6gjjc/DHSNnmpYPtMf+MjJb+7d4/lQkZK5Y7no9zQwoKV35/ugKzNJfEweg4VM fU6eOHieUPhhVPD+Z7Yz0/NTK+WO/G29Cq30oU2mCQUDa1oXguuET3MqZF+hemVeJFZp 7Q/w== X-Gm-Message-State: AHQUAua9g4/PT8iyMCPb4VnDit57ROmOvjgbcs4G4BJhfClFb05qzCBf HxmAkEh0TAoSoca08o/8FQcev800sqdow/2xqoCwlQ== X-Received: by 2002:a67:edca:: with SMTP id e10mr1418794vsp.196.1550135498946; Thu, 14 Feb 2019 01:11:38 -0800 (PST) MIME-Version: 1.0 References: <6183c865-2e90-5fb9-9e10-1339ae491b71@codeaurora.org> <2c91af7d-4580-cedc-70ea-d38c2587c7bf@codeaurora.org> In-Reply-To: <2c91af7d-4580-cedc-70ea-d38c2587c7bf@codeaurora.org> From: Pintu Agarwal Date: Thu, 14 Feb 2019 14:41:27 +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 Hello Sai, Thanks so much for your help. On Thu, Feb 14, 2019 at 12:14 AM Sai Prakash Ranjan wrote: > > Hi, > > On 2/13/2019 8:10 PM, Pintu Agarwal wrote: > > OK thanks for your suggestions. sdm845-perf_defconfig did not work for > > me. The target did not boot. > > Perf defconfig works fine. You need to enable serial console with below > config added to perf defconfig. > > CONFIG_SERIAL_MSM_GENI_CONSOLE=y > Actually for me the kernel does not boot. It stuck in bootloader, with "valid dtb not found". I did not debug it further. Anyways, we can look into this issue later. > > However, disabling CONFIG_PANIC_ON_SCHED_BUG works, and I got a root > > shell at least. > > > > > 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. > > > > Seems like interrupts are disabled when down_write_killable() is called. > It's not the drivers that is calling the sleeping method which can be > seen from the log. > > [ 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 > Yes, these are generic API, and I don't expect any changes in here. We don't have this issue in another SOC 4.9 kernel. Also I compared these APIs with mainline and there is no major changes here. This is just one example. This sleep issue is happening from other places as well. May be one common similarity may be: during task loading, or switching. > > > > This at least proves that there is no issue in core ipipe patches, and > > I can proceed. > > I doubt the *IPIPE patches*. You said you removed the configs, but all > code are not under IPIPE configs and as I see there are lots of > changes to interrupt code in general with ipipe. > We observed that this issue is happening in normal sdm845 kernel as well (without ipipe/xenomai patches applied in another branch). Another point is, we don't see this issue in another arm64 target such as hikey, with same 4.9 kernel. > So to actually confirm whether the issue is with qcom drivers or ipipe, > please *remove ipipe patches (not just configs)* and boot. > Also paste the full dmesg logs for these 2 cases(with and without > ipipe). > hmmm. This will be little tough. I will try to find sometime to point the exact cause, and share findings here. Currently, I am debugging another issue. Thanks for your help. Regards