Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp797816lqp; Wed, 22 May 2024 23:19:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX27mzHPqmpgs6Bzjgu7Qvszwpwt2R4w4KO/0TIqT2eHdPxu+91HSf4CK5jeCHjz5SryI20+2DYfnJsox2XVLVnWuixVy/X4yC4LO2fow== X-Google-Smtp-Source: AGHT+IEH3vy0+BpFM3Sbu6IOdo4KigrEgXKkfQ52CyYeMBWoVdlGOP2efp+MClmNnaDe8i5Hgltv X-Received: by 2002:ac8:5e49:0:b0:43a:ecfb:8a5c with SMTP id d75a77b69052e-43f9e124359mr55774951cf.40.1716445168374; Wed, 22 May 2024 23:19:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716445168; cv=pass; d=google.com; s=arc-20160816; b=ssCeFknzaU1UpmnSwd5XZNVOmWQPGo3Fe8PDtpArcEDooaaZb2Fk5TUxztvDy+RboP KFoV67/gadBiCuswAngqM20dJ9ZBzGwhGUkqogIRz9ojBrLO3Z6jzoTDgWjDlt682hgl KCxT5Mw7VKXsKFruzCPEfj4APN9MYbGjbLoRXgPIRgxr2UO52dalj2hTNbjJsRUEex6C HHjRwUJeLHVYyjxeVXIDi4uAgU2QFnRmV7/lsGVRBidF1SbJqD8ubH2wcwfUsIucPCRy 6882pCaWmdU8/RZ3hBs1GCpkXo1tFzOPSSQnxAdAfXAi0q9EbRbYpfk7DII53FbByBm3 Lctw== 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=KFW2wFJ4uBCJXrMOSVeImj5fP0ODc7NBpO2yPahcXp8=; fh=24cc7K+EAZVLihACZpxhWCzu/pCOjKkmRYFxKWyKBOc=; b=gyXeNz2Q4/0TJLIUY26bsEOuYmEygohgEYA82u+ZPJwhHVYbWGAW5xr/GRrX3HDX9F 6JtZUaM2Hs/ZLzohzv9/gorJw+mf7Nq+uskUaFeMNsA2w/HnceGGHRNnCIwhKclANVqe ANHgJ24IEgFMArcV8vcrMXAXVL4xOW4T5kNBjYAl8WpWT0eURFg41ok34k4ch8bD0B3v oFKJOWM4+vbsD10o3r46krdHpQk7OZYCc8gQZOgtkaM88BndPvFnGzGyxRbI9h5XRUFk AHoEFEJwBcdk0lHTjJs0djonxLaEvJKrK6dphT47NFNpm9zdalzFRxvFZhRSaGsg2xGK 5E7w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G84jSHXZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-187041-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187041-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43df54b55ebsi13668551cf.218.2024.05.22.23.19.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 23:19:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187041-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G84jSHXZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-187041-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187041-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 120A11C21D1E for ; Thu, 23 May 2024 06:19:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 012E713B597; Thu, 23 May 2024 06:19:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="G84jSHXZ" 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 D8D5D187F; Thu, 23 May 2024 06:19:17 +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=1716445158; cv=none; b=GVJnkHZkoQ82/iwotY91ux1uSw2qPeqwAhsoYv2klmxlz7x9oMPvXNYmFzAPz24c+1C1QSQWpF904b5M/ZVxEx5EVTMTRK2DXE6aA8NS7YvStXjRcET1J29/p82aCipYB5TAwNhgS+wt+SmsYvGxAsNEzqfn4CTtXALHk/bLyok= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716445158; c=relaxed/simple; bh=8zHA0HU2AbRI7s7cejYhTpjhS07bLPkgGzXqxwDglsw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=AKsistQhql/D2Rou56c2hY7+DKuYbNk5bv0r1X2+o0w4GWzftFcuTz6ZvuvpieWP4iHcC1IgcR03RoQFE8f6z9guAH8vDkuCWPBoi5uwVp4Vh7snxfcW0C4fgE28jsiFQkK779BnGC5wezT+9a+6fq9QAm6T+HnTHL8yiwxPmuc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=G84jSHXZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5C20C2BD10; Thu, 23 May 2024 06:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716445157; bh=8zHA0HU2AbRI7s7cejYhTpjhS07bLPkgGzXqxwDglsw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=G84jSHXZsPZbgtATo0PIlB91aprBi3Lig4z09Esp9z+lXtr9fLABITgYa8z38bGnX q/eujJXu9dXdZAs3CajrXjzOFboP3p/29NBDnNfEkszkUcU9PfaRrri78EIRhc23tV /g1jxjHBcZCDWOQjWVBcuTLXwiQkemvlPh4ZA64R9KxW8DaNAuy3IEIasFKWx8shzF ZDYlsUo+upflB9MryCVxJqHCBSh32iGi7mgAIxLVU9B9z/Ph/hqJ5mFpQgLk47BUzu 0X5lPhI4Y/CZR/WOUxa6Xg7vlqVbkXXqkBPcaUVL2p4k6BNrNZdPMkE/5m0JSoKCMd CBFsWctBcouBA== Message-ID: Date: Thu, 23 May 2024 08:19:11 +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 Cc: ~postmarketos/upstreaming@lists.sr.ht, 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> <6253429.lOV4Wx5bFT@g550jk> <5099926.GXAFRqVoOG@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+XgC0LDqrsW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926.GXAFRqVoOG@g550jk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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> > > And my point is that I'm not sure if any platform will ever need ipc-0, but > the code to use that if it ever exists is there - the driver always > tries getting an mbox (currently just syscon of course) for every host > from 0 to n. > > These are the current (non-mbox-API) mboxes provided to smsm: > > $ git grep qcom,ipc- arch/ > arch/arm/boot/dts/qcom/qcom-apq8064.dtsi: qcom,ipc-1 = <&l2cc 8 4>; > arch/arm/boot/dts/qcom/qcom-apq8064.dtsi: qcom,ipc-2 = <&l2cc 8 14>; > arch/arm/boot/dts/qcom/qcom-apq8064.dtsi: qcom,ipc-3 = <&l2cc 8 23>; > arch/arm/boot/dts/qcom/qcom-apq8064.dtsi: qcom,ipc-4 = <&sps_sic_non_secure 0x4094 0>; > arch/arm/boot/dts/qcom/qcom-msm8974.dtsi: qcom,ipc-1 = <&apcs 8 13>; > arch/arm/boot/dts/qcom/qcom-msm8974.dtsi: qcom,ipc-2 = <&apcs 8 9>; > arch/arm/boot/dts/qcom/qcom-msm8974.dtsi: qcom,ipc-3 = <&apcs 8 19>; > arch/arm64/boot/dts/qcom/msm8916.dtsi: qcom,ipc-1 = <&apcs 8 13>; > arch/arm64/boot/dts/qcom/msm8916.dtsi: qcom,ipc-3 = <&apcs 8 19>; > arch/arm64/boot/dts/qcom/msm8939.dtsi: qcom,ipc-1 = <&apcs1_mbox 8 13>; > arch/arm64/boot/dts/qcom/msm8939.dtsi: qcom,ipc-3 = <&apcs1_mbox 8 19>; > arch/arm64/boot/dts/qcom/msm8953.dtsi: qcom,ipc-1 = <&apcs 8 13>; > arch/arm64/boot/dts/qcom/msm8953.dtsi: qcom,ipc-3 = <&apcs 8 19>; > arch/arm64/boot/dts/qcom/msm8976.dtsi: qcom,ipc-1 = <&apcs 8 13>; > arch/arm64/boot/dts/qcom/msm8976.dtsi: qcom,ipc-2 = <&apcs 8 9>; > arch/arm64/boot/dts/qcom/msm8976.dtsi: qcom,ipc-3 = <&apcs 8 19>; > >> >> mboxes = <&apcs 13>, <&apcs 9>, <&apcs 19>; So which case is not covered? Best regards, Krzysztof