From nobody Tue Feb 10 04:14:10 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 228941B0420 for ; Tue, 28 Jan 2025 09:16:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738055766; cv=none; b=S37A9RsIHdCZtFohqTqeIhTd1BDGZU3bpkmPzuy29GF9hjoCSG13ubEtVFgM29XSM1mbdkjOvp2RLkndnxy5Dgj88R6BcrRIPbVd38v1HbHC1ff8xsn97588K3k8YI6D9y5X3FrZn41iVvT5UhGt/1PMQlhEVjjQakPsn47jIMU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738055766; c=relaxed/simple; bh=KHuLhnsJ6iK5XJ/TTyqbBRYPa91qqyTx+6ocjjKrTQA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=s3xIAjDK0qhUk0S3+MNtve4ACJFPgLWMQCqLFp7bWjowrYCogqe9f2of8zSWdrQ+lTLPHeBacRNzEoEr+HsOz9dgSGsWOdoJlqLxoK0XskmFnU8WLsF5w9o9Ri6ue7qzl1Qz6yftFAmcCgKu8BP0cGeWQUb0NXlF1HUrr2YbtzE= 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=haaw/39t; arc=none smtp.client-ip=209.85.128.53 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="haaw/39t" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4364a37a1d7so55019715e9.3 for ; Tue, 28 Jan 2025 01:16:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738055763; x=1738660563; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=NhODhIsp5sNQhrgscGJrDmO2sd4lDe7ta/1PU/kWbXM=; b=haaw/39t7uhMC3facVk2O8/HJ7R5oi2cz/Lo/ioTe5TMUT9xLmn2TdwHGBrrteL00D kR3EdJAaJHPtXbJr90UD2XNpm3ACK8SKQRKj8FyLVV6LQnvxbktmfwHk/0Zw/PQ+/tA0 bQGSNS2/NSX0kOLeRl/5Q3XMAEozKwK2aMDnZ4Ro3ypfHdG/R9UU/1bibvtjCCg66E1R 9jfSSvriBgqDddl5TsTNzCTtCsawBX9H6tYFbGA0ow9y94CMynd10PiU3Xj020Plf7RE VVOxF8ATY9luvbCmHlK1RLgshGQsv1h7syb5vcEJ0QEj5EbYn8nixAOrq2bRO8bwGZds jHZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738055763; x=1738660563; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NhODhIsp5sNQhrgscGJrDmO2sd4lDe7ta/1PU/kWbXM=; b=MJb5VSXjNyaSseqc32Hd5zNF9QMEKayBcFLw+WwDj3aRKgAEghjhCJ5Fj8pTCZBqCP n2X8FhtXwpnDsuFMykh3b2uWWcyZkwG1Uzks54Be9FsplDDcrXsDIYyInuLTkbI4M52J o25z+PGQGjcc/pZ+nzEUWrWDxKYvC/W+AVQJPXBhi8AqhLhmBrhmCtpe7QpWM+3DQQtS eskh47r3U2FFz1lEgXrjRBnXstnvkWWlfNMz5GscPFCqDJZfqLk8RIXvyeNR/q5InBCl zOfjekr5WNtE4lgsc9UrQvLxLnUwZzlWaQJs7GonYhrueZPWHi3iVlonTlal8nmHzNTv 1mjw== X-Gm-Message-State: AOJu0Yx/8elJQfkIcDiBIhmSEcFWIw7y/pl0L3x1rwvkO/d3wtWkLoy7 HrqOg5f7M60BhFVl4LDOv25Ad5u18+ktlJZTvrkm5UdUjLZLRImjcWvtVyey3kf/NvW4lSdgsBb / X-Gm-Gg: ASbGnctPLJRRub7zP4LCHnhg4/4tjTwIWLMcphyLMUZ/c0rO35i+d76lw7iMbJQ28aq WYM+jvm9Ylsg23TswID55t1hwbV0VDnE/hFE4ExwN2rupY8QbIJn50sDFyNAb/nKOAUDLdHtpew 47DJbCQEfcllDWjnCTl8h92pMtes/UlGlNRGgKAdaDGJ7AumGN1UqfI8I7XSODOhDSSiAKql+kW f1dnhsnU1pdvFu82D897kYZyqyg+GgZkC6fJ8ysxr9v+yEnRa/7FARfSwsjiRynd4yNv0BunNM5 uIND7tT+jaqwUMlTDopFjwhEPcfkOuzCQ013GEokGX8Gu+r/qsw6d3CBPFcIdvK1aLztpOU= X-Google-Smtp-Source: AGHT+IE/Khj+EU92WPLCRPaqKiq6rtMNgKTFoj2DcPlAzRLResjeKksaOejp3zs5CJvqFQ5tet16CA== X-Received: by 2002:a05:600c:1f14:b0:434:f623:a004 with SMTP id 5b1f17b1804b1-438913e391fmr463401725e9.16.1738055762962; Tue, 28 Jan 2025 01:16:02 -0800 (PST) Received: from ta2.c.googlers.com (169.178.77.34.bc.googleusercontent.com. [34.77.178.169]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd54c0d1sm164577105e9.26.2025.01.28.01.16.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 01:16:02 -0800 (PST) From: Tudor Ambarus Date: Tue, 28 Jan 2025 09:15:47 +0000 Subject: [PATCH 2/6] mailbox: don't protect of_parse_phandle_with_args with con_mutex 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250128-mbox-mutex-v1-2-1f0169ca5f61@linaro.org> References: <20250128-mbox-mutex-v1-0-1f0169ca5f61@linaro.org> In-Reply-To: <20250128-mbox-mutex-v1-0-1f0169ca5f61@linaro.org> To: Jassi Brar Cc: linux-kernel@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, willmcvicker@google.com, kernel-team@android.com, Tudor Ambarus X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1738055760; l=1087; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=KHuLhnsJ6iK5XJ/TTyqbBRYPa91qqyTx+6ocjjKrTQA=; b=frmym2dKzE0HlBcUIvivrylcKXkV22mT7eIzMr9Ghh8PtpxGM0qakC20Gok33siriO9YbyvUt wS/ZClY/WZfB+i/ivbJbAxeMCuhDeww6YiMDhDwsQbBc671qzTbQ0q9 X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= There are no concurrency problems if multiple consumers parse the phandle, don't gratuiously protect the parsing with the mutex used for the controllers list. Signed-off-by: Tudor Ambarus --- drivers/mailbox/mailbox.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index cb174e788a96..784b56859a06 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -413,16 +413,15 @@ struct mbox_chan *mbox_request_channel(struct mbox_cl= ient *cl, int index) return ERR_PTR(-ENODEV); } =20 - mutex_lock(&con_mutex); - ret =3D of_parse_phandle_with_args(dev->of_node, "mboxes", "#mbox-cells", index, &spec); if (ret) { dev_dbg(dev, "%s: can't parse \"mboxes\" property\n", __func__); - mutex_unlock(&con_mutex); return ERR_PTR(ret); } =20 + mutex_lock(&con_mutex); + chan =3D ERR_PTR(-EPROBE_DEFER); list_for_each_entry(mbox, &mbox_cons, node) if (mbox->dev->of_node =3D=3D spec.np) { --=20 2.48.1.262.g85cc9f2d1e-goog