Skip to content

Commit 91a229b

Browse files
mitaakpm00
authored andcommitted
resource: fix false warning in __request_region()
A warning is raised when __request_region() detects a conflict with a resource whose resource.desc is IORES_DESC_DEVICE_PRIVATE_MEMORY. But this warning is only valid for iomem_resources. The hmem device resource uses resource.desc as the numa node id, which can cause spurious warnings. This warning appeared on a machine with multiple cxl memory expanders. One of the NUMA node id is 6, which is the same as the value of IORES_DESC_DEVICE_PRIVATE_MEMORY. In this environment it was just a spurious warning, but when I saw the warning I suspected a real problem so it's better to fix it. This change fixes this by restricting the warning to only iomem_resource. This also adds a missing new line to the warning message. Link: https://lkml.kernel.org/r/[email protected] Fixes: 7dab174 ("dax/hmem: Move hmem device registration to dax_hmem.ko") Signed-off-by: Akinobu Mita <[email protected]> Reviewed-by: Dan Williams <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 1aef9df commit 91a229b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kernel/resource.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,8 +1279,9 @@ static int __request_region_locked(struct resource *res, struct resource *parent
12791279
* become unavailable to other users. Conflicts are
12801280
* not expected. Warn to aid debugging if encountered.
12811281
*/
1282-
if (conflict->desc == IORES_DESC_DEVICE_PRIVATE_MEMORY) {
1283-
pr_warn("Unaddressable device %s %pR conflicts with %pR",
1282+
if (parent == &iomem_resource &&
1283+
conflict->desc == IORES_DESC_DEVICE_PRIVATE_MEMORY) {
1284+
pr_warn("Unaddressable device %s %pR conflicts with %pR\n",
12841285
conflict->name, conflict, res);
12851286
}
12861287
if (conflict != parent) {

0 commit comments

Comments
 (0)