nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Oliver <oohall@gmail.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [PATCH] libnvdimm: Provide a simplified nvdimm_create() for non-security enabled DIMMs
Date: Mon, 15 Oct 2018 11:05:44 +1100	[thread overview]
Message-ID: <CAOSf1CF5zn3SJJm7J38qMcsdVhxWi_SPoHOBHt-YBg+RzjS8Bg@mail.gmail.com> (raw)
In-Reply-To: <153944784534.1508664.6365625408163933467.stgit@dwillia2-desk3.amr.corp.intel.com>

On Sun, Oct 14, 2018 at 3:35 AM Dan Williams <dan.j.williams@intel.com> wrote:
>
> Do not require libnvdimm provider implementations to include security
> parameters if the bus / dimm-devices do not have that support.
>
> Cc: Oliver O'Halloran <oohall@gmail.com>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  drivers/acpi/nfit/core.c   |    2 +-
>  drivers/nvdimm/dimm_devs.c |    4 ++--
>  include/linux/libnvdimm.h  |   11 ++++++++++-
>  3 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index a287a773012b..a0dfbcf8220d 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -1992,7 +1992,7 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
>
>                 flush = nfit_mem->nfit_flush ? nfit_mem->nfit_flush->flush
>                         : NULL;
> -               nvdimm = nvdimm_create(acpi_desc->nvdimm_bus, nfit_mem,
> +               nvdimm = __nvdimm_create(acpi_desc->nvdimm_bus, nfit_mem,
>                                 acpi_nfit_dimm_attribute_groups,
>                                 flags, cmd_mask, flush ? flush->hint_count : 0,
>                                 nfit_mem->flush_wpq, &nfit_mem->id[0],
> diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c
> index d1bfb8975b07..5d34251c4f3b 100644
> --- a/drivers/nvdimm/dimm_devs.c
> +++ b/drivers/nvdimm/dimm_devs.c
> @@ -459,7 +459,7 @@ struct attribute_group nvdimm_attribute_group = {
>  };
>  EXPORT_SYMBOL_GPL(nvdimm_attribute_group);
>
> -struct nvdimm *nvdimm_create(struct nvdimm_bus *nvdimm_bus, void *provider_data,
> +struct nvdimm *__nvdimm_create(struct nvdimm_bus *nvdimm_bus, void *provider_data,
>                 const struct attribute_group **groups, unsigned long flags,
>                 unsigned long cmd_mask, int num_flush,
>                 struct resource *flush_wpq, const char *dimm_id,
> @@ -496,7 +496,7 @@ struct nvdimm *nvdimm_create(struct nvdimm_bus *nvdimm_bus, void *provider_data,
>
>         return nvdimm;
>  }
> -EXPORT_SYMBOL_GPL(nvdimm_create);
> +EXPORT_SYMBOL_GPL(__nvdimm_create);
>
>  int alias_dpa_busy(struct device *dev, void *data)
>  {
> diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h
> index c352b8195675..1071fe12081b 100644
> --- a/include/linux/libnvdimm.h
> +++ b/include/linux/libnvdimm.h
> @@ -207,11 +207,20 @@ const char *nvdimm_name(struct nvdimm *nvdimm);
>  struct kobject *nvdimm_kobj(struct nvdimm *nvdimm);
>  unsigned long nvdimm_cmd_mask(struct nvdimm *nvdimm);
>  void *nvdimm_provider_data(struct nvdimm *nvdimm);
> -struct nvdimm *nvdimm_create(struct nvdimm_bus *nvdimm_bus, void *provider_data,
> +struct nvdimm *__nvdimm_create(struct nvdimm_bus *nvdimm_bus, void *provider_data,
>                 const struct attribute_group **groups, unsigned long flags,
>                 unsigned long cmd_mask, int num_flush,
>                 struct resource *flush_wpq, const char *dimm_id,
>                 const struct nvdimm_security_ops *sec_ops);
> +static inline struct nvdimm *nvdimm_create(struct nvdimm_bus *nvdimm_bus,
> +               void *provider_data, const struct attribute_group **groups,
> +               unsigned long flags, unsigned long cmd_mask, int num_flush,
> +               struct resource *flush_wpq)
> +{
> +       return __nvdimm_create(nvdimm_bus, provider_data, groups, flags,
> +                       cmd_mask, num_flush, flush_wpq, NULL, NULL);
> +}
> +
>  const struct nd_cmd_desc *nd_cmd_dimm_desc(int cmd);
>  const struct nd_cmd_desc *nd_cmd_bus_desc(int cmd);
>  u32 nd_cmd_in_size(struct nvdimm *nvdimm, int cmd,

Acked-by: Oliver O'Halloran <oohall@gmail.com>
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

      reply	other threads:[~2018-10-15  0:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-13 16:24 [PATCH] libnvdimm: Provide a simplified nvdimm_create() for non-security enabled DIMMs Dan Williams
2018-10-15  0:05 ` Oliver [this message]

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=CAOSf1CF5zn3SJJm7J38qMcsdVhxWi_SPoHOBHt-YBg+RzjS8Bg@mail.gmail.com \
    --to=oohall@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=mpe@ellerman.id.au \
    /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 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).