net/mlx4_core: pass pci_device_id.driver_data to __mlx4_init_one during reset
Subsystems (3)
PATCH RESEND 1/1 net/mlx4_core: pass pci_device_id.driver_data to __mlx4_init_one during reset
[Note: seems my network/mail system got some problem yesterday. Resend it in case it is lost. If you have already got one, please ignore it.]
The second parameter of __mlx4_init_one() is used to identify whether the pci_dev is a PF or VF. Currently, when it is invoked in mlx4_pci_slot_reset() this information is missed.
This patch match the pci_dev with mlx4_pci_table and passes the pci_device_id.driver_data to __mlx4_init_one() in mlx4_pci_slot_reset().
--- drivers/net/ethernet/mellanox/mlx4/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx4/main.c +5 -1
@@ -2670,7 +2670,11 @@ static pci_ers_result_t mlx4_pci_err_detected(struct pci_dev *pdev,static pci_ers_result_t mlx4_pci_slot_reset (struct pci_dev *pdev) { -int ret =__mlx4_init_one (pdev,0 ); +const struct pci_device_id * id; +int ret; + + id =pci_match_id (mlx4_pci_table, pdev); + ret =__mlx4_init_one (pdev, id->driver_data);return ret ?PCI_ERS_RESULT_DISCONNECT :PCI_ERS_RESULT_RECOVERED ; }
Signature · 1 line
1.7.9.5
Hello.
Quoted 2 lines · Wei Yang
[Note: seems my network/mail system got some problem yesterday. Resend it in case it is lost. If you have already got one, please ignore it.]
Put such remarks under --- tear line in the future, so that David don't
have to edit them out when applying.
Quoted 17 lines
The second parameter of
__mlx4_init_one()is used to identify whether thepci_devis a PF or VF. Currently, when it is invoked inmlx4_pci_slot_reset()this information is missed.This patch match the
pci_devwithmlx4_pci_tableand passes the pci_device_id.driver_data to__mlx4_init_one()inmlx4_pci_slot_reset().Signed-off-by Wei Yang <[email protected]>--- drivers/net/ethernet/mellanox/mlx4/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/net/ethernet/mellanox/mlx4/main.c +0
-0
drivers/net/ethernet/mellanox/mlx4/main.c static pci_ers_result_t mlx4_pci_err_detected(struct pci_dev *pdev, · line 2673
Quoted 5 lines
drivers/net/ethernet/mellanox/mlx4/main.c +1
-1@@ -2670,7 +2670,11 @@ static pci_ers_result_t mlx4_pci_err_detected(struct pci_dev *pdev,static pci_ers_result_t mlx4_pci_slot_reset (struct pci_dev *pdev) { -int ret =__mlx4_init_one (pdev,0 ); +const struct pci_device_id * id;
* should be close to 'id' and one space is enough. I guess you haven't run
your patch thru scripts/checkpatch.pl?
WBR, Sergei
Quoted 9 lines · Sergei Shtylyov
Hello.
Quoted 2 lines · Wei Yang
[Note: seems my network/mail system got some problem yesterday. Resend it in case it is lost. If you have already got one, please ignore it.]
Put such remarks under --- tear line in the future, so that David
don't have to edit them out when applying.
Thanks, first time I got this tip. Will do this next time :-)
Quoted 19 lines
Quoted 19 lines
The second parameter of
__mlx4_init_one()is used to identify whether thepci_devis a PF or VF. Currently, when it is invoked inmlx4_pci_slot_reset()this information is missed.This patch match the
pci_devwithmlx4_pci_tableand passes the pci_device_id.driver_data to__mlx4_init_one()inmlx4_pci_slot_reset().Signed-off-by Wei Yang <[email protected]>--- drivers/net/ethernet/mellanox/mlx4/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/net/ethernet/mellanox/mlx4/main.c +0
-0@@ -2670,7 +2670,11 @@ static pci_ers_result_t mlx4_pci_err_detected(struct pci_dev *pdev,
Quoted 7 lines
drivers/net/ethernet/mellanox/mlx4/main.c static pci_ers_result_t mlx4_pci_err_detected(struct pci_dev *pdev, · line 2673
Quoted 4 lines
drivers/net/ethernet/mellanox/mlx4/main.c +1
-1static pci_ers_result_t mlx4_pci_slot_reset (struct pci_dev *pdev) { -int ret =__mlx4_init_one (pdev,0 ); +const struct pci_device_id * id;* should be close to 'id' and one space is enough. I guess you
haven't run your patch thruscripts/checkpatch.pl?
Oops, my bad. Will fix it.
Quoted 2 lines
WBR, Sergei
Signature · 2 lines
Richard Yang Help you, Help me