From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.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 4947116FF4E for ; Fri, 27 Sep 2024 07:48:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727423325; cv=none; b=uCtx734EWn3Cf4e7nnSs/8axTyd9g80Qmmlb7/ini2AgqqWy+1DJgFFw4ntolU2paqB5jHiJx52ar6sYP1+tYzjajkC+xazOIVDANj/VQv1BJsNgCbpOVkXyBuPE08lJQ7j1lzf/xT11NOdDqASHaFvTM8dOAAgEm6O18WwyVFs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727423325; c=relaxed/simple; bh=C+0z+9oD+EvuG+OzPQefzmEH2PUteYyKJn06IpQOBpo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kE6lvzeWhd03VnUfWqdq6NPO49Q8ghBce2o9NDepjxbW8qmq0FIwnjYMKKjbF0xA2ZaAym53BauxSnQgBqxEump9y5axj6nyHDONGtBN5+n7ACFhkSwF3gsEYrhMIFeBHuLUBB3B/8JkeNjvPR1JQg99/PpIq4maJAQ8jlSr9Nw= 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=AmSAQ1yo; arc=none smtp.client-ip=209.85.208.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="AmSAQ1yo" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5c462b14103so227837a12.2 for ; Fri, 27 Sep 2024 00:48:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727423321; x=1728028121; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=3pCqHS8QCjF3AyE7Hlns+lS+1rNia1GoqF6RaOHTvFo=; b=AmSAQ1yo+g9a4mJjNdlgPaFq8eyMu+Sc4XdZkAtmNBEDK+BFhX3/2jWmtpL/JF5ePP EQ8tIKaXCijKG9x5jkB+/QrAChSyrYnfQJS7W9FE6u4bYIsokghwpKqUx8annkCw5NNM jV77g5jUD+TcqU3zq5+6PZ+Ij1wUXYEMFjpOuc80Vrzyx0Ih600jJChKC6NcyzZZr3kF G+K3SjxhdU+NMy32wYvp7jPvy2O0+OFoI0jm3N3gjRzcW1alnTqVA+u2GPBzFwqlmFj5 Ccgbcg906U0FoJtCeHGizdw4fs2+NNngS3sck6GGV/jlrNq1myNakVmNQG3kuimMUwLl tHfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727423321; x=1728028121; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3pCqHS8QCjF3AyE7Hlns+lS+1rNia1GoqF6RaOHTvFo=; b=CZeelPEV3IiUZnKHc7ORAtr4Kgc6r+x4brXQ3Ry6gWLcSHmiU8Apn+kchjGyIxOQAK H9hPhKfjnEfZSTucQxA4tTeUoaXkUAOJwrmBHLLASh0c2AZMxhy8a/umYC3og9rK2aRr u+3wSCSZ9UBpKWbCt6h4wTiVGZWAFsvPRyYSdv5e2it0sx1xKVU9Zq1bEPdqg4+lvvwO ObKt+mITGHVAnqj+5ydOvnQwcKgPipaS03czFFYlptB4gIqRiA4mEc3g8SbHeLjdek83 5znaelj37E/9VnUXq5vSXdEh4aFLK2GZbz49cWwPSyGrcz38Z28jsHyJUMTkp8D8Y6a9 sgDw== X-Forwarded-Encrypted: i=1; AJvYcCUbwDofT1aEvE4q5IPoGDj+pijXRwSTS1P2uKxU9tgfiWdRXpJty+D+febYx6ZeGjfj9yZawpdmex2B@vger.kernel.org X-Gm-Message-State: AOJu0YxZ1mG02AH3W2pIAzW/Q3x6tB9ILEkR1cxQ0gGh7Gvt9DcxZVi6 TJlRoZl2RRO9XqEFylpysWaTHT3FzNxOkCeKYt4GCjM4oJ9kM3qXS39s6YtACtg= X-Google-Smtp-Source: AGHT+IG0ESOAAQflviCqGeX6WfN4wPdulS4UlAVTKzxCL3NXbTuIiTYdKxoRYwbi5RWXhNYBGjy/5w== X-Received: by 2002:a17:907:3f19:b0:a80:f54c:ad68 with SMTP id a640c23a62f3a-a93c48f001amr89324866b.2.1727423321482; Fri, 27 Sep 2024 00:48:41 -0700 (PDT) Received: from [192.168.0.18] (78-11-220-99.static.ip.netia.com.pl. [78.11.220.99]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c2948355sm97339666b.142.2024.09.27.00.48.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Sep 2024 00:48:40 -0700 (PDT) Message-ID: Date: Fri, 27 Sep 2024 09:48:39 +0200 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC 1/2] dt-bindings: connector: Add property to set pd timer values To: Amit Sunil Dhamne , robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, kyletso@google.com, rdbabiera@google.com, Badhri Jagan Sridharan , linux-usb@vger.kernel.org, devicetree@vger.kernel.org References: <20240911000715.554184-1-amitsd@google.com> <20240911000715.554184-2-amitsd@google.com> <2dab1111-49fd-43b7-8624-2d61b3d546b1@google.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzysztof.kozlowski@linaro.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 TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzTRLcnp5c3p0b2Yg S296bG93c2tpIDxrcnp5c3p0b2Yua296bG93c2tpQGxpbmFyby5vcmc+wsGUBBMBCgA+FiEE m9B+DgxR+NWWd7dUG5NDfTtBYpsFAmI+BxMCGwMFCRRfreEFCwkIBwIGFQoJCAsCBBYC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lA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <2dab1111-49fd-43b7-8624-2d61b3d546b1@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 17/09/2024 03:59, Amit Sunil Dhamne wrote: > Hi Krzysztof, > > Thanks for the review! > > On 9/16/24 9:05 AM, Krzysztof Kozlowski wrote: >> On 11/09/2024 02:07, Amit Sunil Dhamne wrote: >>> This commit adds a new property "pd-timers" to enable setting of >>> platform/board specific pd timer values for timers that have a range of >>> acceptable values. >>> >>> Cc: Badhri Jagan Sridharan >>> Cc: linux-usb@vger.kernel.org >>> Cc: devicetree@vger.kernel.org >>> Signed-off-by: Amit Sunil Dhamne >> Please work on mainline, not ancient tree. You cannot get my CC address >> like that from mainline. > I was working off gregkh's tree on usb-next branch as that's suggested > for USB development. > > >> It's not possible. So either you don't develop >> on mainline or you don't use get_maintainers.pl/b4/patman. >> > The above branch and even the tree on Linus' master branch has you > listed as a maintainer > (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/MAINTAINERS#n17181). > I guess that's why the get_maintainers script probably returned your > email id when I ran it. Please let me know if I missed something :). You really just skimmed over my email... I know how maintainers work. So I REPEAT: You cannot get this email address you Cced. Point me to the line in your tree having such email. The one here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/MAINTAINERS#n17181 does not have it. > > >>> --- >>> .../bindings/connector/usb-connector.yaml | 23 +++++++++++++++++++ >>> include/dt-bindings/usb/pd.h | 8 +++++++ >>> 2 files changed, 31 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/connector/usb-connector.yaml b/Documentation/devicetree/bindings/connector/usb-connector.yaml >>> index fb216ce68bb3..9be4ed12f13c 100644 >>> --- a/Documentation/devicetree/bindings/connector/usb-connector.yaml >>> +++ b/Documentation/devicetree/bindings/connector/usb-connector.yaml >>> @@ -253,6 +253,16 @@ properties: >>> >>> additionalProperties: false >>> >>> + pd-timers: >>> + description: An array of u32 integers, where an even index (i) is the timer (referenced in >>> + dt-bindings/usb/pd.h) and the odd index (i+1) is the timer value in ms (refer >> timer of what? OS behavior? > In the context of USB Type C Power Delivery (PD), timers are run on the > typec protocol driver > (usb/typec/tcpm/tcpm.c). > These are used to keep track of min/max or range of time required to > enter a PD state with the > goal of a successful USB typec capabilities negotiation.  Eg., the timer > PD_TIMER_SINK_WAIT_CAP (referred to as SinkWaitCapTimer in spec)would be > responsible to keep track of whether a power source sent us (as sink) PD > source capabilities pkts within 600ms (say), if yes, then we would > transition to the next state or do a state machine reset. USB PD 3.1 > spec refers to these elements as timers and therefore referred to as > such here. > > >>> + "Table 6-68 Time Values" of "USB Power Delivery Specification Revision 3.0, Version 1.2 " for >>> + the appropriate value). For certain timers the PD spec defines a range rather than a fixed >>> + value. The timers may need to be tuned based on the platform. This dt property allows the user >> Do not describe what DT is. We all know what DT properties allow. >> Instead describe how this relates to hardware or boards. >> >> All this is wrongly wrapped. See Coding style (and I am not telling you >> the value on purpose, so you will read the coding style) . > > > Ack. Thanks for pointing it out, I will fix both the above in the next > revision. > > >> >>> + to assign specific values based on the platform. If these values are not explicitly defined, >>> + TCPM will use a valid default value for such timers. >> And what is the default? > > Defaults are given in (include/linux/usb/pd.h). But I guess I should > have probably mentioned > that here. > > >> >>> + $ref: /schemas/types.yaml#/definitions/uint32-array >> I guess you want matrix here. > > Yes, I should have. Though, I will be re-implementing this such that > each timer is represented > as a separate property based on Rob and Dmitry's suggestion in > https://lore.kernel.org/lkml/20240916163328.GA394032-robh@kernel.org/ . > >>> + >>> dependencies: >>> sink-vdos-v1: [ sink-vdos ] >>> sink-vdos: [ sink-vdos-v1 ] >>> @@ -478,3 +488,16 @@ examples: >>> }; >>> }; >>> }; >>> + >>> + # USB-C connector with PD timers >>> + - | >>> + #include >>> + usb { >>> + connector { >>> + compatible = "usb-c-connector"; >>> + label = "USB-C"; >>> + pd-timers = >>> + , >>> + ; >> Incorporate it into existing example. >> > Ack. > > >>> + }; >>> + }; >>> diff --git a/include/dt-bindings/usb/pd.h b/include/dt-bindings/usb/pd.h >>> index e6526b138174..6c58c30f3f39 100644 >>> --- a/include/dt-bindings/usb/pd.h >>> +++ b/include/dt-bindings/usb/pd.h >>> @@ -465,4 +465,12 @@ >>> | ((vbm) & 0x3) << 15 | (curr) << 14 | ((vbi) & 0x3f) << 7 \ >>> | ((gi) & 0x3f) << 1 | (ct)) >>> >>> +/* PD Timer definitions */ >>> +/* tTypeCSinkWaitCap (Table 6-68 Time Values, USB PD3.1 Spec) */ >> Please expand this a bit, so we won't have to reach to external sources. > > Ack. > > I will incorporate all of your review comments. > > Since you are no longer maintaining the > "OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" component, please let Who said that? You CC wrong emails because either you work on ancient tree or you do not use tools like get_maintainers.pl or b4. You cannot get this email from proper process. It is not physically possible because that email is nowhere mentioned. > me know > if you'd still like to be CC'ed in the subsequent revisions. Damn, just use standard tools. You are not supposed to invent maintainers.
Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC (and consider --no-git-fallback argument). It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel. Tools like b4 or scripts/get_maintainer.pl provide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember about `b4 prep --auto-to-cc` if you added new patches to the patchset.
Best regards, Krzysztof