All of lore.kernel.org
 help / color / mirror / Atom feed
From: joeyli <jlee-IBi9RG/b67k@public.gmane.org>
To: Ross Zwisler <ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Cc: linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org,
	"Rafael J. Wysocki" <rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Len Brown <lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH] libnvdimm, nd_blk: mask off reserved status bits
Date: Mon, 1 Aug 2016 14:00:49 +0800	[thread overview]
Message-ID: <20160801060049.GI9236@linux-rxt1.site> (raw)
In-Reply-To: <20160729205912.20436-1-ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

Hi Ross,

On Fri, Jul 29, 2016 at 02:59:12PM -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>
> Cc: Dan Williams <dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> ---
>  drivers/acpi/nfit.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> index 1f0e060..375c10f 100644
> --- a/drivers/acpi/nfit.c
> +++ b/drivers/acpi/nfit.c

The drivers/acpi/nfit.c is moved to drivers/acpi/nfit/core.c

> @@ -1396,11 +1396,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

Other parts are good to me.

Reviewed-by: Lee, Chun-Yi <jlee-IBi9RG/b67k@public.gmane.org>

Regards
Joey Lee

WARNING: multiple messages have this Message-ID (diff)
From: joeyli <jlee@suse.com>
To: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: linux-nvdimm@lists.01.org,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	linux-acpi@vger.kernel.org, Len Brown <lenb@kernel.org>
Subject: Re: [PATCH] libnvdimm, nd_blk: mask off reserved status bits
Date: Mon, 1 Aug 2016 14:00:49 +0800	[thread overview]
Message-ID: <20160801060049.GI9236@linux-rxt1.site> (raw)
In-Reply-To: <20160729205912.20436-1-ross.zwisler@linux.intel.com>

Hi Ross,

On Fri, Jul 29, 2016 at 02:59:12PM -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>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/acpi/nfit.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> index 1f0e060..375c10f 100644
> --- a/drivers/acpi/nfit.c
> +++ b/drivers/acpi/nfit.c

The drivers/acpi/nfit.c is moved to drivers/acpi/nfit/core.c

> @@ -1396,11 +1396,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

Other parts are good to me.

Reviewed-by: Lee, Chun-Yi <jlee@suse.com>

Regards
Joey Lee
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

WARNING: multiple messages have this Message-ID (diff)
From: joeyli <jlee@suse.com>
To: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org, linux-nvdimm@ml01.01.org,
	Dan Williams <dan.j.williams@intel.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] libnvdimm, nd_blk: mask off reserved status bits
Date: Mon, 1 Aug 2016 14:00:49 +0800	[thread overview]
Message-ID: <20160801060049.GI9236@linux-rxt1.site> (raw)
In-Reply-To: <20160729205912.20436-1-ross.zwisler@linux.intel.com>

Hi Ross,

On Fri, Jul 29, 2016 at 02:59:12PM -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>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/acpi/nfit.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> index 1f0e060..375c10f 100644
> --- a/drivers/acpi/nfit.c
> +++ b/drivers/acpi/nfit.c

The drivers/acpi/nfit.c is moved to drivers/acpi/nfit/core.c

> @@ -1396,11 +1396,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

Other parts are good to me.

Reviewed-by: Lee, Chun-Yi <jlee@suse.com>

Regards
Joey Lee

WARNING: multiple messages have this Message-ID (diff)
From: joeyli <jlee@suse.com>
To: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org, linux-nvdimm@lists.01.org,
	Dan Williams <dan.j.williams@intel.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] libnvdimm, nd_blk: mask off reserved status bits
Date: Mon, 1 Aug 2016 14:00:49 +0800	[thread overview]
Message-ID: <20160801060049.GI9236@linux-rxt1.site> (raw)
In-Reply-To: <20160729205912.20436-1-ross.zwisler@linux.intel.com>

Hi Ross,

On Fri, Jul 29, 2016 at 02:59:12PM -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>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/acpi/nfit.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> index 1f0e060..375c10f 100644
> --- a/drivers/acpi/nfit.c
> +++ b/drivers/acpi/nfit.c

The drivers/acpi/nfit.c is moved to drivers/acpi/nfit/core.c

> @@ -1396,11 +1396,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

Other parts are good to me.

Reviewed-by: Lee, Chun-Yi <jlee@suse.com>

Regards
Joey Lee

  parent reply	other threads:[~2016-08-01  6:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-29 20:59 [PATCH] libnvdimm, nd_blk: mask off reserved status bits Ross Zwisler
2016-07-29 20:59 ` Ross Zwisler
2016-07-29 20:59 ` Ross Zwisler
     [not found] ` <20160729205912.20436-1-ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-08-01  6:00   ` joeyli [this message]
2016-08-01  6:00     ` joeyli
2016-08-01  6:00     ` joeyli
2016-08-01  6:00     ` joeyli
2016-08-02 18:26   ` [PATCH v2] " Ross Zwisler
2016-08-02 18:26     ` Ross Zwisler
2016-08-02 18:26     ` Ross Zwisler
2016-08-02 18:26     ` Ross Zwisler
     [not found]     ` <20160802182653.6647-1-ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-08-08 19:10       ` Ross Zwisler
2016-08-08 19:10         ` Ross Zwisler
2016-08-08 19:10         ` Ross Zwisler
2016-08-08 19:10         ` Ross Zwisler
     [not found]         ` <20160808191019.GA965-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-08-08 19:36           ` Dan Williams
2016-08-08 19:36             ` Dan Williams
2016-08-08 19:36             ` Dan Williams
2016-08-08 19:36             ` Dan Williams
2016-08-08 19:12     ` Ross Zwisler

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=20160801060049.GI9236@linux-rxt1.site \
    --to=jlee-ibi9rg/b67k@public.gmane.org \
    --cc=lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org \
    --cc=rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org \
    --cc=ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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.