From: Jerry Hoemann <jerry.hoemann@hpe.com> To: Dan Williams <dan.j.williams@intel.com> Cc: Christoph Hellwig <hch@infradead.org>, linux-acpi@vger.kernel.org, rafael.j.wysocki@intel.com, linux-nvdimm@lists.01.org Subject: Re: [PATCH v11 1/5] nfit, libnvdimm: clarify "commands" vs "_DSMs" Date: Thu, 5 May 2016 10:24:51 -0600 [thread overview] Message-ID: <20160505162451.GB6808@tevye.fc.hp.com> (raw) In-Reply-To: <146189774794.29835.11997438198616276280.stgit@dwillia2-desk3.amr.corp.intel.com> On Thu, Apr 28, 2016 at 07:42:28PM -0700, Dan Williams wrote: > Clarify the distinction between "commands", the ioctls userspace calls > to request the kernel take some action on a given dimm device, and > "_DSMs", the actual function numbers used in the firmware interface to > the DIMM. _DSMs are ACPI specific whereas commands are Linux kernel > generic. > > This is in preparation for breaking the 1:1 implicit relationship > between the kernel ioctl number space and the firmware specific function > numbers. > > Cc: Jerry Hoemann <jerry.hoemann@hpe.com> > Cc: Christoph Hellwig <hch@infradead.org> > Signed-off-by: Dan Williams <dan.j.williams@intel.com> > --- > drivers/acpi/nfit.c | 21 +++++++++++++-------- > drivers/acpi/nfit.h | 4 ++-- > drivers/nvdimm/bus.c | 8 ++++---- > drivers/nvdimm/core.c | 2 +- > drivers/nvdimm/dimm_devs.c | 18 ++++++++++++------ > drivers/nvdimm/nd-core.h | 2 +- > include/linux/libnvdimm.h | 5 +++-- > tools/testing/nvdimm/test/nfit.c | 27 ++++++++++++++------------- > 8 files changed, 50 insertions(+), 37 deletions(-) > .... > diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c > index 3187322eeed7..ed899a411c22 100644 > --- a/tools/testing/nvdimm/test/nfit.c > +++ b/tools/testing/nvdimm/test/nfit.c > @@ -344,8 +344,9 @@ static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc, > > if (nvdimm) { > struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); > + unsigned long cmd_mask = nvdimm_cmd_mask(nvdimm); > > - if (!nfit_mem || !test_bit(cmd, &nfit_mem->dsm_mask)) > + if (!nfit_mem || !test_bit(cmd, &cmd_mask)) > return -ENOTTY; > > /* lookup label space for the given dimm */ > @@ -374,7 +375,7 @@ static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc, > } else { > struct ars_state *ars_state = &t->ars_state; > > - if (!nd_desc || !test_bit(cmd, &nd_desc->dsm_mask)) > + if (!nd_desc || !test_bit(cmd, &nd_desc->cmd_mask)) > return -ENOTTY; > > switch (cmd) { > @@ -1251,13 +1252,13 @@ static void nfit_test0_setup(struct nfit_test *t) > post_ars_status(&t->ars_state, t->spa_set_dma[0], SPA0_SIZE); > > acpi_desc = &t->acpi_desc; > - set_bit(ND_CMD_GET_CONFIG_SIZE, &acpi_desc->dimm_dsm_force_en); > - set_bit(ND_CMD_GET_CONFIG_DATA, &acpi_desc->dimm_dsm_force_en); > - set_bit(ND_CMD_SET_CONFIG_DATA, &acpi_desc->dimm_dsm_force_en); > - set_bit(ND_CMD_ARS_CAP, &acpi_desc->bus_dsm_force_en); > - set_bit(ND_CMD_ARS_START, &acpi_desc->bus_dsm_force_en); > - set_bit(ND_CMD_ARS_STATUS, &acpi_desc->bus_dsm_force_en); > - set_bit(ND_CMD_CLEAR_ERROR, &acpi_desc->bus_dsm_force_en); > + set_bit(ND_CMD_GET_CONFIG_SIZE, &acpi_desc->dimm_cmd_force_en); > + set_bit(ND_CMD_GET_CONFIG_DATA, &acpi_desc->dimm_cmd_force_en); > + set_bit(ND_CMD_SET_CONFIG_DATA, &acpi_desc->dimm_cmd_force_en); > + set_bit(ND_CMD_ARS_CAP, &acpi_desc->bus_cmd_force_en); > + set_bit(ND_CMD_ARS_START, &acpi_desc->bus_cmd_force_en); > + set_bit(ND_CMD_ARS_STATUS, &acpi_desc->bus_cmd_force_en); > + set_bit(ND_CMD_CLEAR_ERROR, &acpi_desc->bus_cmd_force_en); > } Do you still want to have ND_CMD_CALL bit set? ND_CMD_CALL is defined in your next patch, so you'll need to re-order or put another patch to this function to set ND_CMD_CALL. > > static void nfit_test1_setup(struct nfit_test *t) > @@ -1315,10 +1316,10 @@ static void nfit_test1_setup(struct nfit_test *t) > post_ars_status(&t->ars_state, t->spa_set_dma[0], SPA2_SIZE); > > acpi_desc = &t->acpi_desc; > - set_bit(ND_CMD_ARS_CAP, &acpi_desc->bus_dsm_force_en); > - set_bit(ND_CMD_ARS_START, &acpi_desc->bus_dsm_force_en); > - set_bit(ND_CMD_ARS_STATUS, &acpi_desc->bus_dsm_force_en); > - set_bit(ND_CMD_CLEAR_ERROR, &acpi_desc->bus_dsm_force_en); > + set_bit(ND_CMD_ARS_CAP, &acpi_desc->bus_cmd_force_en); > + set_bit(ND_CMD_ARS_START, &acpi_desc->bus_cmd_force_en); > + set_bit(ND_CMD_ARS_STATUS, &acpi_desc->bus_cmd_force_en); > + set_bit(ND_CMD_CLEAR_ERROR, &acpi_desc->bus_cmd_force_en); > } > > static int nfit_test_blk_do_io(struct nd_blk_region *ndbr, resource_size_t dpa, -- ----------------------------------------------------------------------------- Jerry Hoemann Software Engineer Hewlett Packard Enterprise ----------------------------------------------------------------------------- _______________________________________________ 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: Jerry Hoemann <jerry.hoemann@hpe.com> To: Dan Williams <dan.j.williams@intel.com> Cc: linux-nvdimm@lists.01.org, Christoph Hellwig <hch@infradead.org>, linux-acpi@vger.kernel.org, rafael.j.wysocki@intel.com Subject: Re: [PATCH v11 1/5] nfit, libnvdimm: clarify "commands" vs "_DSMs" Date: Thu, 5 May 2016 10:24:51 -0600 [thread overview] Message-ID: <20160505162451.GB6808@tevye.fc.hp.com> (raw) In-Reply-To: <146189774794.29835.11997438198616276280.stgit@dwillia2-desk3.amr.corp.intel.com> On Thu, Apr 28, 2016 at 07:42:28PM -0700, Dan Williams wrote: > Clarify the distinction between "commands", the ioctls userspace calls > to request the kernel take some action on a given dimm device, and > "_DSMs", the actual function numbers used in the firmware interface to > the DIMM. _DSMs are ACPI specific whereas commands are Linux kernel > generic. > > This is in preparation for breaking the 1:1 implicit relationship > between the kernel ioctl number space and the firmware specific function > numbers. > > Cc: Jerry Hoemann <jerry.hoemann@hpe.com> > Cc: Christoph Hellwig <hch@infradead.org> > Signed-off-by: Dan Williams <dan.j.williams@intel.com> > --- > drivers/acpi/nfit.c | 21 +++++++++++++-------- > drivers/acpi/nfit.h | 4 ++-- > drivers/nvdimm/bus.c | 8 ++++---- > drivers/nvdimm/core.c | 2 +- > drivers/nvdimm/dimm_devs.c | 18 ++++++++++++------ > drivers/nvdimm/nd-core.h | 2 +- > include/linux/libnvdimm.h | 5 +++-- > tools/testing/nvdimm/test/nfit.c | 27 ++++++++++++++------------- > 8 files changed, 50 insertions(+), 37 deletions(-) > .... > diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c > index 3187322eeed7..ed899a411c22 100644 > --- a/tools/testing/nvdimm/test/nfit.c > +++ b/tools/testing/nvdimm/test/nfit.c > @@ -344,8 +344,9 @@ static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc, > > if (nvdimm) { > struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); > + unsigned long cmd_mask = nvdimm_cmd_mask(nvdimm); > > - if (!nfit_mem || !test_bit(cmd, &nfit_mem->dsm_mask)) > + if (!nfit_mem || !test_bit(cmd, &cmd_mask)) > return -ENOTTY; > > /* lookup label space for the given dimm */ > @@ -374,7 +375,7 @@ static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc, > } else { > struct ars_state *ars_state = &t->ars_state; > > - if (!nd_desc || !test_bit(cmd, &nd_desc->dsm_mask)) > + if (!nd_desc || !test_bit(cmd, &nd_desc->cmd_mask)) > return -ENOTTY; > > switch (cmd) { > @@ -1251,13 +1252,13 @@ static void nfit_test0_setup(struct nfit_test *t) > post_ars_status(&t->ars_state, t->spa_set_dma[0], SPA0_SIZE); > > acpi_desc = &t->acpi_desc; > - set_bit(ND_CMD_GET_CONFIG_SIZE, &acpi_desc->dimm_dsm_force_en); > - set_bit(ND_CMD_GET_CONFIG_DATA, &acpi_desc->dimm_dsm_force_en); > - set_bit(ND_CMD_SET_CONFIG_DATA, &acpi_desc->dimm_dsm_force_en); > - set_bit(ND_CMD_ARS_CAP, &acpi_desc->bus_dsm_force_en); > - set_bit(ND_CMD_ARS_START, &acpi_desc->bus_dsm_force_en); > - set_bit(ND_CMD_ARS_STATUS, &acpi_desc->bus_dsm_force_en); > - set_bit(ND_CMD_CLEAR_ERROR, &acpi_desc->bus_dsm_force_en); > + set_bit(ND_CMD_GET_CONFIG_SIZE, &acpi_desc->dimm_cmd_force_en); > + set_bit(ND_CMD_GET_CONFIG_DATA, &acpi_desc->dimm_cmd_force_en); > + set_bit(ND_CMD_SET_CONFIG_DATA, &acpi_desc->dimm_cmd_force_en); > + set_bit(ND_CMD_ARS_CAP, &acpi_desc->bus_cmd_force_en); > + set_bit(ND_CMD_ARS_START, &acpi_desc->bus_cmd_force_en); > + set_bit(ND_CMD_ARS_STATUS, &acpi_desc->bus_cmd_force_en); > + set_bit(ND_CMD_CLEAR_ERROR, &acpi_desc->bus_cmd_force_en); > } Do you still want to have ND_CMD_CALL bit set? ND_CMD_CALL is defined in your next patch, so you'll need to re-order or put another patch to this function to set ND_CMD_CALL. > > static void nfit_test1_setup(struct nfit_test *t) > @@ -1315,10 +1316,10 @@ static void nfit_test1_setup(struct nfit_test *t) > post_ars_status(&t->ars_state, t->spa_set_dma[0], SPA2_SIZE); > > acpi_desc = &t->acpi_desc; > - set_bit(ND_CMD_ARS_CAP, &acpi_desc->bus_dsm_force_en); > - set_bit(ND_CMD_ARS_START, &acpi_desc->bus_dsm_force_en); > - set_bit(ND_CMD_ARS_STATUS, &acpi_desc->bus_dsm_force_en); > - set_bit(ND_CMD_CLEAR_ERROR, &acpi_desc->bus_dsm_force_en); > + set_bit(ND_CMD_ARS_CAP, &acpi_desc->bus_cmd_force_en); > + set_bit(ND_CMD_ARS_START, &acpi_desc->bus_cmd_force_en); > + set_bit(ND_CMD_ARS_STATUS, &acpi_desc->bus_cmd_force_en); > + set_bit(ND_CMD_CLEAR_ERROR, &acpi_desc->bus_cmd_force_en); > } > > static int nfit_test_blk_do_io(struct nd_blk_region *ndbr, resource_size_t dpa, -- ----------------------------------------------------------------------------- Jerry Hoemann Software Engineer Hewlett Packard Enterprise -----------------------------------------------------------------------------
next prev parent reply other threads:[~2016-05-05 16:24 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-04-29 2:42 [PATCH v11 0/5] libnvidmm, nfit: dimm command marshaling Dan Williams 2016-04-29 2:42 ` Dan Williams 2016-04-29 2:42 ` [PATCH v11 1/5] nfit, libnvdimm: clarify "commands" vs "_DSMs" Dan Williams 2016-04-29 2:42 ` Dan Williams 2016-05-05 16:24 ` Jerry Hoemann [this message] 2016-05-05 16:24 ` Jerry Hoemann 2016-05-05 23:38 ` Dan Williams 2016-05-05 23:38 ` Dan Williams 2016-04-29 2:42 ` [PATCH v11 2/5] nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism Dan Williams 2016-04-29 2:42 ` Dan Williams 2016-05-05 18:01 ` Jerry Hoemann 2016-05-05 18:01 ` Jerry Hoemann 2016-05-05 23:44 ` Dan Williams 2016-05-05 23:44 ` Dan Williams 2016-05-06 14:52 ` Linda Knippers 2016-05-06 14:52 ` Linda Knippers 2016-04-29 2:42 ` [PATCH v11 3/5] nfit: disable vendor specific commands Dan Williams 2016-04-29 2:42 ` Dan Williams 2016-04-29 2:42 ` [PATCH v11 4/5] tools/testing/nvdimm: ND_CMD_CALL support Dan Williams 2016-04-29 2:42 ` Dan Williams 2016-04-29 2:42 ` [PATCH v11 5/5] nfit: add sysfs dimm 'family' and 'dsm_mask' attributes Dan Williams 2016-04-29 2:42 ` Dan Williams 2016-05-05 16:25 ` Jerry Hoemann 2016-05-05 16:25 ` Jerry Hoemann
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=20160505162451.GB6808@tevye.fc.hp.com \ --to=jerry.hoemann@hpe.com \ --cc=dan.j.williams@intel.com \ --cc=hch@infradead.org \ --cc=linux-acpi@vger.kernel.org \ --cc=linux-nvdimm@lists.01.org \ --cc=rafael.j.wysocki@intel.com \ /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: linkBe 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.