Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1198390lqb; Sat, 25 May 2024 09:47:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU9YPD0zruM7p7KDfShhIq0dkG2mjL7TsAixNWIV4o6up+vLZX6kKq9x0lSrBQce46FbW5kDos84bDSRqSkYVZCJSsfoc5ELAeec/23uQ== X-Google-Smtp-Source: AGHT+IE04IaNfP3J+ppuZKuLSS2g7yoni0Kn4jEEFWEFYHEE8JcI/eXlkotTAv+5FlpZxsoEnajp X-Received: by 2002:a05:6870:d107:b0:22e:c434:ec with SMTP id 586e51a60fabf-24ca1498cf5mr5918934fac.56.1716655644115; Sat, 25 May 2024 09:47:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716655644; cv=pass; d=google.com; s=arc-20160816; b=1JYW7l7T8TPiSSGmS4id9vbHKbYeEzlIUWz+cotRY5mY6FPCBfxJoOld9T9R6Hd/2s NjVJBkT8sdRaVWRQfHjcNQiqesMx2zND31kjehD6yCeLlog/2ay4fmdqv0L6dC1YKnJs DQ18++ilPl8+vGXbSUT2wzQ9/k8yB1fhOttFrpqm0129Bggs6x7P6dHm1uCwSmRqXXHY ukM9SwJgHJ+x1vzn4K88kdtqAco/dmSCGiqx9BZR/rc0tve5DKog3PswFRRCOWCW0htK 1YaaYI6ZJ2x5A3C0ECzvIaffwlWqdjfyaYAp8FRwmaMJyE4s1nClIeXTHa85MoCQMSCJ 6tDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=X+ZYfYJUOaSdPxTcgYzagQ1ripG/OWrBtXdZFrrlfkM=; fh=uRn4KDWpiGMtohm5pAcofrWvT/vZBfq5aGy/2jhbNLk=; b=Uq3gjrz5ijtm3tsXLauOify+xO2jlrrl278cHiyrUSCqmDsbiPJ6mLvnQxY3LMbaXR noMJmme1+YrwySmfKgu8owRBpJwNce8Qfu0+OLicBHQiAov9i+XZmdIkTwbMqr++vqOm nnqucO+20d1V3Rfeop56naF2eAuDoI/QRFvljZWdKYmhyJRjS8OKf5XuaM6DmHDB5UyE R3BfBEesZVj+RDsJ6MN0FfCHxGOg6quW+YNCmTUF6syo3seGpu4FSw383CUm4aKcMV1Z /8BYbHMS41t+m4QiNEnOiPmJRobwqAX3+A/uezANKfdU6XGn+BuBrJXNREEeC+q1CLfM tfRQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F9UDp9XA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-189453-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189453-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43fb18b1942si46898461cf.395.2024.05.25.09.47.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 09:47:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189453-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F9UDp9XA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-189453-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189453-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C2E011C20CD8 for ; Sat, 25 May 2024 16:47:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 450298627E; Sat, 25 May 2024 16:47:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="F9UDp9XA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2958BF4FC; Sat, 25 May 2024 16:47:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716655635; cv=none; b=LJ/KzU2WfMM5UgyQqYktxOcZBS27b+BDCzNZbLdxLHWPKVX9GXKA3HqjqICQjoBbBWIPLgnBHaoIihH2eXleuXajn7ih/r0V+kx6pggkufUKOSKUku8e0s+sdIvJUEtwvh9ejSFO8yHcY0sh/J16sdhx+xO3wSwoTHE5xhaMXkI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716655635; c=relaxed/simple; bh=tcgFFUdEq/vKTYnqwg5KpKxETpCiRxdBDuidnItfaZs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ISTEdXKp9lz6CAAVyTwUImM4LKSRsymz9Wmprnb40dDI1KqAWjq+D34ZQZacCYiFUokAV6syy3tfzjh/LodxVUqf5dn5cnSN1N/eGf9ye59xQt9ac5EYTczuSwjQkdIVXroxOUOk7w/gl9h//+uFwHmEP/L1jz4mfxxAGufr4oY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=F9UDp9XA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B85D9C2BD11; Sat, 25 May 2024 16:47:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716655634; bh=tcgFFUdEq/vKTYnqwg5KpKxETpCiRxdBDuidnItfaZs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=F9UDp9XAsENdtKmn//ggvG6nygcJsAbLvgJkkwSopi3DAL9TbMfH+M9YymqU4OifW jElkL2B9w5OKPOsIkYGpOu+mSEKmdoHtSiLcxsgG6o0UVz2w4+lI0Vt0O7L09gLHav qtRxZ0GKSacEmzsug7LBGdVQdCA7JiFBSyrfnOCAFCIlWAyoV6AYfQrz1j+tqNo+BN rdPhiO+/6anwaRwQ5DQ0Fm82YbtkMCarlbapHHYg31z5PcWauJyM0Zz21Qbn30umh4 p8jPPvtOlfVaQIcy5vs40dNatn23qZhf3AOcr0HpRWazR2/lal8WcH8jYozbOSuoSX KeABX/GvtQOQQ== Message-ID: Date: Sat, 25 May 2024 18:47:08 +0200 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 RFC 1/2] dt-bindings: soc: qcom,smsm: Allow specifying mboxes instead of qcom,ipc To: Luca Weiss , Rob Herring , Krzysztof Kozlowski , ~postmarketos/upstreaming@lists.sr.ht Cc: phone-devel@vger.kernel.org, Bjorn Andersson , Konrad Dybcio , Krzysztof Kozlowski , Conor Dooley , Andy Gross , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240424-smsm-mbox-v1-0-555f3f442841@z3ntu.xyz> <5099926.GXAFRqVoOG@g550jk> <4881282.LvFx2qVVIh@g550jk> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93c2tpIDxrcnprQGtlcm5lbC5vcmc+wsGVBBMBCgA/AhsDBgsJCAcDAgYVCAIJCgsE FgIDAQIeAQIXgBYhBJvQfg4MUfjVlne3VBuTQ307QWKbBQJgPO8PBQkUX63hAAoJEBuTQ307 QWKbBn8P+QFxwl7pDsAKR1InemMAmuykCHl+XgC0LDqrsWhAH5TYeTVXGSyDsuZjHvj+FRP+ gZaEIYSw2Yf0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-Transfer-Encoding: 7bit On 24/05/2024 19:55, Luca Weiss wrote: > On Donnerstag, 23. Mai 2024 08:19:11 MESZ Krzysztof Kozlowski wrote: >> On 23/05/2024 08:16, Luca Weiss wrote: >>> On Donnerstag, 23. Mai 2024 08:02:13 MESZ Krzysztof Kozlowski wrote: >>>> On 22/05/2024 19:34, Luca Weiss wrote: >>>>> On Mittwoch, 22. Mai 2024 08:49:43 MESZ Krzysztof Kozlowski wrote: >>>>>> On 21/05/2024 22:35, Luca Weiss wrote: >>>>>>> On Dienstag, 21. Mai 2024 10:58:07 MESZ Krzysztof Kozlowski wrote: >>>>>>>> On 20/05/2024 17:11, Luca Weiss wrote: >>>>>>>>> Hi Krzysztof >>>>>>>>> >>>>>>>>> Ack, sounds good. >>>>>>>>> >>>>>>>>> Maybe also from you, any opinion between these two binding styles? >>>>>>>>> >>>>>>>>> So first using index of mboxes for the numbering, where for the known >>>>>>>>> usages the first element (and sometimes the 3rd - ipc-2) are empty <>. >>>>>>>>> >>>>>>>>> The second variant is using mbox-names to get the correct channel-mbox >>>>>>>>> mapping. >>>>>>>>> >>>>>>>>> - qcom,ipc-1 = <&apcs 8 13>; >>>>>>>>> - qcom,ipc-2 = <&apcs 8 9>; >>>>>>>>> - qcom,ipc-3 = <&apcs 8 19>; >>>>>>>>> + mboxes = <0>, <&apcs 13>, <&apcs 9>, <&apcs 19>; >>>>>>>>> >>>>>>>>> vs. >>>>>>>>> >>>>>>>>> - qcom,ipc-1 = <&apcs 8 13>; >>>>>>>>> - qcom,ipc-2 = <&apcs 8 9>; >>>>>>>>> - qcom,ipc-3 = <&apcs 8 19>; >>>>>>>>> + mboxes = <&apcs 13>, <&apcs 9>, <&apcs 19>; >>>>>>>>> + mbox-names = "ipc-1", "ipc-2", "ipc-3"; >>>>>>>> >>>>>>>> Sorry, don't get, ipc-1 is the first mailbox, so why would there be <0> >>>>>>>> in first case? >>>>>>> >>>>>>> Actually not, ipc-0 would be permissible by the driver, used for the 0th host >>>>>>> >>>>>>> e.g. from: >>>>>>> >>>>>>> /* Iterate over all hosts to check whom wants a kick */ >>>>>>> for (host = 0; host < smsm->num_hosts; host++) { >>>>>>> hostp = &smsm->hosts[host]; >>>>>>> >>>>>>> Even though no mailbox is specified in any upstream dts for this 0th host I >>>>>>> didn't want the bindings to restrict that, that's why in the first example >>>>>>> there's an empty element (<0>) for the 0th smsm host >>>>>>> >>>>>>>> Anyway, the question is if you need to know that some >>>>>>>> mailbox is missing. But then it is weird to name them "ipc-1" etc. >>>>>>> >>>>>>> In either case we'd just query the mbox (either by name or index) and then >>>>>>> see if it's there? Not quite sure I understand the sentence.. >>>>>>> Pretty sure either binding would work the same way. >>>>>> >>>>>> The question is: does the driver care only about having some mailboxes >>>>>> or the driver cares about each specific mailbox? IOW, is skipping ipc-0 >>>>>> important for the driver? >>>>> >>>>> There's nothing special from driver side about any mailbox. Some SoCs have >>>>> a mailbox for e.g. hosts 1&2&3, some have only 1&3, and apq8064 even has >>>>> 1&2&3&4. >>>>> >>>>> And if the driver doesn't find a mailbox for a host, it just ignores it >>>>> but then of course it can't 'ring' the mailbox for that host when necessary. >>>>> >>>>> Not sure how much more I can add here, to be fair I barely understand what >>>>> this driver is doing myself apart from the obvious. >>>> >>>> From what you said, it looks like it is enough to just list mailboxes, >>>> e.g. for ipc-1, ipc-2 and ipc-4 (so no ipc-0 and ipc-3): >>> >>> No, for sure we need also the possibility to list ipc-3. >> >> ? You can list it, what's the problem> > > Maybe we're talking past each other... > > You asked why this wouldn't work: > > e.g. for ipc-1, ipc-2 and ipc-4 (so no ipc-0 and ipc-3): > mboxes = <&apcs 13>, <&apcs 9>, <&apcs 19>; > > How would we know that the 3rd mailbox (&apcs 19) is for the 4th host > (previous ipc-4)? > > 1. If we use mboxes with indexes we'd need to have <0> values for > "smsm hosts" where we don't have a mailbox for - this is at least > for the 2nd smsm host (qcom,ipc-2) for a bunch of SoCs. > > 2. If we use mboxes with mbox-names then we could skip that since we > can directly specify which "smsm host" a given mailbox is for. > > My only question really is whether 1. or 2. is a better idea. > > Is this clearer now or still not? So again, does the driver care about missing entry? If so, why? Best regards, Krzysztof