Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7870878imu; Thu, 15 Nov 2018 02:55:37 -0800 (PST) X-Google-Smtp-Source: AJdET5cpz2+HbpVHXsZ8faQhMMcBZ9ntghblKZQC6SAZLCpn+RsJG2xL/G1bS3inIPn74CpJvVUy X-Received: by 2002:a17:902:2cc1:: with SMTP id n59-v6mr5858498plb.26.1542279337513; Thu, 15 Nov 2018 02:55:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542279337; cv=none; d=google.com; s=arc-20160816; b=MhuuYUK7kMPiB1o/Pn1ZaNprEn386LkKIuv9HBOGaITNs9jZVgb8igYHo+lbt29LXk EMwyoTTrIII2UsoNCE3ZeMMNEWBjYtAVBUIfaZT+PJYz63JZO3dChVp0LllsnI5knEmU vy3M4yFycBQ5kCEu4+ODSsKPoMjuSdokswHnSBa0kcxhqnJgAtBcW+v30tY4oPW58WZw C0AhFih25+gsK8nQ6E2AAARhuFOAA4MGClefoL/BcGWXV7UAYfEH8+gqvs2C43+4F7Wv tSsFTf+X7zrGc1Qhn4FUtx7DiL7nhnqZFvZD1ZmYMaVJo+/kfGe7dVJ0AKMXh5PwOUbH VNSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Kdwkk+JTkwoXHDdx2SngHAYYQSmEf+5XoiDD0mwKm4s=; b=nf5LwYRtKOeuwjRCwASWCPkSucvL/YV9h3bukl7RCQTILiN65GPgikPgTSFBmCaD54 3BvxYOUhigamfspVwq+dvmO/E0ob+QvO9z779OMM0nR77O4HJRzuXNdD9FOzejDxcRh8 bJsax0NDsLuqoNVbgJkfZrI1XU2ne2kcQP64OWqgYgRuPenNvYF9p0GHqKwajcubeKo5 Bae05H8jEEFU1ML6IDeUJSJZqvZtmPmbsL+/5qy4oHrOoHelhwB/A0kFfhRfWoSjPMxL 73HnKeiGcdQk0BEQC/FkP5TUBBiwxEvKlHN6bAEGg8fh/K2wIF03DzyFNMN/2cm0hEhU Bw1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PvO+NqzX; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5-v6si28870605plg.99.2018.11.15.02.55.21; Thu, 15 Nov 2018 02:55:37 -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=@linaro.org header.s=google header.b=PvO+NqzX; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387706AbeKOVAs (ORCPT + 99 others); Thu, 15 Nov 2018 16:00:48 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38406 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729155AbeKOVAr (ORCPT ); Thu, 15 Nov 2018 16:00:47 -0500 Received: by mail-wr1-f66.google.com with SMTP id e3-v6so20713939wrs.5 for ; Thu, 15 Nov 2018 02:53:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Kdwkk+JTkwoXHDdx2SngHAYYQSmEf+5XoiDD0mwKm4s=; b=PvO+NqzXOPVFlAiX3vowkHW1DEg9nocq4YRC40D8UdKuM5sVRLE9hMAWnHW1rIwxoH rqFMzdVOs/+uo0IFDTMDS6EQTsQ7/n1iJiJefzxkHSbaxSHJt30uQ0cNPiFbrLd2tTnL pYfry0Fp5yagkWqzaevO279/aDvH8n5pjp0F4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Kdwkk+JTkwoXHDdx2SngHAYYQSmEf+5XoiDD0mwKm4s=; b=LbH4pqqb7LuDeR+xyn7GV0imlZEPYNN2aqWTeNyqzN4FBbZ2HKmNCqKf0mmIG1l/ze O6Y6ULWxaLVe+KPcSXTnGVf1YFmLC1zFmJgt9r81W5sm1EZkwcX2sPlk04XRJ703pyJW wx3m7QBmk3kE/Z40nAO9/yHNYowySrfGt2BrXQSFmWtfAH+3V9qSXQAKlvUlofolLLQh oZleicD6eslzTS4L9oNs9bTQBYO10sUGrCGPT0NQimYF645pOew2xl6fN/IeLHsZXF+m nHPX364AhC0F9bdDahGk6/jPd7TCCo5ojN1dKMZdbQJLIP63d2lZ3yjQ6zbJf+dcNJVq fuVA== X-Gm-Message-State: AGRZ1gJOEBEiWh89DJHetytZ08SEwfKkB8NnY4ErzmJTV10+gaelLX9d QSqHYlraQOODzsXzoLdnsbR4eg== X-Received: by 2002:adf:f20a:: with SMTP id p10-v6mr5294508wro.293.1542279206016; Thu, 15 Nov 2018 02:53:26 -0800 (PST) Received: from [192.168.0.19] (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.googlemail.com with ESMTPSA id z3-v6sm15113093wma.6.2018.11.15.02.53.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Nov 2018 02:53:25 -0800 (PST) Subject: Re: Crash in msm serial on dragonboard with ftrace bootargs To: Sai Prakash Ranjan , Steven Rostedt , Stephen Boyd Cc: Joel Fernandes , Bjorn Andersson , Andy Gross , David Brown , Jiri Slaby , Kees Cook , Geliang Tang , Greg Kroah-Hartman , Pramod Gurav , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Rajendra Nayak , Vivek Gautam , Sibi Sankar References: <472db11e-49a6-a1ee-e298-791ee1bbb10b@codeaurora.org> <20181016141610.639b9000@gandalf.local.home> <20181016144123.24c47b38@gandalf.local.home> <7781815e-cba2-9e36-db6d-268298747876@codeaurora.org> <20181016150328.3450d718@gandalf.local.home> <20181017223334.29ca2837@vmware.local.home> <58d2474c-53cd-e6cb-2d25-db38d1a88da6@codeaurora.org> <20181018091706.62310b38@gandalf.local.home> <20181019041740.GB141835@joelaf.mtv.corp.google.com> <8a75f2d5-f1bd-504e-b545-ae2e2f61ca8f@codeaurora.org> <20181019095122.0f1c0946@gandalf.local.home> <9cafe321-87f6-98a3-3bda-c2f7a3d7fc67@codeaurora.org> <20181019111205.5c8e98e8@gandalf.local.home> <1e6cc1fa5263b9edfcf7567d3f9f65fd@codeaurora.org> <38099043-f5ed-6d81-bf94-13f61cfa8507@linaro.org> <8f65f83b-8cd9-5e35-c324-30b86390906e@codeaurora.org> From: Srinivas Kandagatla Message-ID: Date: Thu, 15 Nov 2018 10:53:24 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <8f65f83b-8cd9-5e35-c324-30b86390906e@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/11/18 10:33, Sai Prakash Ranjan wrote: > On 11/13/2018 3:14 PM, Srinivas Kandagatla wrote: >> Hi Sai, >> >> >> >> On 25/10/18 15:36, saiprakash.ranjan@codeaurora.org wrote: >>> "If I disable dma node and LS-UART0, then I don't see any crash and >>> ftrace also works fine" >>> >>> And one more observation is that even without ftrace cmdline, if I use >>> earlycon and disable dma, I face the same crash. >>> >>> So basically this seems to be some kind of earlycon and dma issue and >>> not ftrace(I can be wrong). >>> >>> So adding Srinivas for more info on this dma node. >> >> Its Interesting that my old email conversations with SBoyd show that I >> have investigated this issue in early 2016! >> >> My analysis so far: >> >> This reason for such behavior is due the common iface clock >> (GCC_BLSP1_AHB_CLK) across multiple drivers(serial ports, bam dma >> and other low speed devices). >> The code flow in DB410C is bit different, as the uart0 is first >> attempted to set as console and then uart1, this ordering triggers >> pm state change uart_change_pm(state, UART_PM_STATE_OFF) from serial >> core while setting up uart0, this would go and disable all the >> clocks for uart0. >> As uart1 is not setup Yet, and earlycon is still active, any >> attempts by earlycon to write to registers would trigger a system >> reboot as the clock was just disabled by uart0 change_pm code. >> >> This can even be triggered with any drivers like spi which uses same >> clock I guess. >> >> Hope it helps, >> >> Either earlycon needs to reference the clocks or those clocks needs to >> be marked always-on (but only with earlycon). >> >>> >>> Also just for a note: apq8096-db820c.dtsi shows UART0 is disabled >>> because >>> bootloader does not allow access to it. Could this also be the case >>> for db410c? >> No, this is not the case with DB410c. DB820c has added restrictions in >> TZ, I think new booloaders should have solved this issue. >> >> > > Hi Srinivas, > > Thanks a lot for pointing out the cause of crash. > I just tried setting GCC_BLSP1_AHB_CLK with flag CLK_IS_CRITICAL and the > crash disappears. > > But I suppose setting CLK_IS_CRITICAL is not the solution? > Yes, this is not the solution, but it proves that the hand-off between booloaders and kernel is the issue. In general there is wider issue with resources hand-off between bootloader and kernel. There has been some proposal in the past by Viresh for a new framework called boot-constriants (https://lkml.org/lkml/2017/12/14/440) which am not sure if its still actively looked at. But something similar should be the way to address such issues. --srini > Thanks, > Sai