Re: [PATCH v2 05/10] net: hisilicon: HI13X1_GMAX need dreq reset at first

2019-07-09 Thread Jiangfeng Xiao



On 2019/7/9 21:48, Jiangfeng Xiao wrote:
> 
> 
> On 2019/7/9 17:35, Sergei Shtylyov wrote:
>> Hello!
>>
>> On 09.07.2019 6:31, Jiangfeng Xiao wrote:
>>
[...]
>>> @@ -853,6 +867,15 @@ static int hip04_mac_probe(struct platform_device 
>>> *pdev)
>>>   goto init_fail;
>>>   }
>>>   +#if defined(CONFIG_HI13X1_GMAC)
>>> +res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
>>> +priv->sysctrl_base = devm_ioremap_resource(d, res);
>>
>>There's devm_platform_ioremap_resource() now.
> 
> Thank you for your review, Great issue, which makes my code more concise.
> 
> I will fix it in v3. Or submit a patch to modify it separately, if maintainer
> applies this patch series.
> 
I decided to wait for this series of patches to sync to the mainline
and then fix this based on the mainline.

Because the mainline does not currently have this part of the code,
if I submit the changes, and the patch is accidentally merged into
another branch or another maintainer to handle, a conflict will occur.

As we all know, maintianer has to deal with many commits every day,
I don't want to increase the burden of maintainer.

So I decided to wait until the patch is synced to the mainline
and then modify it, which is more safe.



Re: [PATCH v2 05/10] net: hisilicon: HI13X1_GMAX need dreq reset at first

2019-07-09 Thread Jiangfeng Xiao



On 2019/7/9 17:35, Sergei Shtylyov wrote:
> Hello!
> 
> On 09.07.2019 6:31, Jiangfeng Xiao wrote:
> 
>> HI13X1_GMAC delete request for soft reset at first,
>> otherwise, the subsequent initialization will not
>> take effect.
>>
>> Signed-off-by: Jiangfeng Xiao 
>> ---
>>   drivers/net/ethernet/hisilicon/hip04_eth.c | 24 
>>   1 file changed, 24 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c 
>> b/drivers/net/ethernet/hisilicon/hip04_eth.c
>> index fe61b01..19d8cfd 100644
>> --- a/drivers/net/ethernet/hisilicon/hip04_eth.c
>> +++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
> [...]
>> @@ -853,6 +867,15 @@ static int hip04_mac_probe(struct platform_device *pdev)
>>   goto init_fail;
>>   }
>>   +#if defined(CONFIG_HI13X1_GMAC)
>> +res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
>> +priv->sysctrl_base = devm_ioremap_resource(d, res);
> 
>There's devm_platform_ioremap_resource() now.

Thank you for your review, Great issue, which makes my code more concise.

I will fix it in v3. Or submit a patch to modify it separately, if maintainer
applies this patch series.



Re: [PATCH v2 05/10] net: hisilicon: HI13X1_GMAX need dreq reset at first

2019-07-09 Thread Sergei Shtylyov

Hello!

On 09.07.2019 6:31, Jiangfeng Xiao wrote:


HI13X1_GMAC delete request for soft reset at first,
otherwise, the subsequent initialization will not
take effect.

Signed-off-by: Jiangfeng Xiao 
---
  drivers/net/ethernet/hisilicon/hip04_eth.c | 24 
  1 file changed, 24 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c 
b/drivers/net/ethernet/hisilicon/hip04_eth.c
index fe61b01..19d8cfd 100644
--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
+++ b/drivers/net/ethernet/hisilicon/hip04_eth.c

[...]

@@ -853,6 +867,15 @@ static int hip04_mac_probe(struct platform_device *pdev)
goto init_fail;
}
  
+#if defined(CONFIG_HI13X1_GMAC)

+   res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+   priv->sysctrl_base = devm_ioremap_resource(d, res);


   There's devm_platform_ioremap_resource() now.


+   if (IS_ERR(priv->sysctrl_base)) {
+   ret = PTR_ERR(priv->sysctrl_base);
+   goto init_fail;
+   }
+#endif
+
ret = of_parse_phandle_with_fixed_args(node, "port-handle", 2, 0, );
if (ret < 0) {
dev_warn(d, "no port-handle\n");

[...]

MBR, Sergei