Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1426018 > unrolled thread
| Started by | Pavel Machek <pavel@ucw.cz> |
|---|---|
| First post | 2016-06-19 20:10 +0200 |
| Last post | 2016-06-20 19:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list Pavel Machek <pavel@ucw.cz> - 2016-06-19 20:10 +0200
Re: [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list Dan Williams <dan.j.williams@intel.com> - 2016-06-20 19:30 +0200
| From | Pavel Machek <pavel@ucw.cz> |
|---|---|
| Date | 2016-06-19 20:10 +0200 |
| Subject | Re: [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list |
| Message-ID | <rLPkt-5NB-13@gated-at.bofh.it> |
Hi!
> >Add the Microsoft _DSM command set to the white list of NVDIMM command sets.
> >
> >This command set is documented at https://msdn.microsoft.com/library/windows/hardware/mt604741.
> >
> >Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
> >---
> > drivers/acpi/nfit.c | 9 ++++++---
> > drivers/acpi/nfit.h | 4 ++++
> > include/uapi/linux/ndctl.h | 1 +
> > 3 files changed, 11 insertions(+), 3 deletions(-)
> >
> >diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> >index 2215fc8..48fc575 100644
> >--- a/drivers/acpi/nfit.c
> >+++ b/drivers/acpi/nfit.c
> >@@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
> > }
> >
> > /*
> >- * Until standardization materializes we need to consider up to 3
> >+ * Until standardization materializes we need to consider several
> > * different command sets. Note, that checking for function0 (bit0)
> > * tells us if any commands are reachable through this uuid.
> > */
> >- for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
> >+ for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
> > if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
Time to introduce NVDIMM_FAMILY_MAX?
> >@@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
> > dsm_mask = 0x1fe;
> > if (disable_vendor_specific)
> > dsm_mask &= ~(1 << 8);
> >- } else {
> >+ } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
> >+ dsm_mask = 0xffffffff;
> >+ else {
> > dev_err(dev, "unknown dimm command family\n");
> > nfit_mem->family = -1;
> > return force_enable_dimms ? 0 : -ENODEV;
I'd really use {} around the if (), so that it is clear what the else belongs to.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[toc] | [next] | [standalone]
| From | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Date | 2016-06-20 19:30 +0200 |
| Message-ID | <rMbbk-2Hq-19@gated-at.bofh.it> |
| In reply to | #1426018 |
On Sun, Jun 19, 2016 at 10:59 AM, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
>> >Add the Microsoft _DSM command set to the white list of NVDIMM command sets.
>> >
>> >This command set is documented at https://msdn.microsoft.com/library/windows/hardware/mt604741.
>> >
>> >Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
>> >---
>> > drivers/acpi/nfit.c | 9 ++++++---
>> > drivers/acpi/nfit.h | 4 ++++
>> > include/uapi/linux/ndctl.h | 1 +
>> > 3 files changed, 11 insertions(+), 3 deletions(-)
>> >
>> >diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
>> >index 2215fc8..48fc575 100644
>> >--- a/drivers/acpi/nfit.c
>> >+++ b/drivers/acpi/nfit.c
>> >@@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
>> > }
>> >
>> > /*
>> >- * Until standardization materializes we need to consider up to 3
>> >+ * Until standardization materializes we need to consider several
>> > * different command sets. Note, that checking for function0 (bit0)
>> > * tells us if any commands are reachable through this uuid.
>> > */
>> >- for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
>> >+ for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
>> > if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
>
> Time to introduce NVDIMM_FAMILY_MAX?
I hope not. This is the last of what can be considered "first
generation" DSM support, everything else should wait for
standardization. I.e. no ongoing need to keep changing this line.
>
>> >@@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
>> > dsm_mask = 0x1fe;
>> > if (disable_vendor_specific)
>> > dsm_mask &= ~(1 << 8);
>> >- } else {
>> >+ } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
>> >+ dsm_mask = 0xffffffff;
>> >+ else {
>> > dev_err(dev, "unknown dimm command family\n");
>> > nfit_mem->family = -1;
>> > return force_enable_dimms ? 0 : -ENODEV;
>
> I'd really use {} around the if (), so that it is clear what the else belongs to.
Sure, I can fix this up. Stuart, no need to re-send.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web