Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1380276lqj; Mon, 3 Jun 2024 22:22:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVgz9NQEbrBVpkdIy4vl72jq0S8UJ+aZbGhP64k9Alw9WUl+1obp9ao4gvglJ80h9kEhxXW6Ya1cauLd+HEEx/gjbNJqwOYtsZt3/teLA== X-Google-Smtp-Source: AGHT+IGyWHHinX8VrxxF8F/TSQFIO7INaX2160Kv9Owet8jP3B9/4s2SBx5umYaWp9lA6DEhM/BX X-Received: by 2002:a05:6a00:398b:b0:6f3:e6e0:d9f3 with SMTP id d2e1a72fcca58-702478de5ebmr11928801b3a.31.1717478572972; Mon, 03 Jun 2024 22:22:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717478572; cv=pass; d=google.com; s=arc-20160816; b=TDvvUtKYHVm/DydFoU16ZhqMMm+ju8KiA1zeAk09rFS+wviU/+2YSoU4KRfth2HOmT +2t4PfPsNJSN44/vq2HC08GJkClQ4gAVHj8MRQotqhPf0zwy5ueC2tuTYvYcELpiQzps pULmDgNOuZpIuxdtSduOpNxDh/wEEWXNaoR5/bccOQ3egjJtWIZyfUBf0WmbZzodSeXa QgOw9j4zGWnqAibayYSoGVRJy9DdhtqvKwr961JIunTqID6hEzd/OzGLnLlNa+dMcHXk GogakiKgpGUHal655TUR3lNxIKSpFUd9SZaTTdQij1N7vsKr+WPgVwgCbCV1d4AXRj5U UYaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=kQdpZ4YUeWwRVQ6Z+ae9gy0QKj4zL29BKyGpvG/1Y3k=; fh=TuSGxqTOfQdEnj8HQSeM8BmH3+vn3/ZCsy+2bFL5DH0=; b=qlQNXA76hgtXCsXHfrcrMydETPgxtK2gaxTDufxFvk3Efl5Cgjs3X+Lt3Q5lDgQb1d orSQZFn0Ses6VSTJ2LbpVLECoe9jwhG5BiS9SQ4XRN/3KG7y7xov40MCpR0H3peEkzHK qySYE1gXqEuqY/bjgnAOE+97ziscbcGIzTgLtqVwTMMWlu6LTNt3/oun1PUX5evA8tX7 OLAcAhLD5GHAjmgRrNSziC0taPmlufuEnNvVqLO/mhvDk8ioYxDdA9o5rXA+FWJ0eZVo XYFa70NxalLbfuyteM15m3Qp0LF1/RbRmXGVfBxmRaahklUSYDPZ13sy8lUZer41uLyV cxTg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=NfUbw6W7; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-200052-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200052-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35d59db2dsi616008a12.840.2024.06.03.22.22.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 22:22:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200052-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=NfUbw6W7; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-200052-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200052-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id DE749B21D90 for ; Tue, 4 Jun 2024 05:17:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 465F313D897; Tue, 4 Jun 2024 05:17:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="NfUbw6W7" 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 smtp.subspace.kernel.org (Postfix) with ESMTPS id B3AA62F30; Tue, 4 Jun 2024 05:17:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.249 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717478253; cv=none; b=MPwYxXSpAkWJmw2tiMmTEJhuWFND4CUZGTnx1KSx0q9Cp/Yd+Q/837E+Va/D2mMtMKdP5wzjJa79WPQ/Dy3LZozdMZRLBYDC5bOIuTSc5A3zrNfWSigdO4Inl/bkoWAYwTSD9Xf0YKJe9eEwEUW8Qc3S1+YBu90FzaDgQn1+Nb8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717478253; c=relaxed/simple; bh=vz7g+Vy8etMz3ItiT/90hkhv9t1iog2ipHtSzbpvCr8=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=iHGki1JOnCub6quoibEtqmbuRr0X2C3+YWkuoYGcXDLJdwVZzuqXwx/Rtv56amLcreR4Vtpa13DQ9BGgW2+qR20KU85Ir2CTDEfWdnKUIJYHlMo31SxIh5u2RNCYXWNHVe82wDjNtxnWhG9ojv36KGxSxEiQfqhu2s191Cy/Cb0= 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=NfUbw6W7; arc=none smtp.client-ip=198.47.23.249 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 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 4545HQxV041003; Tue, 4 Jun 2024 00:17:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1717478246; bh=kQdpZ4YUeWwRVQ6Z+ae9gy0QKj4zL29BKyGpvG/1Y3k=; h=From:To:CC:Subject:Date; b=NfUbw6W7v0F2JE10jVP4WQd2y+2yHKW9CYmWx5lhiApKZ55PW571EaL4BVVd4/fxu rUIzRD7eS4ZsB6dgins+h3+fchhUjfxFoOXL0g5QNb4gEZK6BrKrjwf6Nl1hgR2qqr GEDbLS9rE2EYXMNkwpkBPoWjXav+iGMgQpv0JPEc= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 4545HQLc107125 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 4 Jun 2024 00:17:26 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 4 Jun 2024 00:17:26 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) 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 via Frontend Transport; Tue, 4 Jun 2024 00:17:26 -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 4545HNG4067975; Tue, 4 Jun 2024 00:17:24 -0500 From: Beleswar Padhi To: , CC: , , , , Subject: [PATCH v2 0/3] Defer TI's Remoteproc's Probe until Mailbox is Probed Date: Tue, 4 Jun 2024 10:47:19 +0530 Message-ID: <20240604051722.3608750-1-b-padhi@ti.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Hello All, This series adds deferred probe functionality in the TI's Remoteproc drivers. The remoteproc drivers are dependent on the omap-mailbox driver for mbox functionalities. Sometimes, the remoteproc driver could be probed before the mailbox driver leading to rproc boot failures. Thus, defer the probe routine of remoteproc drivers until mailbox driver is probed by checking the mbox_request_channel handle in probe. Also, use the acquired mbox handle in probe during rproc start/attach routine instead of re-requesting. Do not free mbox handle during stop/detach routine or error paths. This makes our k3_rproc_attach() & k3_rproc_detach() functions NOP. Also, use the devm_rproc_alloc() helper to automatically free created rprocs incase of a probe defer. v2: Changelog: 1) Added a check in k3_mbox_callback() to prevent forwarding messages to a detached core. 2) Addressed Andrew's comments in v1 regarding some cleanup (Using dev_err_probe, removing unused labels, adding matching mbox_free_channel call during device removal). Link to v1: https://lore.kernel.org/all/20240530090737.655054-1-b-padhi@ti.com/ Beleswar Padhi (3): remoteproc: k3-r5: Use devm_rproc_alloc() helper remoteproc: k3-r5: Acquire mailbox handle during probe remoteproc: k3-dsp: Acquire mailbox handle during probe routine drivers/remoteproc/ti_k3_dsp_remoteproc.c | 76 ++++++++------------- drivers/remoteproc/ti_k3_r5_remoteproc.c | 80 ++++++++--------------- 2 files changed, 54 insertions(+), 102 deletions(-) -- 2.34.1