lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a71f45fc-d266-447d-8fb0-1ff0897f5bff@whut.edu.cn>
Date: Wed, 9 Apr 2025 17:43:41 +0800
From: Ze Huang <huangze@...t.edu.cn>
To: Krzysztof Kozlowski <krzk@...nel.org>, Vinod Koul <vkoul@...nel.org>,
 Kishon Vijay Abraham I <kishon@...nel.org>, Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, Yixun Lan <dlan@...too.org>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Philipp Zabel <p.zabel@...gutronix.de>,
 Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
 Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt
 <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
 Alexandre Ghiti <alex@...ti.fr>
Cc: linux-phy@...ts.infradead.org, devicetree@...r.kernel.org,
 linux-riscv@...ts.infradead.org, spacemit@...ts.linux.dev,
 linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH 5/7] phy: spacemit: add USB3 support for K1 PCIe/USB3
 combo PHY

On 4/7/25 9:28 PM, Krzysztof Kozlowski wrote:
> On 07/04/2025 14:38, Ze Huang wrote:
>> Add support for USB 3.0 mode on the K1 PCIe/USB3 combo PHY. Currently,
>> only USB mode is supported; PCIe support is not included in this change.
>>
>> Signed-off-by: Ze Huang <huangze@...t.edu.cn>
>> ---
>>   drivers/phy/spacemit/Kconfig          |   8 ++
>>   drivers/phy/spacemit/Makefile         |   1 +
>>   drivers/phy/spacemit/phy-k1-combphy.c | 229 ++++++++++++++++++++++++++++++++++
>>   3 files changed, 238 insertions(+)
>>
>> diff --git a/drivers/phy/spacemit/Kconfig b/drivers/phy/spacemit/Kconfig
>> index f0c2a33f53cc810e71c6140ae957aa68a2b6ff0c..12749aba756329cf64fb9199055ba484fe05f3ab 100644
>> --- a/drivers/phy/spacemit/Kconfig
>> +++ b/drivers/phy/spacemit/Kconfig
>> @@ -10,3 +10,11 @@ config PHY_SPACEMIT_K1_USB2
>>   	help
>>   	  Enable this to support K1 USB 2.0 PHY driver. This driver takes care of
>>   	  enabling and clock setup and will be used by K1 udc/ehci/otg driver.
>> +
>> +config PHY_SPACEMIT_K1_COMBPHY
>> +	tristate "SpacemiT K1 PCIe/USB3 combo PHY support"
>> +	depends on OF
>> +	select GENERIC_PHY
>> +	default ARCH_SPACEMIT && USB_DWC3_SPACEMIT
>> +	help
>> +	  USB3/PCIe Combo PHY Support for SpacemiT K1 SoC
> Missing depends on ARCH_SPACEMIT || COMPILE_TEST

Will fix, thanks!

>
> ...
>
>
>> +	priv->phy = devm_phy_create(dev, NULL, &spacemit_combphy_ops);
>> +	if (IS_ERR(priv->phy))
>> +		return dev_err_probe(dev, PTR_ERR(priv->phy),
>> +				     "failed to create combphy\n");
>> +
>> +	dev_set_drvdata(dev, priv);
>> +	phy_set_drvdata(priv->phy, priv);
> Both make no sense. Look what this function does.

It does seem redundant at first glance, but pdev->dev is the parent of 
phy->dev.
pdev->dev->driver_data will be used in spacemit_combphy_xlate()
phy->dev->driver_data  will be used in phy_ops functions

I've checked some other drivers that did the same:
     - phy-zynqmp.c at lines 990 and 1026
     - phy-rockchip-samsung-hdptx.c at lines 1989 and 2000

>
> Best regards,
> Krzysztof
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ