* [PATCH v2] libnvdimm, nd_blk: mask off reserved status bits
@ 2016-08-02 18:26 ` Ross Zwisler
0 siblings, 0 replies; 20+ messages in thread
From: Ross Zwisler @ 2016-08-02 18:26 UTC (permalink / raw)
To: linux-kernel
Cc: Ross Zwisler, Rafael J. Wysocki, Dan Williams, Len Brown,
linux-acpi, linux-nvdimm, Lee, Chun-Yi, stable
The "NVDIMM Block Window Driver Writer's Guide":
http://pmem.io/documents/
http://pmem.io/documents/NVDIMM_DriverWritersGuide-July-2016.pdf
defines the layout of the block window status register. For the July 2016
version of the spec linked to above, this happens in Figure 4 on page 26.
The only bits defined in this spec are bits 31, 5, 4, 2, 1 and 0. The rest
of the bits in the status register are reserved, and there is a warning
following the diagram that says:
Note: The driver cannot assume the value of the RESERVED bits in the
status register are zero. These reserved bits need to be masked off, and
the driver must avoid checking the state of those bits.
This change ensures that for hardware implementations that set these
reserved bits in the status register, the driver won't incorrectly fail the
block I/Os.
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Lee, Chun-Yi <jlee@suse.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: stable@vger.kernel.org # v4.2+
---
Changes from V1:
- Rebased onto the v4.8 merge tree. As Joey points out the ND BLK code
recently moved from drivers/acpi/nfit.c to drivers/acpi/nfit/core.c.
Since we were in the merge window for v4.8 I didn't know what to use as
a baseline, so I just used v4.7, which was apparently incorrect. Sorry
about that.
- Added Joey's reviewed-by.
For stable kernels v4.2 and beyond the v1 patch for drivers/acpi/nfit.c
applies cleanly and should be used.
---
drivers/acpi/nfit/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 8c234dd..80cc7c0 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -1527,11 +1527,12 @@ static u32 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
{
struct nfit_blk_mmio *mmio = &nfit_blk->mmio[DCR];
u64 offset = nfit_blk->stat_offset + mmio->size * bw;
+ const u32 STATUS_MASK = 0x80000037;
if (mmio->num_lines)
offset = to_interleave_offset(offset, mmio);
- return readl(mmio->addr.base + offset);
+ return readl(mmio->addr.base + offset) & STATUS_MASK;
}
static void write_blk_ctl(struct nfit_blk *nfit_blk, unsigned int bw,
--
2.9.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v2] libnvdimm, nd_blk: mask off reserved status bits
@ 2016-08-02 18:26 ` Ross Zwisler
0 siblings, 0 replies; 20+ messages in thread
From: Ross Zwisler @ 2016-08-02 18:26 UTC (permalink / raw)
To: linux-kernel
Cc: Ross Zwisler, Rafael J. Wysocki, Dan Williams, Len Brown,
linux-acpi, linux-nvdimm, Lee, Chun-Yi, stable
The "NVDIMM Block Window Driver Writer's Guide":
http://pmem.io/documents/
http://pmem.io/documents/NVDIMM_DriverWritersGuide-July-2016.pdf
defines the layout of the block window status register. For the July 2016
version of the spec linked to above, this happens in Figure 4 on page 26.
The only bits defined in this spec are bits 31, 5, 4, 2, 1 and 0. The rest
of the bits in the status register are reserved, and there is a warning
following the diagram that says:
Note: The driver cannot assume the value of the RESERVED bits in the
status register are zero. These reserved bits need to be masked off, and
the driver must avoid checking the state of those bits.
This change ensures that for hardware implementations that set these
reserved bits in the status register, the driver won't incorrectly fail the
block I/Os.
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Lee, Chun-Yi <jlee@suse.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: stable@vger.kernel.org # v4.2+
---
Changes from V1:
- Rebased onto the v4.8 merge tree. As Joey points out the ND BLK code
recently moved from drivers/acpi/nfit.c to drivers/acpi/nfit/core.c.
Since we were in the merge window for v4.8 I didn't know what to use as
a baseline, so I just used v4.7, which was apparently incorrect. Sorry
about that.
- Added Joey's reviewed-by.
For stable kernels v4.2 and beyond the v1 patch for drivers/acpi/nfit.c
applies cleanly and should be used.
---
drivers/acpi/nfit/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 8c234dd..80cc7c0 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -1527,11 +1527,12 @@ static u32 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
{
struct nfit_blk_mmio *mmio = &nfit_blk->mmio[DCR];
u64 offset = nfit_blk->stat_offset + mmio->size * bw;
+ const u32 STATUS_MASK = 0x80000037;
if (mmio->num_lines)
offset = to_interleave_offset(offset, mmio);
- return readl(mmio->addr.base + offset);
+ return readl(mmio->addr.base + offset) & STATUS_MASK;
}
static void write_blk_ctl(struct nfit_blk *nfit_blk, unsigned int bw,
--
2.9.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v2] libnvdimm, nd_blk: mask off reserved status bits
@ 2016-08-02 18:26 ` Ross Zwisler
0 siblings, 0 replies; 20+ messages in thread
From: Ross Zwisler @ 2016-08-02 18:26 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-nvdimm, Rafael J. Wysocki, "Lee,"
The "NVDIMM Block Window Driver Writer's Guide":
http://pmem.io/documents/
http://pmem.io/documents/NVDIMM_DriverWritersGuide-July-2016.pdf
defines the layout of the block window status register. For the July 2016
version of the spec linked to above, this happens in Figure 4 on page 26.
The only bits defined in this spec are bits 31, 5, 4, 2, 1 and 0. The rest
of the bits in the status register are reserved, and there is a warning
following the diagram that says:
Note: The driver cannot assume the value of the RESERVED bits in the
status register are zero. These reserved bits need to be masked off, and
the driver must avoid checking the state of those bits.
This change ensures that for hardware implementations that set these
reserved bits in the status register, the driver won't incorrectly fail the
block I/Os.
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Lee, Chun-Yi <jlee@suse.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: stable@vger.kernel.org # v4.2+
---
Changes from V1:
- Rebased onto the v4.8 merge tree. As Joey points out the ND BLK code
recently moved from drivers/acpi/nfit.c to drivers/acpi/nfit/core.c.
Since we were in the merge window for v4.8 I didn't know what to use as
a baseline, so I just used v4.7, which was apparently incorrect. Sorry
about that.
- Added Joey's reviewed-by.
For stable kernels v4.2 and beyond the v1 patch for drivers/acpi/nfit.c
applies cleanly and should be used.
---
drivers/acpi/nfit/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 8c234dd..80cc7c0 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -1527,11 +1527,12 @@ static u32 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
{
struct nfit_blk_mmio *mmio = &nfit_blk->mmio[DCR];
u64 offset = nfit_blk->stat_offset + mmio->size * bw;
+ const u32 STATUS_MASK = 0x80000037;
if (mmio->num_lines)
offset = to_interleave_offset(offset, mmio);
- return readl(mmio->addr.base + offset);
+ return readl(mmio->addr.base + offset) & STATUS_MASK;
}
static void write_blk_ctl(struct nfit_blk *nfit_blk, unsigned int bw,
--
2.9.0
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply related [flat|nested] 20+ messages in thread[parent not found: <20160802182653.6647-1-ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>]
* Re: [PATCH v2] libnvdimm, nd_blk: mask off reserved status bits
2016-08-02 18:26 ` Ross Zwisler
(?)
(?)
@ 2016-08-08 19:10 ` Ross Zwisler
-1 siblings, 0 replies; 20+ messages in thread
From: Ross Zwisler @ 2016-08-08 19:10 UTC (permalink / raw)
To: Ross Zwisler
Cc: linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw, Rafael J. Wysocki,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lee, Chun-Yi,
linux-acpi-u79uwXL29TY76Z2rM5mHXA, stable-u79uwXL29TY76Z2rM5mHXA,
Len Brown
On Tue, Aug 02, 2016 at 12:26:53PM -0600, Ross Zwisler wrote:
> The "NVDIMM Block Window Driver Writer's Guide":
>
> http://pmem.io/documents/
> http://pmem.io/documents/NVDIMM_DriverWritersGuide-July-2016.pdf
>
> defines the layout of the block window status register. For the July 2016
> version of the spec linked to above, this happens in Figure 4 on page 26.
>
> The only bits defined in this spec are bits 31, 5, 4, 2, 1 and 0. The rest
> of the bits in the status register are reserved, and there is a warning
> following the diagram that says:
>
> Note: The driver cannot assume the value of the RESERVED bits in the
> status register are zero. These reserved bits need to be masked off, and
> the driver must avoid checking the state of those bits.
>
> This change ensures that for hardware implementations that set these
> reserved bits in the status register, the driver won't incorrectly fail the
> block I/Os.
>
> Signed-off-by: Ross Zwisler <ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
> Reviewed-by: Lee, Chun-Yi <jlee-IBi9RG/b67k@public.gmane.org>
> Cc: Dan Williams <dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org # v4.2+
Ping on this patch - through which tree should we merge this for v4.8-rc2?
Dan's nvdimm tree?
> ---
>
> Changes from V1:
> - Rebased onto the v4.8 merge tree. As Joey points out the ND BLK code
> recently moved from drivers/acpi/nfit.c to drivers/acpi/nfit/core.c.
> Since we were in the merge window for v4.8 I didn't know what to use as
> a baseline, so I just used v4.7, which was apparently incorrect. Sorry
> about that.
>
> - Added Joey's reviewed-by.
>
> For stable kernels v4.2 and beyond the v1 patch for drivers/acpi/nfit.c
> applies cleanly and should be used.
>
> ---
> drivers/acpi/nfit/core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 8c234dd..80cc7c0 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -1527,11 +1527,12 @@ static u32 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
> {
> struct nfit_blk_mmio *mmio = &nfit_blk->mmio[DCR];
> u64 offset = nfit_blk->stat_offset + mmio->size * bw;
> + const u32 STATUS_MASK = 0x80000037;
>
> if (mmio->num_lines)
> offset = to_interleave_offset(offset, mmio);
>
> - return readl(mmio->addr.base + offset);
> + return readl(mmio->addr.base + offset) & STATUS_MASK;
> }
>
> static void write_blk_ctl(struct nfit_blk *nfit_blk, unsigned int bw,
> --
> 2.9.0
>
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [PATCH v2] libnvdimm, nd_blk: mask off reserved status bits
@ 2016-08-08 19:10 ` Ross Zwisler
0 siblings, 0 replies; 20+ messages in thread
From: Ross Zwisler @ 2016-08-08 19:10 UTC (permalink / raw)
To: Ross Zwisler
Cc: linux-kernel, Rafael J. Wysocki, Dan Williams, Len Brown,
linux-acpi, linux-nvdimm, Lee, Chun-Yi, stable
On Tue, Aug 02, 2016 at 12:26:53PM -0600, Ross Zwisler wrote:
> The "NVDIMM Block Window Driver Writer's Guide":
>
> http://pmem.io/documents/
> http://pmem.io/documents/NVDIMM_DriverWritersGuide-July-2016.pdf
>
> defines the layout of the block window status register. For the July 2016
> version of the spec linked to above, this happens in Figure 4 on page 26.
>
> The only bits defined in this spec are bits 31, 5, 4, 2, 1 and 0. The rest
> of the bits in the status register are reserved, and there is a warning
> following the diagram that says:
>
> Note: The driver cannot assume the value of the RESERVED bits in the
> status register are zero. These reserved bits need to be masked off, and
> the driver must avoid checking the state of those bits.
>
> This change ensures that for hardware implementations that set these
> reserved bits in the status register, the driver won't incorrectly fail the
> block I/Os.
>
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> Reviewed-by: Lee, Chun-Yi <jlee@suse.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: stable@vger.kernel.org # v4.2+
Ping on this patch - through which tree should we merge this for v4.8-rc2?
Dan's nvdimm tree?
> ---
>
> Changes from V1:
> - Rebased onto the v4.8 merge tree. As Joey points out the ND BLK code
> recently moved from drivers/acpi/nfit.c to drivers/acpi/nfit/core.c.
> Since we were in the merge window for v4.8 I didn't know what to use as
> a baseline, so I just used v4.7, which was apparently incorrect. Sorry
> about that.
>
> - Added Joey's reviewed-by.
>
> For stable kernels v4.2 and beyond the v1 patch for drivers/acpi/nfit.c
> applies cleanly and should be used.
>
> ---
> drivers/acpi/nfit/core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 8c234dd..80cc7c0 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -1527,11 +1527,12 @@ static u32 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
> {
> struct nfit_blk_mmio *mmio = &nfit_blk->mmio[DCR];
> u64 offset = nfit_blk->stat_offset + mmio->size * bw;
> + const u32 STATUS_MASK = 0x80000037;
>
> if (mmio->num_lines)
> offset = to_interleave_offset(offset, mmio);
>
> - return readl(mmio->addr.base + offset);
> + return readl(mmio->addr.base + offset) & STATUS_MASK;
> }
>
> static void write_blk_ctl(struct nfit_blk *nfit_blk, unsigned int bw,
> --
> 2.9.0
>
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [PATCH v2] libnvdimm, nd_blk: mask off reserved status bits
@ 2016-08-08 19:10 ` Ross Zwisler
0 siblings, 0 replies; 20+ messages in thread
From: Ross Zwisler @ 2016-08-08 19:10 UTC (permalink / raw)
To: Ross Zwisler
Cc: linux-kernel, Rafael J. Wysocki, Dan Williams, Len Brown,
linux-acpi, linux-nvdimm, Lee, Chun-Yi, stable
On Tue, Aug 02, 2016 at 12:26:53PM -0600, Ross Zwisler wrote:
> The "NVDIMM Block Window Driver Writer's Guide":
>
> http://pmem.io/documents/
> http://pmem.io/documents/NVDIMM_DriverWritersGuide-July-2016.pdf
>
> defines the layout of the block window status register. For the July 2016
> version of the spec linked to above, this happens in Figure 4 on page 26.
>
> The only bits defined in this spec are bits 31, 5, 4, 2, 1 and 0. The rest
> of the bits in the status register are reserved, and there is a warning
> following the diagram that says:
>
> Note: The driver cannot assume the value of the RESERVED bits in the
> status register are zero. These reserved bits need to be masked off, and
> the driver must avoid checking the state of those bits.
>
> This change ensures that for hardware implementations that set these
> reserved bits in the status register, the driver won't incorrectly fail the
> block I/Os.
>
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> Reviewed-by: Lee, Chun-Yi <jlee@suse.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: stable@vger.kernel.org # v4.2+
Ping on this patch - through which tree should we merge this for v4.8-rc2?
Dan's nvdimm tree?
> ---
>
> Changes from V1:
> - Rebased onto the v4.8 merge tree. As Joey points out the ND BLK code
> recently moved from drivers/acpi/nfit.c to drivers/acpi/nfit/core.c.
> Since we were in the merge window for v4.8 I didn't know what to use as
> a baseline, so I just used v4.7, which was apparently incorrect. Sorry
> about that.
>
> - Added Joey's reviewed-by.
>
> For stable kernels v4.2 and beyond the v1 patch for drivers/acpi/nfit.c
> applies cleanly and should be used.
>
> ---
> drivers/acpi/nfit/core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 8c234dd..80cc7c0 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -1527,11 +1527,12 @@ static u32 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
> {
> struct nfit_blk_mmio *mmio = &nfit_blk->mmio[DCR];
> u64 offset = nfit_blk->stat_offset + mmio->size * bw;
> + const u32 STATUS_MASK = 0x80000037;
>
> if (mmio->num_lines)
> offset = to_interleave_offset(offset, mmio);
>
> - return readl(mmio->addr.base + offset);
> + return readl(mmio->addr.base + offset) & STATUS_MASK;
> }
>
> static void write_blk_ctl(struct nfit_blk *nfit_blk, unsigned int bw,
> --
> 2.9.0
>
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [PATCH v2] libnvdimm, nd_blk: mask off reserved status bits
@ 2016-08-08 19:10 ` Ross Zwisler
0 siblings, 0 replies; 20+ messages in thread
From: Ross Zwisler @ 2016-08-08 19:10 UTC (permalink / raw)
To: Ross Zwisler
Cc: linux-nvdimm, Rafael J. Wysocki, linux-kernel, Lee, Chun-Yi,
linux-acpi, stable, Len Brown
On Tue, Aug 02, 2016 at 12:26:53PM -0600, Ross Zwisler wrote:
> The "NVDIMM Block Window Driver Writer's Guide":
>
> http://pmem.io/documents/
> http://pmem.io/documents/NVDIMM_DriverWritersGuide-July-2016.pdf
>
> defines the layout of the block window status register. For the July 2016
> version of the spec linked to above, this happens in Figure 4 on page 26.
>
> The only bits defined in this spec are bits 31, 5, 4, 2, 1 and 0. The rest
> of the bits in the status register are reserved, and there is a warning
> following the diagram that says:
>
> Note: The driver cannot assume the value of the RESERVED bits in the
> status register are zero. These reserved bits need to be masked off, and
> the driver must avoid checking the state of those bits.
>
> This change ensures that for hardware implementations that set these
> reserved bits in the status register, the driver won't incorrectly fail the
> block I/Os.
>
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> Reviewed-by: Lee, Chun-Yi <jlee@suse.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: stable@vger.kernel.org # v4.2+
Ping on this patch - through which tree should we merge this for v4.8-rc2?
Dan's nvdimm tree?
> ---
>
> Changes from V1:
> - Rebased onto the v4.8 merge tree. As Joey points out the ND BLK code
> recently moved from drivers/acpi/nfit.c to drivers/acpi/nfit/core.c.
> Since we were in the merge window for v4.8 I didn't know what to use as
> a baseline, so I just used v4.7, which was apparently incorrect. Sorry
> about that.
>
> - Added Joey's reviewed-by.
>
> For stable kernels v4.2 and beyond the v1 patch for drivers/acpi/nfit.c
> applies cleanly and should be used.
>
> ---
> drivers/acpi/nfit/core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 8c234dd..80cc7c0 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -1527,11 +1527,12 @@ static u32 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
> {
> struct nfit_blk_mmio *mmio = &nfit_blk->mmio[DCR];
> u64 offset = nfit_blk->stat_offset + mmio->size * bw;
> + const u32 STATUS_MASK = 0x80000037;
>
> if (mmio->num_lines)
> offset = to_interleave_offset(offset, mmio);
>
> - return readl(mmio->addr.base + offset);
> + return readl(mmio->addr.base + offset) & STATUS_MASK;
> }
>
> static void write_blk_ctl(struct nfit_blk *nfit_blk, unsigned int bw,
> --
> 2.9.0
>
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 20+ messages in thread[parent not found: <20160808191019.GA965-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>]
* Re: [PATCH v2] libnvdimm, nd_blk: mask off reserved status bits
2016-08-08 19:10 ` Ross Zwisler
(?)
(?)
@ 2016-08-08 19:36 ` Dan Williams
-1 siblings, 0 replies; 20+ messages in thread
From: Dan Williams @ 2016-08-08 19:36 UTC (permalink / raw)
To: Ross Zwisler
Cc: linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org,
Rafael J. Wysocki,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Lee, Chun-Yi,
Linux ACPI, Len Brown
On Mon, Aug 8, 2016 at 12:10 PM, Ross Zwisler
<ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> wrote:
> On Tue, Aug 02, 2016 at 12:26:53PM -0600, Ross Zwisler wrote:
>> The "NVDIMM Block Window Driver Writer's Guide":
>>
>> http://pmem.io/documents/
>> http://pmem.io/documents/NVDIMM_DriverWritersGuide-July-2016.pdf
>>
>> defines the layout of the block window status register. For the July 2016
>> version of the spec linked to above, this happens in Figure 4 on page 26.
>>
>> The only bits defined in this spec are bits 31, 5, 4, 2, 1 and 0. The rest
>> of the bits in the status register are reserved, and there is a warning
>> following the diagram that says:
>>
>> Note: The driver cannot assume the value of the RESERVED bits in the
>> status register are zero. These reserved bits need to be masked off, and
>> the driver must avoid checking the state of those bits.
>>
>> This change ensures that for hardware implementations that set these
>> reserved bits in the status register, the driver won't incorrectly fail the
>> block I/Os.
>>
>> Signed-off-by: Ross Zwisler <ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
>> Reviewed-by: Lee, Chun-Yi <jlee-IBi9RG/b67k@public.gmane.org>
>> Cc: Dan Williams <dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>> Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org # v4.2+
>
> Ping on this patch - through which tree should we merge this for v4.8-rc2?
> Dan's nvdimm tree?
It's getting 0-day coverage on my libnvdimm-pending branch and will go
to Linus at the end of the week.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v2] libnvdimm, nd_blk: mask off reserved status bits
@ 2016-08-08 19:36 ` Dan Williams
0 siblings, 0 replies; 20+ messages in thread
From: Dan Williams @ 2016-08-08 19:36 UTC (permalink / raw)
To: Ross Zwisler
Cc: linux-kernel@vger.kernel.org, Rafael J. Wysocki, Len Brown,
Linux ACPI, linux-nvdimm@lists.01.org, Lee, Chun-Yi,
stable@vger.kernel.org
On Mon, Aug 8, 2016 at 12:10 PM, Ross Zwisler
<ross.zwisler@linux.intel.com> wrote:
> On Tue, Aug 02, 2016 at 12:26:53PM -0600, Ross Zwisler wrote:
>> The "NVDIMM Block Window Driver Writer's Guide":
>>
>> http://pmem.io/documents/
>> http://pmem.io/documents/NVDIMM_DriverWritersGuide-July-2016.pdf
>>
>> defines the layout of the block window status register. For the July 2016
>> version of the spec linked to above, this happens in Figure 4 on page 26.
>>
>> The only bits defined in this spec are bits 31, 5, 4, 2, 1 and 0. The rest
>> of the bits in the status register are reserved, and there is a warning
>> following the diagram that says:
>>
>> Note: The driver cannot assume the value of the RESERVED bits in the
>> status register are zero. These reserved bits need to be masked off, and
>> the driver must avoid checking the state of those bits.
>>
>> This change ensures that for hardware implementations that set these
>> reserved bits in the status register, the driver won't incorrectly fail the
>> block I/Os.
>>
>> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
>> Reviewed-by: Lee, Chun-Yi <jlee@suse.com>
>> Cc: Dan Williams <dan.j.williams@intel.com>
>> Cc: stable@vger.kernel.org # v4.2+
>
> Ping on this patch - through which tree should we merge this for v4.8-rc2?
> Dan's nvdimm tree?
It's getting 0-day coverage on my libnvdimm-pending branch and will go
to Linus at the end of the week.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v2] libnvdimm, nd_blk: mask off reserved status bits
@ 2016-08-08 19:36 ` Dan Williams
0 siblings, 0 replies; 20+ messages in thread
From: Dan Williams @ 2016-08-08 19:36 UTC (permalink / raw)
To: Ross Zwisler
Cc: linux-kernel@vger.kernel.org, Rafael J. Wysocki, Len Brown,
Linux ACPI, linux-nvdimm@lists.01.org, Lee, Chun-Yi,
stable@vger.kernel.org
On Mon, Aug 8, 2016 at 12:10 PM, Ross Zwisler
<ross.zwisler@linux.intel.com> wrote:
> On Tue, Aug 02, 2016 at 12:26:53PM -0600, Ross Zwisler wrote:
>> The "NVDIMM Block Window Driver Writer's Guide":
>>
>> http://pmem.io/documents/
>> http://pmem.io/documents/NVDIMM_DriverWritersGuide-July-2016.pdf
>>
>> defines the layout of the block window status register. For the July 2016
>> version of the spec linked to above, this happens in Figure 4 on page 26.
>>
>> The only bits defined in this spec are bits 31, 5, 4, 2, 1 and 0. The rest
>> of the bits in the status register are reserved, and there is a warning
>> following the diagram that says:
>>
>> Note: The driver cannot assume the value of the RESERVED bits in the
>> status register are zero. These reserved bits need to be masked off, and
>> the driver must avoid checking the state of those bits.
>>
>> This change ensures that for hardware implementations that set these
>> reserved bits in the status register, the driver won't incorrectly fail the
>> block I/Os.
>>
>> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
>> Reviewed-by: Lee, Chun-Yi <jlee@suse.com>
>> Cc: Dan Williams <dan.j.williams@intel.com>
>> Cc: stable@vger.kernel.org # v4.2+
>
> Ping on this patch - through which tree should we merge this for v4.8-rc2?
> Dan's nvdimm tree?
It's getting 0-day coverage on my libnvdimm-pending branch and will go
to Linus at the end of the week.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v2] libnvdimm, nd_blk: mask off reserved status bits
@ 2016-08-08 19:36 ` Dan Williams
0 siblings, 0 replies; 20+ messages in thread
From: Dan Williams @ 2016-08-08 19:36 UTC (permalink / raw)
To: Ross Zwisler
Cc: linux-nvdimm@lists.01.org, Rafael J. Wysocki,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Lee, Chun-Yi <jlee@suse.com>, Linux ACPI <linux-acpi@vger.kernel.org>, Len Brown
On Mon, Aug 8, 2016 at 12:10 PM, Ross Zwisler
<ross.zwisler@linux.intel.com> wrote:
> On Tue, Aug 02, 2016 at 12:26:53PM -0600, Ross Zwisler wrote:
>> The "NVDIMM Block Window Driver Writer's Guide":
>>
>> http://pmem.io/documents/
>> http://pmem.io/documents/NVDIMM_DriverWritersGuide-July-2016.pdf
>>
>> defines the layout of the block window status register. For the July 2016
>> version of the spec linked to above, this happens in Figure 4 on page 26.
>>
>> The only bits defined in this spec are bits 31, 5, 4, 2, 1 and 0. The rest
>> of the bits in the status register are reserved, and there is a warning
>> following the diagram that says:
>>
>> Note: The driver cannot assume the value of the RESERVED bits in the
>> status register are zero. These reserved bits need to be masked off, and
>> the driver must avoid checking the state of those bits.
>>
>> This change ensures that for hardware implementations that set these
>> reserved bits in the status register, the driver won't incorrectly fail the
>> block I/Os.
>>
>> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
>> Reviewed-by: Lee, Chun-Yi <jlee@suse.com>
>> Cc: Dan Williams <dan.j.williams@intel.com>
>> Cc: stable@vger.kernel.org # v4.2+
>
> Ping on this patch - through which tree should we merge this for v4.8-rc2?
> Dan's nvdimm tree?
It's getting 0-day coverage on my libnvdimm-pending branch and will go
to Linus at the end of the week.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v2] libnvdimm, nd_blk: mask off reserved status bits
2016-08-02 18:26 ` Ross Zwisler
` (3 preceding siblings ...)
(?)
@ 2016-08-08 19:12 ` Ross Zwisler
-1 siblings, 0 replies; 20+ messages in thread
From: Ross Zwisler @ 2016-08-08 19:12 UTC (permalink / raw)
To: stable
On Tue, Aug 02, 2016 at 12:26:53PM -0600, Ross Zwisler wrote:
> The "NVDIMM Block Window Driver Writer's Guide":
>
> http://pmem.io/documents/
> http://pmem.io/documents/NVDIMM_DriverWritersGuide-July-2016.pdf
>
> defines the layout of the block window status register. For the July 2016
> version of the spec linked to above, this happens in Figure 4 on page 26.
>
> The only bits defined in this spec are bits 31, 5, 4, 2, 1 and 0. The rest
> of the bits in the status register are reserved, and there is a warning
> following the diagram that says:
>
> Note: The driver cannot assume the value of the RESERVED bits in the
> status register are zero. These reserved bits need to be masked off, and
> the driver must avoid checking the state of those bits.
>
> This change ensures that for hardware implementations that set these
> reserved bits in the status register, the driver won't incorrectly fail the
> block I/Os.
>
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> Reviewed-by: Lee, Chun-Yi <jlee@suse.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: stable@vger.kernel.org # v4.2+
Sorry, I neglected to add <> braces around the stable@vger.kernel.org
address, so git-send-email mangled the address.
Can you pick up this patch for stable kernels v4.2 and beyond?
Thanks,
- Ross
> ---
>
> Changes from V1:
> - Rebased onto the v4.8 merge tree. As Joey points out the ND BLK code
> recently moved from drivers/acpi/nfit.c to drivers/acpi/nfit/core.c.
> Since we were in the merge window for v4.8 I didn't know what to use as
> a baseline, so I just used v4.7, which was apparently incorrect. Sorry
> about that.
>
> - Added Joey's reviewed-by.
>
> For stable kernels v4.2 and beyond the v1 patch for drivers/acpi/nfit.c
> applies cleanly and should be used.
>
> ---
> drivers/acpi/nfit/core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 8c234dd..80cc7c0 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -1527,11 +1527,12 @@ static u32 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
> {
> struct nfit_blk_mmio *mmio = &nfit_blk->mmio[DCR];
> u64 offset = nfit_blk->stat_offset + mmio->size * bw;
> + const u32 STATUS_MASK = 0x80000037;
>
> if (mmio->num_lines)
> offset = to_interleave_offset(offset, mmio);
>
> - return readl(mmio->addr.base + offset);
> + return readl(mmio->addr.base + offset) & STATUS_MASK;
> }
>
> static void write_blk_ctl(struct nfit_blk *nfit_blk, unsigned int bw,
> --
> 2.9.0
>
^ permalink raw reply [flat|nested] 20+ messages in thread