linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Dan Williams <dan.j.williams@intel.com>, linux-acpi@vger.kernel.org
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	peterz@infradead.org, ard.biesheuvel@linaro.org,
	linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] resource: Report parent to walk_iomem_res_desc() callback
Date: Thu, 5 Mar 2020 08:42:34 -0600	[thread overview]
Message-ID: <1848cdb9-8c19-d7fe-870c-175bd60bc364@amd.com> (raw)
In-Reply-To: <158318762012.2216124.16408566404290491508.stgit@dwillia2-desk3.amr.corp.intel.com>

On 3/2/20 4:20 PM, Dan Williams wrote:
> In support of detecting whether a resource might have been been claimed,
> report the parent to the walk_iomem_res_desc() callback. For example,
> the ACPI HMAT parser publishes "hmem" platform devices per target range.
> However, if the HMAT is disabled / missing a fallback driver can attach
> devices to the raw memory ranges as a fallback if it sees unclaimed /
> orphan "Soft Reserved" resources in the resource tree.
> 
> Otherwise, find_next_iomem_res() returns a resource with garbage data
> from the stack allocation in __walk_iomem_res_desc() for the res->parent
> field.

Just wondering if we shouldn't just copy the complete resource struct and
just override the start and end values? That way, if some code in the
future wants to look at sibling or child values, another change isn't needed.

Just a thought.

Thanks,
Tom

> 
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Wei Yang <richardw.yang@linux.intel.com>
> Cc: Tom Lendacky <thomas.lendacky@amd.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  kernel/resource.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/resource.c b/kernel/resource.c
> index 76036a41143b..6e22e312fd55 100644
> --- a/kernel/resource.c
> +++ b/kernel/resource.c
> @@ -386,6 +386,7 @@ static int find_next_iomem_res(resource_size_t start, resource_size_t end,
>  		res->end = min(end, p->end);
>  		res->flags = p->flags;
>  		res->desc = p->desc;
> +		res->parent = p->parent;
>  	}
>  
>  	read_unlock(&resource_lock);
> 
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

  reply	other threads:[~2020-03-05 14:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-02 22:19 [PATCH 0/5] Manual definition of Soft Reserved memory devices Dan Williams
2020-03-02 22:20 ` [PATCH 1/5] ACPI: NUMA: Add 'nohmat' option Dan Williams
2020-03-18  0:08   ` Dan Williams
2020-03-18  8:24     ` Rafael J. Wysocki
2020-03-18 17:39       ` Dan Williams
2020-03-19  9:30         ` Rafael J. Wysocki
2020-03-02 22:20 ` [PATCH 2/5] efi/fake_mem: Arrange for a resource entry per efi_fake_mem instance Dan Williams
2020-03-03  8:01   ` Ard Biesheuvel
2020-03-02 22:20 ` [PATCH 3/5] ACPI: HMAT: Refactor hmat_register_target_device to hmem_register_device Dan Williams
2020-03-02 22:20 ` [PATCH 4/5] resource: Report parent to walk_iomem_res_desc() callback Dan Williams
2020-03-05 14:42   ` Tom Lendacky [this message]
2020-03-17 22:04     ` Dan Williams
2020-03-02 22:20 ` [PATCH 5/5] ACPI: HMAT: Attach a device for each soft-reserved range Dan Williams
2020-03-06 20:07 ` [PATCH 0/5] Manual definition of Soft Reserved memory devices Jeff Moyer
2020-03-06 21:05   ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1848cdb9-8c19-d7fe-870c-175bd60bc364@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=peterz@infradead.org \
    --subject='Re: [PATCH 4/5] resource: Report parent to walk_iomem_res_desc() callback' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).