Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1417278yba; Thu, 16 May 2019 21:41:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLJ9RZqJlBpkV6z+4Lsd42LvBlSpTP0+3YF15ZrCgChaGiDKfqOvyq+OVnraPwz5WbuYLA X-Received: by 2002:a17:902:848c:: with SMTP id c12mr5220887plo.17.1558068062792; Thu, 16 May 2019 21:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558068062; cv=none; d=google.com; s=arc-20160816; b=WP1mkEdioS+phGtWV2oS5AGTIlVtnFQRUnPwJIiDsy9SKczoQI4xaHGJ6zA/1BKsSn WEzokV87/YWcCa1O9E+ashD+gINTAN43i4i2q+9AhyGRGpGOVHY1YdTIU+FdL2uzQFth D4+s9emeLD617mo3FlMCffV4vXPb2hORFBo5iPCAeVPBgpHqHz2jJscyBJh38omhdkGf uglsewyfqRS3C/m790rr6Rt6Ori0tdrKMPu97RuXYXCVO6xgF4Rev7KmPfOmE5IXb98z Y38E7ZMdaViriFGrUv68LRLneTWGSVUN0V+olz+xTBy5hcOgtMEQH+NnETYUfpU+fJsy K+ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=eXV0y9i39nFruWxoV3bIIDblUf72IPNAFuXDdGB7nRc=; b=KTU7+xZ6F8WTzWswHQYDXo852Vmc8KeuyKtgimKbQSpcdLzCqNJ5ZOjjQI2IkGtMLk 3r+ZSEydL0CKidLrJfp/3mFcY6AwkDR/4UVdT3gli3Lx62FG5jwzuPOuiRbakg5R6PzW vq6G0y7UBp+rfWxKk8vzJ5lJWQ7gUpgL0ql5bj2eJnfiADqAl9wA7OiC08HRYnFzTO/k 4CUq185wGLa6RnXY3kI6MDudqPMCKwbrBJRZU+ZJbfN4Hqb1qym06pRiRUKE9a81QBen RUNeyY+iBzjgXUwqyBsLgjVPCzU3+NQgdFWWM2jflJ+RPiPi7K0MEhmo2ptwo3JzAtBY mOSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wG4lQWED; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x15si6718417pln.135.2019.05.16.21.40.47; Thu, 16 May 2019 21:41:02 -0700 (PDT) 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=@kernel.org header.s=default header.b=wG4lQWED; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727530AbfEQCo3 (ORCPT + 99 others); Thu, 16 May 2019 22:44:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:51264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbfEQCo3 (ORCPT ); Thu, 16 May 2019 22:44:29 -0400 Received: from dragon (98.142.130.235.16clouds.com [98.142.130.235]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3B1C920848; Fri, 17 May 2019 02:44:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558061068; bh=wa9myGyRMaYahr2088guoMQ/oF7+8i++qNk0d4F0tOo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wG4lQWEDTA9JTF64I55cyQIiVuwwwcPmjKEcd9mAw+uX/IMhb2sOaF72YFr/xBAZ1 804NBQW3XXJw8NoMkFhQKGugNy3b2L1c2rnF5aGPP7DIRbYJVb+uPcqrhiaomlPxDr oyi3W6QfxHX+0ThT+2cj+5yyoq7CkIJaivdo53Lw= Date: Fri, 17 May 2019 10:43:49 +0800 From: Shawn Guo To: Anson Huang Cc: "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , Aisheng Dong , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx Subject: Re: [PATCH RESEND] firmware: imx: SCU irq should ONLY be enabled after SCU IPC is ready Message-ID: <20190517024347.GC15856@dragon> References: <1557650002-10565-1-git-send-email-Anson.Huang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1557650002-10565-1-git-send-email-Anson.Huang@nxp.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 12, 2019 at 08:38:22AM +0000, Anson Huang wrote: > The imx_scu_irq_group_enable() is normally called during module driver > probe phase to enable SCU group irq, if SCU IPC is NOT ready, below > dump will show out: > > [ 0.933001] Hardware name: Freescale i.MX8QXP MEK (DT) > [ 0.938129] pstate: 60000005 (nZCv daif -PAN -UAO) > [ 0.942907] pc : imx_scu_call_rpc+0x114/0x158 > [ 0.947251] lr : imx_scu_irq_group_enable+0x74/0xc4 > [ 0.952113] sp : ffff00001005bae0 > [ 0.955415] x29: ffff00001005bae0 x28: ffff0000111bb0a0 > [ 0.960712] x27: ffff00001140b000 x26: ffff00001111068c > [ 0.966011] x25: ffff0000111bb100 x24: 0000000000000000 > [ 0.971311] x23: ffff0000113d9cd8 x22: 0000000000000001 > [ 0.976610] x21: 0000000000000001 x20: ffff80083b51a410 > [ 0.981909] x19: ffff000011259000 x18: 0000000000000480 > [ 0.987209] x17: 000000000023ffb8 x16: 0000000000000010 > [ 0.992508] x15: 000000000000023f x14: ffffffffffffffff > [ 0.997807] x13: 0000000000000018 x12: 0000000000000030 > [ 1.003107] x11: 0000000000000003 x10: 0101010101010101 > [ 1.008406] x9 : ffffffffffffffff x8 : 7f7f7f7f7f7f7f7f > [ 1.013706] x7 : fefefeff646c606d x6 : 0000000000000000 > [ 1.019005] x5 : ffff0000112596c8 x4 : 0000000000000008 > [ 1.024304] x3 : 0000000000000003 x2 : 0000000000000001 > [ 1.029604] x1 : ffff00001005bb58 x0 : 0000000000000000 > [ 1.034905] Call trace: > [ 1.037341] imx_scu_call_rpc+0x114/0x158 > [ 1.041334] imx_scu_irq_group_enable+0x74/0xc4 > [ 1.045856] imx_sc_wdt_probe+0x24/0x150 > [ 1.049766] platform_drv_probe+0x4c/0xb0 > [ 1.053762] really_probe+0x1f8/0x2c8 > [ 1.057407] driver_probe_device+0x58/0xfc > [ 1.061490] device_driver_attach+0x68/0x70 > [ 1.065660] __driver_attach+0x94/0xdc > [ 1.069397] bus_for_each_dev+0x64/0xc0 > [ 1.073220] driver_attach+0x20/0x28 > [ 1.076782] bus_add_driver+0x148/0x1fc > [ 1.080601] driver_register+0x68/0x120 > [ 1.084424] __platform_driver_register+0x4c/0x54 > [ 1.089120] imx_sc_wdt_driver_init+0x18/0x20 > [ 1.093463] do_one_initcall+0x58/0x1b8 > [ 1.097287] kernel_init_freeable+0x1cc/0x288 > [ 1.101630] kernel_init+0x10/0x100 > [ 1.105101] ret_from_fork+0x10/0x18 > [ 1.108669] ---[ end trace 9e03302114457de9 ]--- > [ 1.113296] enable irq failed, group 1, mask 1, ret -22 > > To avoid such scenario, return -EPROBE_DEFER in imx_scu_irq_group_enable() > API if SCU IPC is NOT ready, then module driver which calls this API > in probe phase will defer probe after SCU IPC ready. > > Fixes: 851826c7566e ("firmware: imx: enable imx scu general irq function") > Signed-off-by: Anson Huang Applied, thanks.