* [PATCH] nfit, nd_blk: BLK status register is only 32 bits
@ 2015-08-20 22:27 ` Ross Zwisler
0 siblings, 0 replies; 4+ messages in thread
From: Ross Zwisler @ 2015-08-20 22:27 UTC (permalink / raw)
To: linux-kernel
Cc: Ross Zwisler, Rafael J. Wysocki, Len Brown, linux-acpi,
linux-nvdimm, Nicholas Moulin, Dan Williams
Only read 32 bits for the BLK status register in read_blk_stat().
The format and size of this register is defined in the
"NVDIMM Driver Writer's guide":
http://pmem.io/documents/NVDIMM_Driver_Writers_Guide.pdf
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reported-by: Nicholas Moulin <nicholas.w.moulin@linux.intel.com>
---
drivers/acpi/nfit.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index 7c2638f..8689ee1 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -1009,7 +1009,7 @@ static void wmb_blk(struct nfit_blk *nfit_blk)
wmb_pmem();
}
-static u64 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
+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;
@@ -1017,7 +1017,7 @@ static u64 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
if (mmio->num_lines)
offset = to_interleave_offset(offset, mmio);
- return readq(mmio->base + offset);
+ return readl(mmio->base + offset);
}
static void write_blk_ctl(struct nfit_blk *nfit_blk, unsigned int bw,
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] nfit, nd_blk: BLK status register is only 32 bits
@ 2015-08-20 22:27 ` Ross Zwisler
0 siblings, 0 replies; 4+ messages in thread
From: Ross Zwisler @ 2015-08-20 22:27 UTC (permalink / raw)
To: linux-kernel
Cc: Ross Zwisler, Rafael J. Wysocki, Len Brown, linux-acpi,
linux-nvdimm, Nicholas Moulin, Dan Williams
Only read 32 bits for the BLK status register in read_blk_stat().
The format and size of this register is defined in the
"NVDIMM Driver Writer's guide":
http://pmem.io/documents/NVDIMM_Driver_Writers_Guide.pdf
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reported-by: Nicholas Moulin <nicholas.w.moulin@linux.intel.com>
---
drivers/acpi/nfit.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index 7c2638f..8689ee1 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -1009,7 +1009,7 @@ static void wmb_blk(struct nfit_blk *nfit_blk)
wmb_pmem();
}
-static u64 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
+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;
@@ -1017,7 +1017,7 @@ static u64 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
if (mmio->num_lines)
offset = to_interleave_offset(offset, mmio);
- return readq(mmio->base + offset);
+ return readl(mmio->base + offset);
}
static void write_blk_ctl(struct nfit_blk *nfit_blk, unsigned int bw,
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] nfit, nd_blk: BLK status register is only 32 bits
2015-08-20 22:27 ` Ross Zwisler
(?)
@ 2015-08-24 17:02 ` Jeff Moyer
2015-08-24 17:40 ` Ross Zwisler
-1 siblings, 1 reply; 4+ messages in thread
From: Jeff Moyer @ 2015-08-24 17:02 UTC (permalink / raw)
To: Ross Zwisler
Cc: linux-kernel, linux-nvdimm, Rafael J. Wysocki, linux-acpi, Len Brown
Ross Zwisler <ross.zwisler@linux.intel.com> writes:
> Only read 32 bits for the BLK status register in read_blk_stat().
>
> The format and size of this register is defined in the
> "NVDIMM Driver Writer's guide":
>
> http://pmem.io/documents/NVDIMM_Driver_Writers_Guide.pdf
>
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> Reported-by: Nicholas Moulin <nicholas.w.moulin@linux.intel.com>
Looks fine,
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
However, now that you've drawn attention to that code, I'll note that
there is no checking of the pending or retry bits. In fact,
ACPI_NFIT_CONTROL_BUFFERED isn't even checked upon loading the tables.
Is this on a todo list somewhere?
Cheers,
Jeff
> ---
> drivers/acpi/nfit.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> index 7c2638f..8689ee1 100644
> --- a/drivers/acpi/nfit.c
> +++ b/drivers/acpi/nfit.c
> @@ -1009,7 +1009,7 @@ static void wmb_blk(struct nfit_blk *nfit_blk)
> wmb_pmem();
> }
>
> -static u64 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
> +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;
> @@ -1017,7 +1017,7 @@ static u64 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw)
> if (mmio->num_lines)
> offset = to_interleave_offset(offset, mmio);
>
> - return readq(mmio->base + offset);
> + return readl(mmio->base + offset);
> }
>
> static void write_blk_ctl(struct nfit_blk *nfit_blk, unsigned int bw,
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nfit, nd_blk: BLK status register is only 32 bits
2015-08-24 17:02 ` Jeff Moyer
@ 2015-08-24 17:40 ` Ross Zwisler
0 siblings, 0 replies; 4+ messages in thread
From: Ross Zwisler @ 2015-08-24 17:40 UTC (permalink / raw)
To: Jeff Moyer
Cc: Ross Zwisler, linux-kernel, linux-nvdimm, Rafael J. Wysocki,
linux-acpi, Len Brown
On Mon, Aug 24, 2015 at 01:02:17PM -0400, Jeff Moyer wrote:
> Ross Zwisler <ross.zwisler@linux.intel.com> writes:
>
> > Only read 32 bits for the BLK status register in read_blk_stat().
> >
> > The format and size of this register is defined in the
> > "NVDIMM Driver Writer's guide":
> >
> > http://pmem.io/documents/NVDIMM_Driver_Writers_Guide.pdf
> >
> > Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> > Reported-by: Nicholas Moulin <nicholas.w.moulin@linux.intel.com>
>
> Looks fine,
>
> Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
>
> However, now that you've drawn attention to that code, I'll note that
> there is no checking of the pending or retry bits. In fact,
> ACPI_NFIT_CONTROL_BUFFERED isn't even checked upon loading the tables.
> Is this on a todo list somewhere?
Yep, you're right, we do need to add support for each of these. I'm planning
on doing it unless someone else gets to it first.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-08-24 17:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-20 22:27 [PATCH] nfit, nd_blk: BLK status register is only 32 bits Ross Zwisler
2015-08-20 22:27 ` Ross Zwisler
2015-08-24 17:02 ` Jeff Moyer
2015-08-24 17:40 ` Ross Zwisler
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.