On 2024/8/14 17:39, Shameerali Kolothum Thodi wrote: > > >> -----Original Message----- >> From: liulongfang <liulongfang@xxxxxxxxxx> >> Sent: Tuesday, August 6, 2024 1:29 PM >> To: alex.williamson@xxxxxxxxxx; jgg@xxxxxxxxxx; Shameerali Kolothum Thodi >> <shameerali.kolothum.thodi@xxxxxxxxxx>; Jonathan Cameron >> <jonathan.cameron@xxxxxxxxxx> >> Cc: kvm@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; >> linuxarm@xxxxxxxxxxxxx; liulongfang <liulongfang@xxxxxxxxxx> >> Subject: [PATCH v8 3/4] hisi_acc_vfio_pci: register debugfs for hisilicon >> migration driver > ... >> +static int hisi_acc_vf_dev_read(struct seq_file *seq, void *data) >> +{ >> + struct device *vf_dev = seq->private; >> + struct vfio_pci_core_device *core_device = dev_get_drvdata(vf_dev); >> + struct vfio_device *vdev = &core_device->vdev; >> + struct hisi_acc_vf_core_device *hisi_acc_vdev = >> hisi_acc_get_vf_dev(vdev); >> + size_t vf_data_sz = offsetofend(struct acc_vf_data, padding); >> + struct acc_vf_data *vf_data = NULL; >> + int ret; >> + >> + vf_data = kzalloc(sizeof(struct acc_vf_data), GFP_KERNEL); >> + if (!vf_data) >> + return -ENOMEM; >> + >> + mutex_lock(&hisi_acc_vdev->state_mutex); >> + ret = hisi_acc_vf_debug_check(seq, vdev); >> + if (ret) { >> + mutex_unlock(&hisi_acc_vdev->state_mutex); >> + goto migf_err; >> + } >> + >> + vf_data->vf_qm_state = hisi_acc_vdev->vf_qm_state; >> + ret = vf_qm_read_data(&hisi_acc_vdev->vf_qm, vf_data); >> + if (ret) { >> + mutex_unlock(&hisi_acc_vdev->state_mutex); >> + goto migf_err; >> + } >> + >> + mutex_unlock(&hisi_acc_vdev->state_mutex); >> + >> + seq_hex_dump(seq, "Dev Data:", DUMP_PREFIX_OFFSET, 16, 1, >> + (unsigned char *)vf_data, >> + vf_data_sz, false); >> + >> + seq_printf(seq, >> + "acc device:\n" >> + "device ready: %u\n" >> + "device opened: %d\n" >> + "data size: %lu\n", >> + hisi_acc_vdev->vf_qm_state, >> + hisi_acc_vdev->dev_opened, > > I think the dev_opened will be always true if it reaches here and can be > removed from here and from hisi_acc_vf_migf_read() as well. > > Please don't respin just for this. Let us wait for others to review this. > Hello,Alex Williamson and Jason Gunthorpe: Could you take a moment to review this patch? Thanks, Longfang. > Thanks, > Shameer > . >