linux-stable/drivers/vdpa/vdpa_sim
Stefano Garzarella 9da667e50c vdpa_sim_net: complete the initialization before register the device
Initialization must be completed before calling _vdpa_register_device()
since it can connect the device to the vDPA bus, so requests can arrive
after that call.

So for example vdpasim_net_work(), which uses the net->*_stats variables,
can be scheduled before they are initialized.

Let's move _vdpa_register_device() to the end of vdpasim_net_dev_add()
and add a comment to avoid future issues.

Fixes: 0899774cb3 ("vdpa_sim_net: vendor satistics")
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20230329160321.187176-1-sgarzare@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
2023-04-04 14:22:12 -04:00
..
Makefile vdpa: add vdpa simulator for block device 2021-05-03 04:55:53 -04:00
vdpa_sim.c vdpa_sim: set last_used_idx as last_avail_idx in vdpasim_queue_ready 2023-03-13 02:29:12 -04:00
vdpa_sim.h vdpa_sim: get rid of DMA ops 2023-02-20 19:26:58 -05:00
vdpa_sim_blk.c vdpasim: customize allocation size 2023-02-20 19:26:57 -05:00
vdpa_sim_net.c vdpa_sim_net: complete the initialization before register the device 2023-04-04 14:22:12 -04:00