From patchwork Tue Apr 30 10:53:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Beleswar Prasad Padhi X-Patchwork-Id: 13648756 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E91E612C490; Tue, 30 Apr 2024 10:53:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714474396; cv=none; b=ivLotGuJqlP3CMB2VKmJ5ZEUfuw/Y4HtoByLhnZvW3kiP4sA7uHHsxGK+NIPuK+X7gecIay0x/9gmaFVf/gGUk39QTyQKNlozQHfGezuxKNQpnlWzuaPQOSO84zHbL1qx4kdsdui7WkqCt3St4EJGFlttnRduuH2OXEmgFNYulo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714474396; c=relaxed/simple; bh=RWRXpLCKdKSQs2XuJN03r9hEXbuXWjMhl2cAlMgAKaM=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=XtQnurGgEZBZAecsX7ZAXo5JcdnMTK19fl2YtQJl+9JSEsPABfKBfYevzJvy1dOokCxCtAjxqrFa7rChwwjqX3eocdCO9NSIhcNi0BUNCZPfRgtsRauUd4HtTIBBfYQa7Dzj2UPAp063U+7OESu18u11L6VL0hhwI9GfHhoGL8Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=tzWSFHll; arc=none smtp.client-ip=198.47.19.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="tzWSFHll" Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 43UArCWV130406; Tue, 30 Apr 2024 05:53:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1714474392; bh=/S2o4fuM/8KSLXddRuXzzl3ArTQb6LjGDSIjynvSBeE=; h=From:To:CC:Subject:Date; b=tzWSFHll6BhIJfv4TEZK5d0zamDSqyPUKJkqcjJ7epNkQuJlOv37VK3QJjb1Qfb7y xlfK61KdjzJPzmKS5OrL0x249Zy29Ww7rexEHE64nPzy4aPIfV4pjmgCnhjyWnUxRl U2pllCVYx0fkzSrskT4zqlBxC/lzMFbmDVvas3TY= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 43UArCKx004449 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 30 Apr 2024 05:53:12 -0500 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 30 Apr 2024 05:53:11 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE115.ent.ti.com (157.170.170.26) 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; Tue, 30 Apr 2024 05:53:11 -0500 Received: from uda0510294.dhcp.ti.com (uda0510294.dhcp.ti.com [10.24.69.66]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 43UAr8Dp038508; Tue, 30 Apr 2024 05:53:09 -0500 From: Beleswar Padhi To: CC: , , , , , , , Subject: [PATCH v3 0/2] remoteproc: k3-r5: Wait for core0 power-up before powering up core1 Date: Tue, 30 Apr 2024 16:23:05 +0530 Message-ID: <20240430105307.1190615-1-b-padhi@ti.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-remoteproc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 PSC controller has a limitation that it can only power-up the second core when the first core is in ON state. Power-state for core0 should be equal to or higher than core1, else the kernel is seen hanging during rproc loading. Make the powering up of cores sequential, by waiting for the current core to power-up before proceeding to the next core, with a timeout of 2sec. Add a wait queue event in k3_r5_cluster_rproc_init call, that will wait for the current core to be released from reset before proceeding with the next core. Also, ensure that core1 can not be powered on before core0 when starting cores from sysfs. Similarly, ensure that core0 can not be shutdown before core1 from sysfs. v3: Changelog: 1) Added my own Signed-off-by in PATCH 1, specifying the changes done 2) Addressed changes requested by adding comments in code in PATCH 1 Link to v2: https://lore.kernel.org/all/20240424130504.494916-1-b-padhi@ti.com/ v2: Changelog: 1) Fixed multi-line comment format 2) Included root cause of bug in comments 3) Added a patch to ensure power-up/shutdown is sequential via sysfs Link to v1: https://lore.kernel.org/all/20230906124756.3480579-1-a-nandan@ti.com/ Apurva Nandan (1): remoteproc: k3-r5: Wait for core0 power-up before powering up core1 Beleswar Padhi (1): remoteproc: k3-r5: Do not allow core1 to power up before core0 via sysfs drivers/remoteproc/ti_k3_r5_remoteproc.c | 56 +++++++++++++++++++++++- 1 file changed, 54 insertions(+), 2 deletions(-)