pds_vdpa: updates
Subsystems (2)
cover pds_vdpa: updates
The first patch cleans up a kernel test robot complaint. The others are for a couple of things seen in further testing.
Shannon Nelson (3):
pds_vdpa: fix up format-truncation complaint
pds_vdpa: clear config callback when status goes to 0
pds_vdpa: set features order
drivers/vdpa/pds/debugfs.c | 2 +- drivers/vdpa/pds/vdpa_dev.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/3 pds_vdpa: fix up format-truncation complaint
Our friendly kernel test robot has recently been pointing out some format-truncation issues. Here's a fix for one of them.
--- drivers/vdpa/pds/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/pds/debugfs.c +1 -1
@@ -261,7 +261,7 @@ void pds_vdpa_debugfs_add_vdpadev(struct pds_vdpa_aux *vdpa_aux)debugfs_create_file ("config" ,0400 , vdpa_aux->dentry, vdpa_aux->pdsv, &config_fops);for (i =0 ; i < vdpa_aux->pdsv->num_vqs; i++) { -char name[8 ]; +char name[16 ];snprintf (name,sizeof (name),"vq%02d" , i); debugfs_create_file(name, 0400, vdpa_aux->dentry,
Signature · 1 line
2.17.1
Re: [PATCH virtio 1/3] pds_vdpa: fix up format-truncation complaint
Quoted 7 lines · Shannon Nelson
Our friendly kernel test robot has recently been pointing out some format-truncation issues. Here's a fix for one of them.
Reported-by kernel test robot <[email protected]>Signed-off-by Shannon Nelson <[email protected]>
I think this is needed for -stable?
Thanks
Quoted 20 lines
--- drivers/vdpa/pds/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vdpa/pds/debugfs.c +1
-2@@ -261,7 +261,7 @@ void pds_vdpa_debugfs_add_vdpadev(struct pds_vdpa_aux *vdpa_aux)debugfs_create_file ("config" ,0400 , vdpa_aux->dentry, vdpa_aux->pdsv, &config_fops);for (i =0 ; i < vdpa_aux->pdsv->num_vqs; i++) { -char name[8 ]; +char name[16 ];snprintf (name,sizeof (name),"vq%02d" , i); debugfs_create_file(name, 0400, vdpa_aux->dentry, --2.17.1
PATCH 2/3 pds_vdpa: clear config callback when status goes to 0
In reply to Shannon NelsonIf the client driver is setting status to 0, something is getting shutdown and possibly removed. Make sure we clear the config_cb so that it doesn't end up crashing when trying to call a bogus callback.
--- drivers/vdpa/pds/vdpa_dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/vdpa/pds/vdpa_dev.c +3 -1
@@ -461,8 +461,10 @@ static void pds_vdpa_set_status(struct vdpa_device *vdpa_dev, u8 status)pds_vdpa_cmd_set_status (pdsv, status); -/* Note: still working with FW on the need for this reset cmd */ if (status ==0 ) { +struct vdpa_callback null_cb = { }; + +pds_vdpa_set_config_cb (vdpa_dev, &null_cb);pds_vdpa_cmd_reset (pdsv);for (i =0 ; i < pdsv->num_vqs; i++) {
Signature · 1 line
2.17.1
Re: [PATCH virtio 2/3] pds_vdpa: clear config callback when status goes to 0
Quoted 7 lines · Shannon Nelson
If the client driver is setting status to 0, something is getting shutdown and possibly removed. Make sure we clear the
config_cbso that it doesn't end up crashing when trying to call a bogus callback.Signed-off-by Shannon Nelson <[email protected]>
Thanks
Quoted 23 lines
--- drivers/vdpa/pds/vdpa_dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/vdpa/pds/vdpa_dev.c +3
-2@@ -461,8 +461,10 @@ static void pds_vdpa_set_status(struct vdpa_device *vdpa_dev, u8 status)pds_vdpa_cmd_set_status (pdsv, status); -/* Note: still working with FW on the need for this reset cmd */ if (status ==0 ) { +struct vdpa_callback null_cb = { }; + +pds_vdpa_set_config_cb (vdpa_dev, &null_cb);pds_vdpa_cmd_reset (pdsv);for (i =0 ; i < pdsv->num_vqs; i++) { --2.17.1
PATCH 3/3 pds_vdpa: set features order
In reply to Shannon NelsonFix up the order that the device and negotiated features are checked to get a more reliable difference when things get changed.
--- drivers/vdpa/pds/vdpa_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/vdpa/pds/vdpa_dev.c +1 -2
@@ -318,9 +318,8 @@ static int pds_vdpa_set_driver_features(struct vdpa_device *vdpa_dev, u64 featurreturn -EOPNOTSUPP ; } - pdsv->negotiated_features = nego_features; - driver_features =pds_vdpa_get_driver_features (vdpa_dev); + pdsv->negotiated_features = nego_features;dev_dbg (dev,"%s: %#llx => %#llx\n" , __func__, driver_features, nego_features);
Signature · 1 line
2.17.1
Re: [PATCH virtio 3/3] pds_vdpa: set features order
Quoted 15 lines · Shannon Nelson
Fix up the order that the device and negotiated features are checked to get a more reliable difference when things get changed.
Signed-off-by Shannon Nelson <[email protected]>--- drivers/vdpa/pds/vdpa_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/vdpa/pds/vdpa_dev.c +0
-0
drivers/vdpa/pds/vdpa_dev.c static int pds_vdpa_set_driver_features(struct vdpa_device *vdpa_dev, u64 featur · line 322
Quoted 7 lines
drivers/vdpa/pds/vdpa_dev.c +1
-2@@ -318,9 +318,8 @@ static int pds_vdpa_set_driver_features(struct vdpa_device *vdpa_dev, u64 featurreturn -EOPNOTSUPP ; } - pdsv->negotiated_features = nego_features; - driver_features =pds_vdpa_get_driver_features (vdpa_dev); + pdsv->negotiated_features = nego_features;
I may miss something, but I don't see how things have changed here.
Thanks
Quoted 6 lines
drivers/vdpa/pds/vdpa_dev.c +0
-1dev_dbg (dev,"%s: %#llx => %#llx\n" , __func__, driver_features, nego_features); --2.17.1
Jason Wang
Acked-byRe: [PATCH virtio 3/3] pds_vdpa: set features order
Quoted 20 lines · Jason Wang
Quoted 18 lines · Shannon Nelson
Fix up the order that the device and negotiated features are checked to get a more reliable difference when things get changed.
Signed-off-by Shannon Nelson <[email protected]>--- drivers/vdpa/pds/vdpa_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/vdpa/pds/vdpa_dev.c +0
-0@@ -318,9 +318,8 @@ static int pds_vdpa_set_driver_features(struct vdpa_device *vdpa_dev, u64 featurreturn -EOPNOTSUPP ; }
Quoted 6 lines
drivers/vdpa/pds/vdpa_dev.c static int pds_vdpa_set_driver_features(struct vdpa_device *vdpa_dev, u64 featur · line 322
Quoted 4 lines
drivers/vdpa/pds/vdpa_dev.c +1
-2- pdsv->negotiated_features = nego_features; - driver_features =pds_vdpa_get_driver_features (vdpa_dev); + pdsv->negotiated_features = nego_features;I may miss something, but I don't see how things have changed here.
Ok, I think I get it. driver_feautres here means the old negotiated features.
We probably need a better name (not a native speaker though).
Thanks
Quoted 9 lines
Thanks
Quoted 6 lines
drivers/vdpa/pds/vdpa_dev.c +0
-1dev_dbg (dev,"%s: %#llx => %#llx\n" , __func__, driver_features, nego_features); --2.17.1