Skip to content

Commit

Permalink
platform: Print the resource range if device failed to claim
Browse files Browse the repository at this point in the history
Sometimes we have the following error message:
 platform MSFT0101:00: failed to claim resource 1
 acpi MSFT0101:00: platform device creation failed: -16
But there is not enough information to figure out which resource range
failed to claim.

Thus print the resource range at first-place thus /proc/iomem or
ioports should tell us who already claimed this resource, then
the driver bug or incorrect resource assignment which is running
into this conflict can be diagnosed:
 platform MSFT0101:00: failed to claim resource 1: [mem 0xfed40000-0xfed40fff]
 acpi MSFT0101:00: platform device creation failed: -16

Suggested-by: Len Brown <lenb@kernel.org>
Reported-by: Wendy Wang <wendy.wang@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Chen Yu authored and Greg Kroah-Hartman committed Jan 11, 2017
1 parent a0244a8 commit 8a18f42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ int platform_device_add(struct platform_device *pdev)
}

if (p && insert_resource(p, r)) {
dev_err(&pdev->dev, "failed to claim resource %d\n", i);
dev_err(&pdev->dev, "failed to claim resource %d: %pR\n", i, r);
ret = -EBUSY;
goto failed;
}
Expand Down

0 comments on commit 8a18f42

Please sign in to comment.