From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (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 29E2530C602 for ; Wed, 11 Mar 2026 17:12:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773249162; cv=none; b=fY02aemWmSQIDBuiKuK1zR+T91C/KQieyzQiA7DAjvIZ4IM2pZLPFHgzeLHD9XkzS+PIo18VXFvXlDPPeMbSB/5y8otNWYTHcA+Gorl6AKDwiY00NNk5PvbZh4F7yVTdze1obO/kTZPm/wKAUpPY1g3OBA+IdtUhRWrZlodc9b8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773249162; c=relaxed/simple; bh=TwYAqn7tSeMoxQeKMEOsbGp27pspTMSZsxZoAI+B5HY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qwmJ6WPgAfxUcOgVy5kqIkpKn7kigoTkr6HQdLzLlZXgGPf3FXI9kwRrDUxUN42oUIOXceTHeJMmBnyvrdd+GVs2SFsIDsMX3nWOGVj90hLPMw/DlthbX00vojwK2xL55iUOrUgHITjGKSLFkChFhM/Cfzn5KdL4Q1L/GqxhRQs= 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=q8Npi+Jh; arc=none smtp.client-ip=209.85.215.178 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="q8Npi+Jh" Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-c70c112cb61so40750a12.0 for ; Wed, 11 Mar 2026 10:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773249160; x=1773853960; 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=teRdmlK/inOEWa1f4E7ksWg4b499EYTa8xm2tdYI8Tk=; b=q8Npi+Jhit8XkwgOjNQusj6jkqZGGLyitzPVWlxeyfB7vJTx5zeXGnGje1eGEmpy3F apTnYP+eY0EWgPZAera3d2TuBL8AbWGPiwyLz+FTlwEAYzXfgEqxogEEt5EOAFzSf+hD IvFz4zXS/haohdSr8a8WOg+G58adPJab8s696LPOt5fGAwG4yiN8ou8XL2vKeZbsrSmG MCwsb5o/LBzgomY1ohnTpfn8snCoHN2H7LGQ41n6Jfs0crcSbEX9LRSpOEajKvNlj1eM mCD7+ZsurMfJf+ZOSftMHpXQO42+F6nqOY0BhSgWBXTJ12UEjftA1WibiEMrbHQnPHIS b46A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773249160; x=1773853960; 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=teRdmlK/inOEWa1f4E7ksWg4b499EYTa8xm2tdYI8Tk=; b=BxnTYnUgIdJv/EdVKOu0IvrGGBw/jDBFymFC9C45GlTTINq1v/X7yiVQErEz3BCs1v nDqyBWE1CSauj+T0aWrSyHjN5lg8d37CFlCs5xvN1xqrm/0Ww4NRQ3L7bGc/8/cEbXv8 1c27K1RiyAYVAvpYMPIVWEo0vr+cDL88T3eYAxzxq0T9p3wxkH0ItnvsIcFWTm4Ajdlm orhtJyP0uzGb/NAVhE/57FRhKzTp5XzKmmcEz+IVmmFm5qGq/YEAstno3NdqMbV1XAbk KLKY6/EA2rdlId73qmKqwIZGtNnmkzIV1in/XB+dlnEFAajLKAEfk2ry4NI909etY1Jm JSSw== X-Forwarded-Encrypted: i=1; AJvYcCW8tXEK/DQNsCEvl20MIYjXTvR+ltY2SuO6zSbaEAsAEquT9Y8kfeMzXoyRXEWa87MZUbNT/ISO29Qg5ME=@vger.kernel.org X-Gm-Message-State: AOJu0YyGZnKNXVK3qgJR3WBv6/1oclCcRqiID3+d0S9Lqgfc7PNGoe50 HMQhkpgxYrbspPu7m1RhyB2mKzzoi0otqRGkhvSmsZ/T17PddAyOhfGDEJG1jQell1c= X-Gm-Gg: ATEYQzxuMGzZjIXW0jTgMOkpkRNNGDP7z0PdEwmNzEbn543f/A1D6J2ZMga7SETZ9aT X9sEXUMBTi0xgQ+ThD20AqKGt7XCY/NBprpa3H5eTyRvf9vsYp3VwHT9dTCwpTpBJMFJzUKb9dK rhU79Ub1e1NDVyayV1rm4VFdx+sg81a5CM7Gp1ejex/h+lnTCiAwglfOl+KNNIPPoObiZn35mcu PwNWlW87fZzA6LFT62EDh8rZT6rtWKfaCphEBf0LwFgUWnlIRvs8PT2SlBgHZUCbsxk/5r05PKF +AzT3WCaCvlkts5yAcwcCGbvwecKaQhyMT3RkoUYQfk+jwGaMBy+8p95Ev1wa7Bk5xmfAK6/Scc ielZch+T4xsHAOLp/cU2fczI523k2395ir63IvsDueG8k87RVTVLxKmoaBG+DfwHeIOTkU8Sm0K wuWmHylr0fbRHH8IEa9QZ3CgaKWk4= X-Received: by 2002:a17:903:234a:b0:2ae:5063:b3e2 with SMTP id d9443c01a7336-2aeae763f71mr34727305ad.9.1773249160138; Wed, 11 Mar 2026 10:12:40 -0700 (PDT) Received: from p14s ([2604:3d09:148c:c800:80ec:cdb0:5d0e:6048]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2aeae378930sm28805445ad.85.2026.03.11.10.12.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2026 10:12:39 -0700 (PDT) Date: Wed, 11 Mar 2026 11:12:37 -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> 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: <91a3bf88-cd64-4f3d-adb6-5e21558e8ff8@amd.com> 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. The problem here is that zynqmp_r5_free_mbox() is called twice. At shutdown time all drivers go throuth the normal driver shutdown process where platform_driver.shutdown() is called and subsequently device management callbacks such as zynqmp_r5_cluster_exit(). The same applies to loading and unloading of drivers. Unless there is a corner case I can't see, calling zynqmp_r5_free_mbox() twice is not needed. > > Thanks, > Tanmay > > > I have applied the other two patches in this series. > > > > Thanks, > > Mathieu > > > >> } > >> } > >> > >> -- > >> 2.34.1 > >> >