Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8BDF5EE57C7 for ; Fri, 8 Sep 2023 05:32:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A67FC86501; Fri, 8 Sep 2023 07:32:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="htikYqN+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F0E96869A3; Fri, 8 Sep 2023 07:32:53 +0200 (CEST) Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 137D886996 for ; Fri, 8 Sep 2023 07:32:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=n-francis@ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3885Wmq4001936; Fri, 8 Sep 2023 00:32:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1694151168; bh=uf/le7VIHY1XW98iNFr1+tqnRt/SHHHtO5Le2IRL7+4=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=htikYqN+VRSr09Kq7p+NBtEgiC+To8aQG37VMRN7hXp4xirjKtD+hdzmJXtjqlT4B H18xcOKpXA+NJwYmREJ0bI1BKJ658wE2hHtkWjV+m2plu/XyXGXm8t4lgHShqAZyvJ ioNDGw3CW+79LA72TRRpprkBg1+Tnh7J6Jbqe7Jk= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3885WmYW013346 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 8 Sep 2023 00:32:48 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 8 Sep 2023 00:32:47 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 8 Sep 2023 00:32:47 -0500 Received: from [10.24.68.114] (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3885WhQB026515; Fri, 8 Sep 2023 00:32:44 -0500 Message-ID: <3e127f6a-98e7-5f57-300c-280d5851794f@ti.com> Date: Fri, 8 Sep 2023 11:02:42 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH v2 4/7] drivers: firmware: ti_sci: Get SCI revision only if TIFS/SYSFW is up Content-Language: en-US To: Manorit Chawdhry CC: Nishanth Menon , , , , , , , , , , , References: <20230907141407.382215-1-n-francis@ti.com> <20230907141407.382215-5-n-francis@ti.com> <20230907150516.v3tsushxhcucmmsl@undergrad> <20230908051706.nsldv7p23hacnadq@ula0497581> From: Neha Malcom Francis In-Reply-To: <20230908051706.nsldv7p23hacnadq@ula0497581> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Hi Manorit On 08/09/23 10:47, Manorit Chawdhry wrote: > Hi Neha, > > On 09:04-20230908, Neha Malcom Francis wrote: >> Hi Nishanth >> >> On 07/09/23 20:35, Nishanth Menon wrote: >>> On 19:44-20230907, Neha Malcom Francis wrote: >>>> While setting up necessary dependent clocks and power domains, we end up >>>> probing the ti_sci driver before TIFS/SYSFW has been loaded in the case >>>> of legacy boot flow devices. This leads to panic when getting the SCI >>>> revision. Return the revision only if it is combined boot flow. Also >>> >>> Not clear description of the problem. >> >> Hmm okay I will modify this and the earlier commit message to give a clearer >> picture. >> > > I still don't understand why we are coming to the TISCI driver to > contact M4/DM for setting up the power domains and clocks, if this would > have been the case then even the normal J721E wouldn't have been working > and it shouldn't have been dependent on the DT Sync to uncover this > issue. Could you elaborate more w.r.t this patch? > We were using /delete-property/ to remove every instance of k3_clks and k3_pds before TIFS/SYSFW came up so it was never probing the TISCI driver. > From what I understand is that even if we end up coming here, we > shouldn't be hitting the panic as the previous patch sets up the > necessary clock (mcu_timer0) and at the worst - we would just end up > polling to get a response and if we don't, we would fail and we > shouldn't be getting a panic. I believe this is how the J721E would've So earlier we never reached here because of above mentioned reason, now we do with the last patch. While probing ti_sci we invoke ti_sci_cmd_get_revision that returns -61 (ENODATA) and we reach panic like this: get_timer --> get_ticks --> dm_timer_init (tries to get timer, fails for above reason) --> panic > been working before the sync but am not sure what is breaking after the > sync. Maybe this helps in uncovering the real issue that we still have, > I believe we should still be looking at why the timer is failing and > causing this probe to fail. > > Regards, > Manorit > >>> >>>> ensure that after TIFS/SYSFW comes up we run ti_sci_cmd_get_revision >>>> again so we print the revision right. >>>> >>>> Signed-off-by: Neha Malcom Francis >>>> --- >>>> drivers/firmware/ti_sci.c | 9 ++++++++- >>>> 1 file changed, 8 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c >>>> index 72f572d824..6a85d202f2 100644 >>>> --- a/drivers/firmware/ti_sci.c >>>> +++ b/drivers/firmware/ti_sci.c >>>> @@ -2703,6 +2703,9 @@ struct ti_sci_handle *ti_sci_get_handle_from_sysfw(struct udevice *sci_dev) >>>> if (!handle) >>>> return ERR_PTR(-EINVAL); >>>> + /* May have been skipped in case TIFS/SYSFW had come up later */ >>> Very confusing comment. >>> >> >> Understood, will change that. >> >>>> + ti_sci_cmd_get_revision(handle); >>> >>> should this be protected with if (IS_ENABLED(CONFIG_K3_DM_FW) ? >>> >>> Since getting the handle is where the entire flow happens, why not do it >>> here always? >>> >> >> This is a valid point, I am in the process of making sure there's no other >> consequences to getting the revision this late for platforms with other boot >> devices, if this gets an all clear, I will push it here for the next >> version, else I will explain why I couldn't. >> >>> what if ti_sci_cmd_get_revision fails? there is no error handling here. >> >> Yes that would be a consequence since ti_sci_probe, the logic it was >> written; used reading the version as an "all okay return 0" for the >> TIFS/SYSFW binary. >> >> But now after moving, ti_sci_get_handle_from_sysfw happens after >> k3_sysfw_loader so we're not checking binary sanity early on in the case of >> combined boot >> >> I'm hesitant that we are checking version way later after k3_sysfw_loader >> for combined platforms and if that is something we want? But there is an >> advantage(?) that it will run every time someone tries to get a handle for >> doing anything with TISCI and that would be a kind of check (?) if the >> binary is good? Correct me if I'm wrong in thinking that. >> >>>> + >>>> return handle; >>>> } >>>> @@ -2825,7 +2828,11 @@ static int ti_sci_probe(struct udevice *dev) >>>> list_add_tail(&info->list, &ti_sci_list); >>>> ti_sci_setup_ops(info); >>>> - ret = ti_sci_cmd_get_revision(&info->handle); >>>> + /* Get SCI revision ONLY if we are real */ >>>> + if (!IS_ENABLED(CONFIG_K3_DM_FW)) >>>> + ret = ti_sci_cmd_get_revision(&info->handle); >>>> + else >>>> + ret = 0; >>>> INIT_LIST_HEAD(&info->dev_list); >>>> -- >>>> 2.34.1 >>>> >>> >> >> -- >> Thanking You >> Neha Malcom Francis -- Thanking You Neha Malcom Francis