PCI: fix a scheduling in atomic bug
Subsystems (2)
PATCH 1/1 PCI: fix a scheduling in atomic bug
This function is often called with a spinlock held so the allocation has to be atomic. The call tree is:
pci_specified_resource_alignment() <-- takes spin_lock();
-> pci_dev_str_match()
-> pci_dev_str_match_path()
--- drivers/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pci.c +1 -1
@@ -269,7 +269,7 @@ static int pci_dev_str_match_path(struct pci_dev *dev, const char *path, *endptr =strchrnul (path,';' ); - wpath =kmemdup_nul (path, *endptr - path,GFP_KERNEL ); + wpath =kmemdup_nul (path, *endptr - path,GFP_ATOMIC );if (!wpath)return -ENOMEM ;
Signature · 1 line
2.20.1
Quoted 9 lines · Dan Carpenter
This function is often called with a spinlock held so the allocation has to be atomic. The call tree is:
pci_specified_resource_alignment()<-- takesspin_lock();
->pci_dev_str_match()-> pci_dev_str_match_path()Fixes 07d8d7e57c28 ("PCI: Make specifying PCI devices in kernel parameters reusable")Signed-off-by Dan Carpenter <[email protected]>
This looks good to me, but I think the fixes tag is wrong. pci_dev_str_match_path() was introduced in this patch:
path of devfns")
Thanks,
Logan
Quoted 11 lines · Logan Gunthorpe
Quoted 7 lines · Dan Carpenter
This function is often called with a spinlock held so the allocation has to be atomic. The call tree is:
pci_specified_resource_alignment()<-- takesspin_lock();
->pci_dev_str_match()-> pci_dev_str_match_path()
Quoted 8 lines
Quoted 2 lines
Fixes 07d8d7e57c28 ("PCI: Make specifying PCI devices in kernel parameters reusable")Signed-off-by Dan Carpenter <[email protected]>This looks good to me, but I think the fixes tag is wrong.
pci_dev_str_match_path()was introduced in this patch:Fixes 45db33709ccc ("PCI: Allow specifying devices using a base bus andpath of devfns")
Yeah. You're right. Thanks. Thanks, Bjorn for fixing this.
regards,
dan carpenter
Quoted 9 lines · Dan Carpenter
This function is often called with a spinlock held so the allocation has to be atomic. The call tree is:
pci_specified_resource_alignment()<-- takesspin_lock();
->pci_dev_str_match()-> pci_dev_str_match_path()Fixes 07d8d7e57c28 ("PCI: Make specifying PCI devices in kernel parameters reusable")Signed-off-by Dan Carpenter <[email protected]>
Applied with Logan's Reviewed-by and Fixes: update to pci/misc for v5.15, thanks!
Quoted 20 lines
--- drivers/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pci/pci.c +1
-1@@ -269,7 +269,7 @@ static int pci_dev_str_match_path(struct pci_dev *dev, const char *path, *endptr =strchrnul (path,';' ); - wpath =kmemdup_nul (path, *endptr - path,GFP_KERNEL ); + wpath =kmemdup_nul (path, *endptr - path,GFP_ATOMIC );if (!wpath)return -ENOMEM ;Signature · 1 line
2.20.1