Linux-PHY Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Yang Xiwen <forbidden405@outlook.com>,
	Vinod Koul <vkoul@kernel.org>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jiancheng Xue <xuejiancheng@hisilicon.com>,
	Shawn Guo <shawn.guo@linaro.org>,
	Philipp Zabel <p.zabel@pengutronix.de>
Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Kishon Vijay Abraham I <kishon@ti.com>,
	David Yang <mmyangfl@gmail.com>
Subject: Re: [PATCH RFC v3 1/5] dt-bindings: phy: hisi-inno-usb2: convert to YAML
Date: Tue, 20 Feb 2024 12:41:54 +0100	[thread overview]
Message-ID: <bf4ce87a-51ab-49e1-ac70-c463d8008a62@linaro.org> (raw)
In-Reply-To: <SEZPR06MB69594A5036F122CE6C14043C96502@SEZPR06MB6959.apcprd06.prod.outlook.com>

On 20/02/2024 11:40, Yang Xiwen wrote:
> On 2/20/2024 4:16 PM, Krzysztof Kozlowski wrote:
>> On 19/02/2024 22:49, Yang Xiwen wrote:
>>> On 2/20/2024 5:37 AM, Krzysztof Kozlowski wrote:
>>>> On 19/02/2024 22:35, Yang Xiwen wrote:
>>>>> On 2/20/2024 5:32 AM, Krzysztof Kozlowski wrote:
>>>>>> On 19/02/2024 22:27, Yang Xiwen via B4 Relay wrote:
>>>>>>> From: Yang Xiwen <forbidden405@outlook.com>
>>>>>>>
>>>>>>> Add missing compatible "hisilicon,hi3798mv100-usb2-phy" to compatible
>>>>>>> list due to prior driver change.
>>>>>>>
>>>>>>> Also rename to hisilicon,inno-usb2-phy.yaml and add this name to
>>>>>>> compatible lists.
>>>>>>>
>>>>>>> Fixes: 3940ffc65492 ("phy: hisilicon: Add inno-usb2-phy driver for Hi3798MV100")
>>>>>>> Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
>>>>>>> ---
>>>>>>>     .../bindings/phy/hisilicon,inno-usb2-phy.yaml      | 95 ++++++++++++++++++++++
>>>>>>>     .../devicetree/bindings/phy/phy-hisi-inno-usb2.txt | 71 ----------------
>>>>>>>     2 files changed, 95 insertions(+), 71 deletions(-)
>>>>>>>
>>>>>>> diff --git a/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml
>>>>>>> new file mode 100644
>>>>>>> index 000000000000..1b57e0396209
>>>>>>> --- /dev/null
>>>>>>> +++ b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml
>>>>>>> @@ -0,0 +1,95 @@
>>>>>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>>>>>> +%YAML 1.2
>>>>>>> +---
>>>>>>> +$id: http://devicetree.org/schemas/phy/hisilicon,inno-usb2-phy.yaml#
>>>>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>>>>> +
>>>>>>> +title: HiSilicon HiSTB SoCs INNO USB2 PHY device
>>>>>>> +
>>>>>>> +maintainers:
>>>>>>> +  - Yang Xiwen <forbidden405@outlook.com>
>>>>>>> +
>>>>>>> +properties:
>>>>>>> +  compatible:
>>>>>>> +    items:
>>>>>>> +      - enum:
>>>>>>> +          - hisilicon,hi3798cv200-usb2-phy
>>>>>>> +          - hisilicon,hi3798mv100-usb2-phy
>>>>>>> +      - const: hisilicon,inno-usb2-phy
>>>>>> According to your driver hisilicon,hi3798mv100-usb2-phy and
>>>>>> hisilicon,inno-usb2-phy are not compatible.
>>>>> Ah, i didn't pay too much attention to that. I should remove the entry
>>>>> for hisilicon,inno-usb2-phy in the driver. Sorry for that.
>>>> We don't talk here about driver, although I used the driver as proof or
>>>> argument, because I don't have access to hardware datasheet (and no
>>>> intention to look there).
>>>>
>>>> What I claim is these are not compatible, so respond to this argument,
>>>> not some other one.
>>> Why not? Of course they are compatible. All 3 SoCs are using
>> Why? Because...
>>
>>> inno-usb2-phy. The only difference here is the method to access the
>> ... here! Different programming interface means not compatible.
>>
>> Please provide instead any argument that they are compatible, in the
>> meaning of Devicetree of course. You are claiming inno-usb2-phy  can be
>> used for hi3798mv100 and it will work fine?
>>
>>> registers. They are all enabled by `writing BIT(2) to address 0x6`. In
>>> the cover letter, I said the driver is actually doing things wrong.
>> Cover letter does not matter, I don't even read them. Your commits matter.
>>
>>> Especially the commit adding PHY_TYPE enums, the name is confusing and
>>> conveys the wrong info. It's not PHY which are not compatible, it's the
>>> bus. I'll fix the driver, but still the PHY hardwares are compatible
>>> between these 3 SoCs.
>> Provide any argument.
> 
> Just take a look at the driver. hisi_inno_phy_write_reg() is the 
> function that differs between different models. But for all of them, 
> hisi_inno_phy_setup() is the same.
> 
> 
> hisi_inno_phy_write_reg() should be moved to a separate bus driver. It's 
> bus-related, not phy. PHY driver should not care how to access the bus, 

So drivers are compatible or hardware? We talk about hardware, not
drivers...

> but the bus driver should. The PHY driver only needs to use regmap_* 
> APIs to "write BIT(2) to addr 6".

Different programming interface, so not compatible.

> 
> 
> For mv100 and cv200, the PHY master bus interface is attached to the 
> perictrl core in SoC (though the perictrl core provides slightly 
> different register offsets to access the PHY bus). For mv200, it is 
> directly attached to AHB/APB system bus so we don't need to put it under 
> a perictrl node anymore. So here, clearly it's the bus the PHY attached 

Different programming interface, so not compatible.

> to which is different, not the PHY itself.
> 
> 
> That's why i say the driver is wrong from the beginning. It's mixing PHY 


I don't care. We do not talk about drivers.

> driver and bus driver together but they ought to be different. PHY is 
> always compatible, but the bus is not.

Do you understand what does it mean "compatible" in DT?

> 
> 
> The correct fix should be moving hisi_inno_phy_write_reg() to a new bus 
> driver and migrating to regmap_* APIs in PHY driver. But i'll have to 

Don't care. Driver stuff.

> write a new driver for that, which i try to avoid (it takes too much 
> time!). So i said clearly in the cover-letter this should be considered 
> a hack.


Best regards,
Krzysztof


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2024-02-20 11:42 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 21:27 [PATCH RFC v3 0/5] phy: hisi-inno-phy: add support for hi3798mv200-usb2-phy Yang Xiwen via B4 Relay
2024-02-19 21:27 ` [PATCH RFC v3 1/5] dt-bindings: phy: hisi-inno-usb2: convert to YAML Yang Xiwen via B4 Relay
2024-02-19 21:30   ` Krzysztof Kozlowski
2024-02-19 21:33     ` Yang Xiwen
2024-02-19 21:36       ` Krzysztof Kozlowski
2024-02-19 21:50         ` Yang Xiwen
2024-02-19 21:32   ` Krzysztof Kozlowski
2024-02-19 21:35     ` Yang Xiwen
2024-02-19 21:37       ` Krzysztof Kozlowski
2024-02-19 21:49         ` Yang Xiwen
2024-02-20  8:16           ` Krzysztof Kozlowski
2024-02-20 10:40             ` Yang Xiwen
2024-02-20 11:41               ` Krzysztof Kozlowski [this message]
2024-02-20 11:43                 ` Krzysztof Kozlowski
2024-02-20 12:12                   ` Yang Xiwen
2024-02-21  8:22                     ` Krzysztof Kozlowski
2024-02-21  8:25                       ` Krzysztof Kozlowski
2024-02-21 11:15                         ` Yang Xiwen
2024-02-21 10:05                       ` Yang Xiwen
2024-02-21  8:23                   ` Krzysztof Kozlowski
2024-02-19 22:33   ` Rob Herring
2024-02-19 21:27 ` [PATCH RFC v3 2/5] arm64: dts: hi3798cv200: add hisilicon,inno-usb2-phy to compatible list Yang Xiwen via B4 Relay
2024-02-19 21:28 ` [PATCH RFC v3 3/5] phy: hisilicon: hisi-inno-phy: enable clocks for every ports Yang Xiwen via B4 Relay
2024-02-19 21:28 ` [PATCH RFC v3 4/5] phy: hisilicon: hisi-inno-phy: add support for Hi3798MV200 INNO PHY Yang Xiwen via B4 Relay
2024-02-19 21:34   ` Krzysztof Kozlowski
2024-02-19 21:37     ` Yang Xiwen
2024-02-21 12:53   ` Philipp Zabel
2024-02-19 21:28 ` [PATCH RFC v3 5/5] dt-bindings: phy: hisi-inno-usb2: add compatible of hisilicon,hi3798mv200-usb2-phy Yang Xiwen via B4 Relay
2024-02-19 21:35   ` Krzysztof Kozlowski
2024-02-20  8:18   ` Krzysztof Kozlowski
2024-02-20  9:25     ` Yang Xiwen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf4ce87a-51ab-49e1-ac70-c463d8008a62@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=forbidden405@outlook.com \
    --cc=kishon@kernel.org \
    --cc=kishon@ti.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=mmyangfl@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=shawn.guo@linaro.org \
    --cc=vkoul@kernel.org \
    --cc=xuejiancheng@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox