From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09E8D3EC2EA for ; Tue, 17 Mar 2026 15:40:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773762040; cv=none; b=Oig1GZqlFRye5dptk4a0f/a7ep3FszclaDYa9f0Hvk/pBOLhJfKKSWZdpjHGK3If+t1nf9Bx5iXSs1LfL8978y7yLP/993L5wpBBir9i+R0cbOqR1I5ZY2ESVpmD3Ju7hhcYawlsK67LE7PKp0L/zNrjZUsod3CUZojLq3MPoRY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773762040; c=relaxed/simple; bh=+28TyEqbgg+eO18RfYm/y8EenXN+3buC5i+dg4Bi5ho=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=W+oLSfttIFKAAm6bWM7Y5BZYV1l5mY9g/mlwosQFfahCmKrpDK9V+mv46gV+oac6tdtiGWV7aWOjuPeEU5sUa8Rn6Qo0Yn+ZKlXYn0CWeIbyRxW48l8FtMvLBA21oNLkSIqkj6TqDYD4hCgJfGd07lu5B2ct6hP9wjB+ilqRuEc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=FZYvqUx7; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FZYvqUx7" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2adbfab4501so27146925ad.2 for ; Tue, 17 Mar 2026 08:40:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773762037; x=1774366837; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=jMbpigMk9kBN96FxVGa+Cb1r1OnBt+q3Ymeru06O2aA=; b=FZYvqUx7Lwf7RY8WTpCCC0WRC//e3UKkWCyk0EswgyXWhvNy3jTbKY2XR6jKR2o0OD bnXCSbnHgOqJIy/VIxbP1As1oM4YzIstD6Jg9S/sHXLGQS2i75+oIQ5U7Zp5fvoPOu3I ofp7MRP9H9LK5x8++UTiFPeMeaxoTcbULLH4VCwsijNFtZkFCCif80EiMzpH/lVqJNIQ 8oadJfI25UIb2kYrAHVW2lbfghXV9OJdsEJDaYX7gjZ7tHIZYk1UN6BuTr79GSci85gG q3C3lqhjaHI10x495YcRHOA9KXhTkGuegQ+/qcUSMugN41VcKUoXzDo20l+wuktpzyyw IuiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773762037; x=1774366837; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jMbpigMk9kBN96FxVGa+Cb1r1OnBt+q3Ymeru06O2aA=; b=GcXhNOrypeQYFg61WdfRQYCDdxSOLWmmPIe3w24uXsuiv+jg/oRMAXxOQ1l/1vQnZR x6z7kxjdsV5cLIlwLxid2NCdnYjEU4PWVYjFnfPqhSjWQ9lnBqWqkWnrqd5+pAftz1c6 89p7l6VT5Mg1GOaHioi+5kJTFwctzUs2Rzt/KFfgEpMOA/Mgz+rW3VwvkRKUru1Tv0A3 UoGdmNY8s8F2Fw33CBqkYv3OIEkUKK+/RO7bzY35V/3epweRE5zUjitsJ7f8Aune7Wdt G1ZbYLuiyndyy5PTZeha0ndDspY/ohToi/YrxllohqNTMQvzpAlZ2bYWsRZqvbmd5c7F P3IA== X-Forwarded-Encrypted: i=1; AJvYcCXBiuKkV5lI4wkxOVv0u6feJQUBA9siU3hfKCM+lHehVuSeleP7xqFK/aXsbVWtoWtOEdPGHnOa1m7aT2k=@vger.kernel.org X-Gm-Message-State: AOJu0YyLFcx6Gl2esItO5x2yxAJlwchK2oairsg47gy4+v1n4+MDzJkD w27lN0lPF4lv8nXrfxldc8ubtUh+PUs2beuXhoCx+so1R9G4ciJIA6cKRkWe9ytNBME= X-Gm-Gg: ATEYQzyFbN6OLh1r9pCqwn0VXnhYN7P8GHR2duBZ1G/OJq42DeXXqW1xLnxoN18Ynn+ RwN07X0PFdWTt4SUVJbhl+1BDrh6BzP+k/XZjS3XzCY+oHyEgFhsKq+GmZn5ef3Nkf9NaWZaf+Z /35fJ/GdA9u5zapox/pLF7h99RWTHK0ZYunncZhy0+j5xQhWGF5lTyR0KK45+3VyhxFSbLjhNMO 54Wqc+xeYDSUdXc5ud1Txr7jSeXvR0xR9Fjbtq+w6NQgi558iZ1ke80V2hytSGoESguihk2GKgk Y64z7UJjBJ85wEV+AGL36/zm9fXPReVB2qkWD4w0GT/5LhhPGGgHU6vg3H+VkFPaj5Prp9FCSg0 5gYU56zt8WFKojh6F1OryJ6YkIuPtbk+U1Msh9IQkcRKM0xRXdZTFJh/oo+SLRUrEnJrQVelSvR uhgsCIXq3yJ2rW4nICQVFEsTzZv6J8tESuw5QJmw== X-Received: by 2002:a17:902:da8f:b0:2ae:504c:ae8a with SMTP id d9443c01a7336-2aeca936252mr185416155ad.16.1773762037073; Tue, 17 Mar 2026 08:40:37 -0700 (PDT) Received: from p14s ([2604:3d09:148c:c800:d74d:3187:221b:ee9f]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2aece7ee4a1sm188860095ad.54.2026.03.17.08.40.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2026 08:40:36 -0700 (PDT) Date: Tue, 17 Mar 2026 09:40:33 -0600 From: Mathieu Poirier To: tanmay.shah@amd.com Cc: andersson@kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] remoteproc: zynqmp: release mailbox channels on shutdown Message-ID: References: <20260303235127.2317955-1-tanmay.shah@amd.com> <20260303235127.2317955-4-tanmay.shah@amd.com> <91a3bf88-cd64-4f3d-adb6-5e21558e8ff8@amd.com> <6e18177d-d2be-4d42-807f-2238436bd4a2@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6e18177d-d2be-4d42-807f-2238436bd4a2@amd.com> On Mon, Mar 16, 2026 at 11:37:05AM -0500, Shah, Tanmay wrote: > > > On 3/16/2026 10:38 AM, Mathieu Poirier wrote: > > On Tue, Mar 10, 2026 at 11:04:54AM -0500, Shah, Tanmay wrote: > >> > >> > >> On 3/10/2026 10:29 AM, Mathieu Poirier wrote: > >>> On Tue, Mar 03, 2026 at 03:51:28PM -0800, Tanmay Shah wrote: > >>>> mailbox driver can't introduce shutdown callback, as it might endup > >>>> closing mbox channels prematurely. By allowing the client driver to > >>>> manage the shutdown process, it's ensured that mailbox channels are > >>>> closed only when they are no longer needed. > >>>> > >>>> Signed-off-by: Tanmay Shah > >>>> --- > >>>> drivers/remoteproc/xlnx_r5_remoteproc.c | 2 ++ > >>>> 1 file changed, 2 insertions(+) > >>>> > >>>> diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c > >>>> index 5e92dc51f1c0..50a9974f3202 100644 > >>>> --- a/drivers/remoteproc/xlnx_r5_remoteproc.c > >>>> +++ b/drivers/remoteproc/xlnx_r5_remoteproc.c > >>>> @@ -1490,6 +1490,8 @@ static void zynqmp_r5_remoteproc_shutdown(struct platform_device *pdev) > >>>> dev_err(cluster->dev, "failed to %s rproc %d\n", > >>>> rproc_state_str, rproc->index); > >>>> } > >>>> + > >>>> + zynqmp_r5_free_mbox(r5_core->ipi); > >>> > >>> This is already called in zynqmp_r5_cluster_exit(), why doing it here again? > >>> > >> > >> Hi, > >> > >> Thanks for reviews. > >> I think cluster_exit() call is called only during driver unload. Where > >> as shutdown callback is called during power-off commands of linux like > >> reboot or shutdown. > >> > >> That is why I am calling it separately during shutdown() callback. > > > > Then call zynqmp_r5_free_mbox() from zynqmp_r5_remoteproc_shutdown() rather than > > zynqmp_r5_cluster_exit(). > > > > I have to call zynqmp_r5_free_mbox() from both handlers i.e. > platform_driver.remove() and platform_driver.shutdown(). I can't skip > either of them. > > Because during driver unload (rmmod), shutdown() handler won't be > called. And during power-off commands (reboot, shutdown) remove() > handler won't be called. I was under the impression that during system shutdown, ->remove() and ->shutdown() were called sequentially. I looked into the platform_driver structure documentation and nothing of that nature is described, leading me to beleive your assessment is correct. I'll apply your patch. > > Let me know if I am still missing something. > > Thanks, > Tanmay > > >> > >> Thanks, > >> Tanmay > >> > >>> I have applied the other two patches in this series. > >>> > >>> Thanks, > >>> Mathieu > >>> > >>>> } > >>>> } > >>>> > >>>> -- > >>>> 2.34.1 > >>>> > >> >