From nobody Mon Jun 15 19:26:40 2026 Received: from mail.zeus03.de (zeus03.de [194.117.254.33]) (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 63C1637F75F for ; Mon, 13 Apr 2026 10:42:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.117.254.33 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776076970; cv=none; b=NboJA3ePuCUb3EtFC3POOXLmaFtIYy4B46i0+Cl9KfiNcBqlHHkIO2NOrCiTqbnlJUAhHItktfNf+WFY6wCexxJYqRV7rCbXuwghpOhpk29XfTD16q27IfxQ1J32PfGrL3u+qFoWw/Uml9sgJSlxepD2B3+eV7U6OOUsNBtiDaw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776076970; c=relaxed/simple; bh=ddBwk4QOSkBugdgQUDUB6zMSCHOhmj6ecKcicRyfeLA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TlwGoTGrvQhX4Zt023Lz361RBQaQR2692kVul8EHLL1xlLIh+gHraHMffbXDYhQYjUyicb6QFvm3NU82i/gY5R8GZTQpJWpREhUOqTk8E/bbIXSLNPQ/+c1abGWExe2HkCCZZD68fC2El4KFhxg7PA+SrluyPxGWZp+M8s8/BvI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com; spf=pass smtp.mailfrom=sang-engineering.com; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b=KzuOmP5K; arc=none smtp.client-ip=194.117.254.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="KzuOmP5K" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=k1; bh=nTclSCn0962mLnu5azu3BPWWzp6DS+Gv5wIel996218=; b=KzuOmP 5KJG7gzZAta2qrKiQ5cUx2z1d3Ra1tVspdwMdD1a7mYMtObIP82dw4fAlxVDb7IC rki9BK4sMsGp8TD3TSfZUAonLcsnKa2TeQi8vYzmY2JbA4znP6b/YjEbu38gEjzN RNB3VyhVTQcGgVP3uOij4SHlgQ/Aex6x2cOOKWutV+2aj5OACljEseLu49E7wuyB tDmEbuu4u6b7pYzItKq2JW2aQrwfVZWfNmCdSGxF5RPP5Ej4jhncTKpvWedy+kqm Mz9MYbJDQaY8IOZvAVIdRn8Bwk+mBEEzzcmZ/NyD+NT3SVb6D7oTRNkRAePwc779 e55SkROWh+IHRwzw== Received: (qmail 2255994 invoked from network); 13 Apr 2026 12:42:44 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 13 Apr 2026 12:42:44 +0200 X-UD-Smtp-Session: l3s3148p1@RISNJFVPzr8ujnvz From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Wolfram Sang , Jassi Brar , Mark Brown Subject: [PATCH 1/2] mailbox: add sanity check for channel array Date: Mon, 13 Apr 2026 12:42:38 +0200 Message-ID: <20260413104240.30493-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260413104240.30493-1-wsa+renesas@sang-engineering.com> References: <20260413104240.30493-1-wsa+renesas@sang-engineering.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Fail gracefully if there is no channel array attached to the mailbox controller. Otherwise the later dereference will cause an OOPS which might not be seen because mailbox controllers might instantiate very early. Remove the comment explaining the obvious while here. Fixes: 2b6d83e2b8b7 ("mailbox: Introduce framework for mailbox") Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven --- On my Renesas R-Car X5H based board, the OOPS was indeed silent. I injected the error manually. drivers/mailbox/mailbox.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index 14d9655d5424..0ed34f8f7556 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -533,8 +533,7 @@ int mbox_controller_register(struct mbox_controller *mb= ox) { int i, txdone; =20 - /* Sanity check */ - if (!mbox || !mbox->dev || !mbox->ops || !mbox->num_chans) + if (!mbox || !mbox->dev || !mbox->ops || !mbox->chans || !mbox->num_chans) return -EINVAL; =20 if (mbox->txdone_irq) --=20 2.51.0 From nobody Mon Jun 15 19:26:40 2026 Received: from mail.zeus03.de (zeus03.de [194.117.254.33]) (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 3644E3932FF for ; Mon, 13 Apr 2026 10:42:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.117.254.33 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776076970; cv=none; b=JmTFxwBE0dbhN1Q3C/vIWHOeXWHLKCQElhXYiAnp3FP2HMtRaHbN8+7gcMw716Iz6UlEjoAuMMCcq/UqyDdXzjpgIzupCH9zSLWb+UHFClsHYd380HIOnGhhTh+l9z5ESKXMdGPD3xkcGYet2nQkd7+ejP8FGzw1K50yOSZZZ+s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776076970; c=relaxed/simple; bh=7/DrXweXvjSm8Qyck5CcdwMke9swZ7THfVMznI+PMP8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dXXfYszwE9vIn1BK2Jwh9vidjhiRXJPKGrjf+WdhH3g47uQM/J1QmNy9hF5ANRkB8FEOYRbKUmzFKMsv/Atyfb/2l+FKCW9oiQ5vR5oyUMgV9ErzF7aKRf18+0FeLzXGxMCdUK7FbfaG1+dnkhjY7L/vWxaUk0EZlpeDW5V1VuY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com; spf=pass smtp.mailfrom=sang-engineering.com; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b=g0jIba+Q; arc=none smtp.client-ip=194.117.254.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="g0jIba+Q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=k1; bh=ePKuJIQ3syxHc0vtxN8/MC6+Yukj2O+ecQDv+Xe4Itc=; b=g0jIba +QbUEm53I6+hgXvyLTAf9ZmseipMmwNOSgyrlBqQdt/7pzfuwmrjct4Js1MUQgWa e6ElGaLeYj+qZKm+t4fm1hq5Wj9Aap7cmC4lmFIwy9IGF71SmLeGeY80qw20lYwl fFT4TPZotBXf0SHOUTv7zJBYqVh9QxiUrsFRLHXhJm1kLJwTssk4uOlhfF05YkhZ HeLWTVXb1bVqg2iF+4PQo55i9RgcgJ7PNSfeb5syhL26RWhPQnWefdu3Xc2SJm5q 9vAagGnSudZ06EuzPm4WzII56SptpmVDjKyjOW6EnzF8/+aA22ieXpj+KOmwND/F CkIvz1WOmoVzGSYQ== Received: (qmail 2256029 invoked from network); 13 Apr 2026 12:42:45 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 13 Apr 2026 12:42:45 +0200 X-UD-Smtp-Session: l3s3148p1@+UGbJFVPlNIujnvz From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Wolfram Sang , Jassi Brar Subject: [PATCH 2/2] mailbox: update kdoc for struct mbox_controller Date: Mon, 13 Apr 2026 12:42:39 +0200 Message-ID: <20260413104240.30493-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260413104240.30493-1-wsa+renesas@sang-engineering.com> References: <20260413104240.30493-1-wsa+renesas@sang-engineering.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add field for missing lock around the hrtimer. Add 'Required' where the core checks for valid entries. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven --- include/linux/mailbox_controller.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/linux/mailbox_controller.h b/include/linux/mailbox_con= troller.h index a49ee687d4cf..dc93287a2a01 100644 --- a/include/linux/mailbox_controller.h +++ b/include/linux/mailbox_controller.h @@ -62,10 +62,10 @@ struct mbox_chan_ops { =20 /** * struct mbox_controller - Controller of a class of communication channels - * @dev: Device backing this controller - * @ops: Operators that work on each communication chan - * @chans: Array of channels - * @num_chans: Number of channels in the 'chans' array. + * @dev: Device backing this controller. Required. + * @ops: Operators that work on each communication chan. Required. + * @chans: Array of channels. Required. + * @num_chans: Number of channels in the 'chans' array. Required. * @txdone_irq: Indicates if the controller can report to API when * the last transmitted data was read by the remote. * Eg, if it has some TX ACK irq. @@ -78,6 +78,7 @@ struct mbox_chan_ops { * @of_xlate: Controller driver specific mapping of channel via DT * @poll_hrt: API private. hrtimer used to poll for TXDONE on all * channels. + * @poll_hrt_lock: API private. Lock protecting access to poll_hrt. * @node: API private. To hook into list of controllers. */ struct mbox_controller { --=20 2.51.0