All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: NVDIMM-ML <linux-nvdimm@lists.01.org>
Subject: Re: [ndctl PATCH 3/4] Make interfaces to use Translate SPA.
Date: Fri, 25 Aug 2017 17:05:19 -0700	[thread overview]
Message-ID: <CAPcyv4jZqm-9X8201GuRi4fXmr420hhgi-1gMk2=K13c_TDiwQ@mail.gmail.com> (raw)
In-Reply-To: <20170818133524.8EB4.E1E9C6FF@jp.fujitsu.com>

On Thu, Aug 17, 2017 at 9:35 PM, Yasunori Goto <y-goto@jp.fujitsu.com> wrote:
>
> This patch makes 3 new interfaces :
>   - to ask bus has translate SPA feature.
>   - to call translate SPA.
>   - to find DIMM by SPA address.
>
>
> Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
> ---
>  configure.ac                 |  19 ++++++++
>  ndctl/lib/libndctl-private.h |   7 +++
>  ndctl/lib/libndctl.c         | 111 +++++++++++++++++++++++++++++++++++++++++++
>  ndctl/lib/libndctl.sym       |   3 ++
>  ndctl/libndctl.h.in          |  23 +++++++++
>  ndctl/ndctl.h                |   5 ++
>  6 files changed, 168 insertions(+)
>
[..]
> diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
> index b3535f0..4556067 100644
> --- a/ndctl/lib/libndctl.c
> +++ b/ndctl/lib/libndctl.c
[..]

Sorry I overlooked this function in my last mail:

> +NDCTL_EXPORT struct ndctl_dimm *ndctl_dimm_get_by_spa(struct ndctl_bus *bus,
> +               unsigned long long spa)
> +{
> +       int rc;
> +       unsigned int handle;
> +       unsigned long long dpa;
> +
> +       if (!bus || !spa)
> +               return NULL;

We can do some sanity checking here to check the resource range and
see if the DIMM is in that region. See ndctl_region_get_resource() and
ndctl_dimm_foreach_in_region(). That also allows us to support single
dimm regions without calling translate spa.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  parent reply	other threads:[~2017-08-26  0:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18  4:31 [ndctl PATCH 0/4] show broken dimm info with translate SPA feature Yasunori Goto
2017-08-18  4:33 ` [ndctl PATCH 1/4] make interface to check device/nfit/dsm_mask flags Yasunori Goto
2017-08-25 23:45   ` Dan Williams
2017-08-28  1:01     ` Yasunori Goto
2017-08-18  4:34 ` [ndctl PATCH 2/4] allow ND_CMD_CALL for bus Yasunori Goto
2017-08-25 23:46   ` Dan Williams
2017-08-18  4:35 ` [ndctl PATCH 3/4] Make interfaces to use Translate SPA Yasunori Goto
2017-08-25 23:58   ` Dan Williams
2017-08-28  1:43     ` Yasunori Goto
2017-08-28  2:41       ` Dan Williams
2017-08-26  0:05   ` Dan Williams [this message]
2017-08-28  1:12     ` Yasunori Goto
2017-08-18  4:37 ` [ndctl PATCH 4/4] show bad dimm's name by ndctl list command Yasunori Goto

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='CAPcyv4jZqm-9X8201GuRi4fXmr420hhgi-1gMk2=K13c_TDiwQ@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=y-goto@jp.fujitsu.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.