From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 72B6115539A for ; Wed, 29 Apr 2026 09:07:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777453655; cv=none; b=fEgZ7dNGEJPzRduMnMlBYFKL95qQ4c6b/17ZHXDCF748Lw93Tt2bTPKgSNv2bLgvQbgs3VdyrwThHJiNVc3R06zn6BvWfzkp9ZhA/OdsaBoSNwWIJ5pVOleggwpvWnYHJbHVt0QMgxADy7VMgliAi95lZ48kOhWWcjULdNFxMjo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777453655; c=relaxed/simple; bh=AwZuUXPk4/WpmF+r8jDpB7wrDuVU3zFwiYudmOuTakQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Mz35g7NyT9ATc1NjWnQSrfUL2v+O8g6eODQ2riCQo1DUDEA7GXTXEEsR0SwNWgUXUd2PJFgjA7z8WkFIYy2iNedDu1PCqDfcQnoxf+sv3Nw0WSrrPAQ69AU4Izx7Hxy9yNEvGVNk37oXKnAYAfkEbR8qMGCxNsihb+tnlVAuSb8= 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=WzlnfwAr; arc=none smtp.client-ip=209.85.128.52 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="WzlnfwAr" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-488a88aeec9so149819755e9.2 for ; Wed, 29 Apr 2026 02:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777453653; x=1778058453; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=8Lj5tmUBXJFmzYH2N7Dd27gLNCll+S51FdGFIIdlW1Y=; b=WzlnfwAr4DJID5MtMtZ5nD/hIInr+BJPMOmbnxGKYJdc5oZo19tk5YD9fLAkzZx6XQ t3oQIb8ONLqCn/clp6+dSaUcXmlYA3KCj10APjyZq7ZodhQmXFSqwnaLOmUGNbyCleTm 06KP2V5WK1ba+Rto9wLX78pIU7NRQJ04Q0CVYPJrBu62F7rfNGcphlKxmE4TuIEXtKCL cvgXoI3me+BsJRE8jRB9xrFiYKz/sWrAL/oJepsxfZK1x95WzrxSfx7SCcR3wacUGxKy CrMfpKo5lqE5pUI2WOG5Vws/QVrqM3u92g9nBypyXlW7YbdWoFLZ72kYqIFcDXyRtY+7 r+6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777453653; x=1778058453; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8Lj5tmUBXJFmzYH2N7Dd27gLNCll+S51FdGFIIdlW1Y=; b=aDidNhuNrAWqXn4sEo0v1exWH7mKgr6kj1VjJmooGZClZuIUyREtwo+Jm6DdqZhejz FlhyTe8hLYlYceeIvFq7t5F9ZfthqF40R9cIWvVJt8xRKgDe7Xp2PmhTS5x8cxghsrl8 T93ObzHwglunbA7HqHhlcamtJ4rQ0lekUtDCC4alGa4S1xkmAsOv2OKP8UZJXJlILamV Pm2YbHLdVKsvTWEQYBdhzdij+ZEn4eJHPVpvgURE4IJPVeN9wl6rzsuYWe9RDifuzcaM FnnPGdGBuULfrbWlbLZcpGLkdRE3OqBSuWBSZnq/hI0hflKABhkihNNQ9MsRr4XXzAM4 oMFg== X-Forwarded-Encrypted: i=1; AFNElJ/N7IJSCQP4Se2r/HfD68c9ejMTCqeouDUGyqBCF1xgPdGayt2yRAq5z/O2e9d+sVnZpTGeI7KFij3/FbY=@vger.kernel.org X-Gm-Message-State: AOJu0YxRrBItBCyv9i9VQBzkymHVuui5Jgi3t7khk2/suV3Ap3ZAfiZO owEX2esB46ZbHhd+50kDwLWD3ObH3CPXHt2jqQlZdanEUycKr7NNpTCq9BzL9zM/dd0= X-Gm-Gg: AeBDiestnSoRtbx+8JgEWE432S8W7xhE1txXxZzyEfQiKESXdEmhvHOjmus2KYH+4a8 6679Qg7cHwKYv/HeVynKfd3XBZu9rYurpfbQuQ1QGCXkC0jM9f4m6QIGmiflTN/UoZ0ukl1l8wI AcdVb5Bb/OFPHrngxhXdaWASRka79Swj5H1Fg1PUJ35NNqaWRHSq65rKjHLAuJNzu/6jU7JCooK T4IVFQ5m+//pVjPgXWmliVxybrNrVFyUfzeJVzqPVY/MwU7MQaIBWRgmpdNFnowWXhFETpVbZbL GzGU8SJm5a1ImRW4zGj9wkkkSarzT8Q/LbUiI3uvuwx5c1cTSBm+q8liDfn0/zCCjIq0+3B/3Xz dbNAx9yuUp7LBKVYtj+K1G+mrXBaHJ5beRorwEBKTmCG14uYYuBrlrmnFxxrjXlB56fHzIdzili hSQ8FQaVC7BB6gB9lD167v9H+TdKWjNg3uC1LG9zClsiU= X-Received: by 2002:a05:600c:2e55:b0:48a:7b55:12a6 with SMTP id 5b1f17b1804b1-48a7b55131amr28563845e9.0.1777453652729; Wed, 29 Apr 2026 02:07:32 -0700 (PDT) Received: from [10.11.12.108] ([79.115.63.228]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a7c5d1a53sm40803645e9.14.2026.04.29.02.07.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Apr 2026 02:07:32 -0700 (PDT) Message-ID: <6dcb5348-e973-494d-adf1-7fa2dc5655f2@linaro.org> Date: Wed, 29 Apr 2026 12:07:28 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/3] mailbox: exynos: Add support for Exynos850 mailbox To: Alexey Klimov Cc: Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi , Alim Akhtar , Sam Protsenko , Michael Turquette , Stephen Boyd , Rob Herring , Conor Dooley , Jassi Brar , Krzysztof Kozlowski , Peter Griffin , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260402-exynos850-ap2apm-mailbox-v2-0-ca5ffdff99d4@linaro.org> <20260402-exynos850-ap2apm-mailbox-v2-2-ca5ffdff99d4@linaro.org> Content-Language: en-US From: Tudor Ambarus In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/28/26 11:26 PM, Alexey Klimov wrote: > On Wed Apr 8, 2026 at 2:08 PM BST, Alexey Klimov wrote: > > [...] > >> On Thu Apr 2, 2026 at 9:42 AM BST, Tudor Ambarus wrote: >>>> static int exynos_mbox_send_data(struct mbox_chan *chan, void *data) >>>> @@ -57,7 +104,8 @@ static int exynos_mbox_send_data(struct mbox_chan *chan, void *data) >>>> return -EINVAL; >>>> } >>>> >>>> - writel(BIT(msg->chan_id), exynos_mbox->regs + EXYNOS_MBOX_INTGR1); >>>> + writel(BIT(msg->chan_id) << exynos_mbox->data->irq_doorbell_shift, >>>> + exynos_mbox->regs + exynos_mbox->data->irq_doorbell_offset); >>> >>> Use FIELD_PREP from please. You will use a mask instead of >>> a shift. >>> >>> I would rename irq_doorbell_offset to intgr. It aligns with the register name >>> from the datasheet. You won't need to prepend _offset to the name, we already >>> see it's an offset when doing the writel(). >> >> Sure. Thanks. Let's use FIELD_PREP. > > + /* Ring the doorbell */ > + writel(BIT(msg->chan_id) << exynos_mbox->data->intgr_shift, > + exynos_mbox->regs + exynos_mbox->data->intgr); > > FIELD_PREP() wants a mask as a compile-time constant. Unless you want me to Indeed, I forgot, sorry. > add switch/case for different SoCs or I misunderstood something I don't see > how this is gonna fly. other option is to have a .ring_doorbell callback defined in the SoC data, and then you can use FIELD_PREP. But it increases boilerplate code just to ring a doorbell. I wouldn't go via switch/case. I think we'll have to live with the mask and shift. Cheers, ta