diff mbox series

[RESEND,V2,net,5/7] net: hns3: initialize reset_timer before hclgevf_misc_irq_init()

Message ID 20241217010839.1742227-6-shaojijie@huawei.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series There are some bugfix for the HNS3 ethernet driver | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net, async
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 1 blamed authors not CCed: linyunsheng@huawei.com; 2 maintainers not CCed: lanhao@huawei.com linyunsheng@huawei.com
netdev/build_clang success Errors and warnings before: 5 this patch: 5
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-12-19--00-00 (tests: 880)

Commit Message

Jijie Shao Dec. 17, 2024, 1:08 a.m. UTC
From: Jian Shen <shenjian15@huawei.com>

Currently the misc irq is initialized before reset_timer setup. But
it will access the reset_timer in the irq handler. So initialize
the reset_timer earlier.

Fixes: ff200099d271 ("net: hns3: remove unnecessary work in hclgevf_main")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michal Swiatkowski Dec. 18, 2024, 9:20 a.m. UTC | #1
On Tue, Dec 17, 2024 at 09:08:37AM +0800, Jijie Shao wrote:
> From: Jian Shen <shenjian15@huawei.com>
> 
> Currently the misc irq is initialized before reset_timer setup. But
> it will access the reset_timer in the irq handler. So initialize
> the reset_timer earlier.
> 
> Fixes: ff200099d271 ("net: hns3: remove unnecessary work in hclgevf_main")
> Signed-off-by: Jian Shen <shenjian15@huawei.com>
> Signed-off-by: Jijie Shao <shaojijie@huawei.com>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
>  drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
> index fd0abe37fdd7..8739da317897 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
> @@ -2313,6 +2313,7 @@ static void hclgevf_state_init(struct hclgevf_dev *hdev)
>  	clear_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state);
>  
>  	INIT_DELAYED_WORK(&hdev->service_task, hclgevf_service_task);
Comment here that timer needs to be initialized before misc irq will be
nice, but that is onlu my impression.

Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

Thanks
> +	timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
>  
>  	mutex_init(&hdev->mbx_resp.mbx_mutex);
>  	sema_init(&hdev->reset_sem, 1);
> @@ -3012,7 +3013,6 @@ static int hclgevf_init_hdev(struct hclgevf_dev *hdev)
>  		 HCLGEVF_DRIVER_NAME);
>  
>  	hclgevf_task_schedule(hdev, round_jiffies_relative(HZ));
> -	timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
>  
>  	return 0;
>  
> -- 
> 2.33.0
Jijie Shao Dec. 19, 2024, 11:48 a.m. UTC | #2
on 2024/12/18 17:20, Michal Swiatkowski wrote:
> On Tue, Dec 17, 2024 at 09:08:37AM +0800, Jijie Shao wrote:
>> From: Jian Shen <shenjian15@huawei.com>
>>
>> Currently the misc irq is initialized before reset_timer setup. But
>> it will access the reset_timer in the irq handler. So initialize
>> the reset_timer earlier.
>>
>> Fixes: ff200099d271 ("net: hns3: remove unnecessary work in hclgevf_main")
>> Signed-off-by: Jian Shen <shenjian15@huawei.com>
>> Signed-off-by: Jijie Shao <shaojijie@huawei.com>
>> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
>> ---
>>   drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
>> index fd0abe37fdd7..8739da317897 100644
>> --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
>> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
>> @@ -2313,6 +2313,7 @@ static void hclgevf_state_init(struct hclgevf_dev *hdev)
>>   	clear_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state);
>>   
>>   	INIT_DELAYED_WORK(&hdev->service_task, hclgevf_service_task);
> Comment here that timer needs to be initialized before misc irq will be
> nice, but that is onlu my impression.


I'll add a comment in the next version.

Thanks,
Jijie Shao

>
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
>
> Thanks
>> +	timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
>>   
>>   	mutex_init(&hdev->mbx_resp.mbx_mutex);
>>   	sema_init(&hdev->reset_sem, 1);
>> @@ -3012,7 +3013,6 @@ static int hclgevf_init_hdev(struct hclgevf_dev *hdev)
>>   		 HCLGEVF_DRIVER_NAME);
>>   
>>   	hclgevf_task_schedule(hdev, round_jiffies_relative(HZ));
>> -	timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
>>   
>>   	return 0;
>>   
>> -- 
>> 2.33.0
diff mbox series

Patch

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index fd0abe37fdd7..8739da317897 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -2313,6 +2313,7 @@  static void hclgevf_state_init(struct hclgevf_dev *hdev)
 	clear_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state);
 
 	INIT_DELAYED_WORK(&hdev->service_task, hclgevf_service_task);
+	timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
 
 	mutex_init(&hdev->mbx_resp.mbx_mutex);
 	sema_init(&hdev->reset_sem, 1);
@@ -3012,7 +3013,6 @@  static int hclgevf_init_hdev(struct hclgevf_dev *hdev)
 		 HCLGEVF_DRIVER_NAME);
 
 	hclgevf_task_schedule(hdev, round_jiffies_relative(HZ));
-	timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
 
 	return 0;