Re: [PATCH] pci/vmd: Move srcu cleanup after bus/irq domain removal

2017-06-20 Thread Jon Derrick
+linux-pci On 06/20/2017 04:13 PM, Jon Derrick wrote: > Recent __call_srcu changes have exposed that we need to cleanup srcu > structures after pci_stop_root_bus calls into vmd_msi_free. > > Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> > Acked-by: Keith Busch &

[PATCH] pci/vmd: Move srcu cleanup after bus/irq domain removal

2017-06-20 Thread Jon Derrick
Recent __call_srcu changes have exposed that we need to cleanup srcu structures after pci_stop_root_bus calls into vmd_msi_free. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> Acked-by: Keith Busch <keith.bu...@intel.com> Cc: <sta...@vger.kernel.org> # 4.11 --- driv

Re: RFC: pwritev2 regression test for invalid flags

2017-06-15 Thread Jon Derrick
Hi Zanella, On 06/15/2017 04:10 PM, Adhemerval Zanella wrote: > After the issue with LO_HI_LONG definition on x86_64-linux-gnu, I planed to > add > this patch to check the above patch for correct check for invalid flags (which > would also have show this issue with LO_HI_LONG being used on >

Re: BUG: hot removal during writes on ext4 formatted nvme device

2017-05-18 Thread Jon Derrick
Hi Ming, Dmitry, Ming, > Also the following patch fixes one issue in remove path. > > http://marc.info/?l=linux-block=149498450028434=2 > > So could you test v4.12-rc1(d3cfb2a0 is merged) with the above patch? Thanks for the suggestion but it still resulted in the same BUG. Dmitry, >

[PATCH] nvme/scsi: Consider LBA format in IO splitting calculation

2017-04-24 Thread Jon Derrick
that calculation and enables IO splitting in these circumstances. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- drivers/nvme/host/scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/scsi.c b/drivers/nvme/host/scsi.c index f49ae27..9

[PATCH] block/sed: Fix opal user range check and unused variables

2017-03-06 Thread Jon Derrick
Fixes check that the opal user is within the range, and cleans up unused method variables. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/block/sed-opal.c b/block/sed-opal.c index 1

Re: block/sed-opal.c: 2 * bad if tests ?

2017-03-06 Thread Jon Derrick
On 03/06/2017 05:00 AM, David Binderman wrote: > Hello there, > > 1. > > block/sed-opal.c:2136:40: warning: logical ‘and’ of mutually exclusive tests > is always false [-Wlogical-op] > > Source code is > > if (lk_unlk->session.who < OPAL_USER1 && > lk_unlk->session.who >

[PATCH] block/sed: Embed function data into the function sequence

2017-02-22 Thread Jon Derrick
By embedding the function data with the function sequence, we can eliminate the external function data and state variable code. It also made obvious some other small cleanups. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- This is 4/4 of [1]: Reverted opal_lock_unlock condi

Re: [PATCHv4 4/4] block/sed: Embed function data into the function sequence

2017-02-22 Thread Jon Derrick
On 02/22/2017 12:13 AM, Christoph Hellwig wrote: >> +if (!lock_held) >> +mutex_lock(>dev_lock); > > No conditional locking, please. I guess I causesd this by asking you > to remove __opal_lock_unlock, but it seems we'd either need to keep it > in the end. > > Except for that the

[PATCHv4 2/4] block/sed: Add helper to qualify response tokens

2017-02-21 Thread Jon Derrick
Add helper which verifies the response token is valid and matches the expected value. Merges token_type and response_get_token. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> Reviewed-by: Scott Bauer <scott.ba...@intel.com> --- block/sed

[PATCHv4 1/4] block/sed: Use ssize_t on atom parsers to return errors

2017-02-21 Thread Jon Derrick
The short atom parser can return an errno from decoding but does not currently return the error as a signed value. Convert all of the parsers to ssize_t. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> Reviewed-by: Scott Bauer <scott.ba...@intel.com> --- block/sed

[PATCHv4 4/4] block/sed: Embed function data into the function sequence

2017-02-21 Thread Jon Derrick
By embedding the function data with the function sequence, we can eliminate the external function data and state variable code. It also made obvious some other small cleanups. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c

[PATCHv4 0/4] OPAL patches, cont'd

2017-02-21 Thread Jon Derrick
/5 to 4/5 The first three in the series have been reviewed already but I wanted to squash them with the last patch since they haven't been pulled yet. The last patch is an attempt to refactor some of the awkward func data and state separation into a common struct Jon Derrick (4): block/sed: Use ssize_

[PATCHv3 2/4] block/sed: Add helper to qualify response tokens

2017-02-21 Thread Jon Derrick
Add helper which verifies the response token is valid and matches the expected value. Merges token_type and response_get_token. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> Reviewed-by: Scott Bauer <scott.ba...@intel.com> --- block/sed

[PATCHv3 1/4] block/sed: Use ssize_t on atom parsers to return errors

2017-02-21 Thread Jon Derrick
The short atom parser can return an errno from decoding but does not currently return the error as a signed value. Convert all of the parsers to ssize_t. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> Reviewed-by: Scott Bauer <scott.ba...@intel.com> --- block/sed

[PATCHv3 0/4] OPAL patches cont'd

2017-02-21 Thread Jon Derrick
e last patch is an attempt to refactor some of the awkward func data and state separation into a common struct Jon Derrick (4): block/sed: Use ssize_t on atom parsers to return errors block/sed: Add helper to qualify response tokens block/sed: Check received header lengths block/sed: Embed fu

[PATCHv3 4/4] block/sed: Embed function data into the function sequence

2017-02-21 Thread Jon Derrick
By embedding the function data with the function sequence, we can eliminate the external function data and state variable code. It also made obvious some other small cleanups. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c

[PATCHv3 3/4] block/sed: Check received header lengths

2017-02-21 Thread Jon Derrick
Add a buffer size check against discovery and response header lengths before we loop over their buffers. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> Reviewed-by: Scott Bauer <scott.ba...@intel.com> --- block/sed-opal.c | 35 +-- 1 file

[PATCHv2 0/5] OPAL patche'd cont'd

2017-02-17 Thread Jon Derrick
uct Jon Derrick (5): block/sed: Use ssize_t on atom parsers to return errors block/sed: Add helper to qualify response tokens block/sed: Check received header lengths block/sed: Embed function data into the function sequence block/sed: Eliminate state variable block/sed-opal.c |

[PATCHv2 1/5] block/sed: Use ssize_t on atom parsers to return errors

2017-02-17 Thread Jon Derrick
The short atom parser can return an errno from decoding but does not currently return the error as a signed value. Convert all of the parsers to ssize_t. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 28 ++-- 1 file changed, 14 inse

[PATCHv2 4/5] block/sed: Embed function data into the function sequence

2017-02-17 Thread Jon Derrick
By embedding the function data with the function sequence, this eliminates a lot of the code that needs to set it in other places. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 358 +-- 1 file change

[PATCHv2 5/5] block/sed: Eliminate state variable

2017-02-17 Thread Jon Derrick
Now that the function data is embedded with the function, there is no need to carry a device state variable. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/block/sed-opal.c b

[PATCHv2 3/5] block/sed: Check received header lengths

2017-02-17 Thread Jon Derrick
Add a buffer size check against discovery and response header lengths before we loop over their buffers. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 35 +-- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a

[PATCHv2 2/5] block/sed: Add helper to qualify response tokens

2017-02-17 Thread Jon Derrick
Add helper which verifies the response token is valid and matches the expected value. Merges token_type and response_get_token. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 61 +++- 1 file chang

[PATCH 3/5] block/sed: Check received header lengths

2017-02-17 Thread Jon Derrick
Add a buffer size check against discovery and response header lengths before we loop over their buffers. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 35 +-- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a

[PATCH 5/5] block/sed: Eliminate state variable

2017-02-17 Thread Jon Derrick
Now that the function data is embedded with the function, there is no need to carry a device state variable. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/blo

[PATCH 2/5] block/sed: Add helper to qualify response tokens

2017-02-17 Thread Jon Derrick
Add helper which verifies the response token is valid and matches the expected value. Merges token_type and response_get_token. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 61 +++- 1 file chang

[PATCH 0/5] OPAL patches cont'd

2017-02-17 Thread Jon Derrick
The first three in the series have been reviewed already but I wanted to squash them with the next two since they haven't been pulled yet. The latter 2 are an attempt to refactor some of the awkward func data and state separation into a common struct Jon Derrick (5): block/sed: Use ssize_t

[PATCH 1/5] block/sed: Use ssize_t on atom parsers to return errors

2017-02-17 Thread Jon Derrick
The short atom parser can return an errno from decoding but does not currently return the error as a signed value. Convert all of the parsers to ssize_t. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 28 ++-- 1 file changed, 14 inse

[PATCH 4/5] block/sed: embedded function data into the function sequence

2017-02-17 Thread Jon Derrick
By embedding the function data with the function sequence, this eliminates a lot of the code that needs to set it in other places. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 350 +-- 1 file change

Re: [PATCH] opal: Use empty structure when not defined

2017-02-16 Thread Jon Derrick
It looks good to me at first glance but I can't apply it. What tree are you on? On 02/16/2017 12:58 AM, Christoph Hellwig wrote: > I'd rather prefer to make the structure separately allocated as > discussed before. Scott, can you test the patch below? I'm not near > my devices I could test on.

Re: [PATCHv3 4/4] MAINTAINERS: Remove powerpc's opal match

2017-02-16 Thread Jon Derrick
Thanks everyone. Sorry about the mess :) On 02/15/2017 10:23 PM, Michael Ellerman wrote: > Jon Derrick <jonathan.derr...@intel.com> writes: > >> PPC's 'opal' match pattern also matches block/sed-opal.c, where it looks >> like the 'arch/powerpc' file pattern should be

[PATCHv4 2/4] block/sed: Add helper to qualify response tokens

2017-02-15 Thread Jon Derrick
Add helper which verifies the response token is valid and matches the expected value. Merges token_type and response_get_token. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> Reviewed-by: Scott Bauer <scott.ba...@intel.com> --- block/sed

[PATCHv4 4/4] MAINTAINERS: Remove powerpc's opal match

2017-02-15 Thread Jon Derrick
PPC's 'opal' match pattern also matches block/sed-opal.c, where it looks like the 'arch/powerpc' file pattern should be enough to match powerpc opal code by itself. Remove the opal regex pattern from powerpc. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- MAINTAINERS | 1 -

[PATCHv4 0/4] OPAL patches

2017-02-15 Thread Jon Derrick
parser check and changed it to only check the subpacket length v1->v2: left tok->len as a size_t got everyone important on the same email thread Jon Derrick (4): block/sed: Use ssize_t on atom parsers to return errors block/sed: Add helper to qualify response tokens block/sed: Check rec

[PATCHv3 1/4] block/sed: Use ssize_t on atom parsers to return errors

2017-02-15 Thread Jon Derrick
The short atom parser can return an errno from decoding but does not currently return the error as a signed value. Convert all of the parsers to ssize_t. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 28 ++-- 1 file changed, 14 inse

[PATCHv3 2/4] block/sed: Add helper to qualify response tokens

2017-02-15 Thread Jon Derrick
Add helper which verifies the response token is valid and matches the expected value. Merges token_type and response_get_token. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 61 +++- 1 file chang

[PATCHv2 1/4] block/sed: Use ssize_t on atom parsers to return errors

2017-02-15 Thread Jon Derrick
The short atom parser can return an errno from decoding but does not currently return the error as a signed value. Convert all of the parsers to ssize_t. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 28 ++-- 1 file changed, 14 inse

[PATCHv2 3/4] block/sed: Check received header lengths

2017-02-15 Thread Jon Derrick
Add a buffer size check against discovery and response header lengths before we loop over their buffers. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 35 +-- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a

[PATCHv2 4/4] MAINTAINERS: Remove powerpc's opal match

2017-02-15 Thread Jon Derrick
PPC's 'opal' match pattern also matches block/sed-opal.c, where it looks like the 'arch/powerpc' file pattern should be enough to match powerpc opal code by itself. Remove the opal regex pattern from powerpc. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- MAINTAINERS | 1 -

[PATCHv2 0/4] OPAL patches

2017-02-15 Thread Jon Derrick
Just a couple of fixes for sed-opal to prevent faulty firmware from allowing us to go off in the weeds, and a helper to remove some duplicate code. v1->v2: left tok->len as a size_t got everyone important on the same email thread Jon Derrick (4): block/sed: Use ssize_t on atom p

[PATCH 2/4] block/sed: Add helper to qualify response tokens

2017-02-15 Thread Jon Derrick
Add helper which verifies the response token is valid and matches the expected value. Merges token_type and response_get_token. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 61 +++- 1 file chang

[PATCH 1/4] block/sed: Use ssize_t on atom parsers to return errors

2017-02-15 Thread Jon Derrick
The short atom parser can return an errno from decoding but does not currently return the error as a signed value. Convert all of the parsers to ssize_t. Signed-off-by: Jon Derrick <jonathan.derr...@intel.com> --- block/sed-opal.c | 28 ++-- include/lin

Re: [PATCH 2/2] nvme: improve cmb sysfs reporting

2016-12-19 Thread Jon Derrick
Minor nit below On Fri, Dec 16, 2016 at 11:54:51AM -0700, Stephen Bates wrote: > Add more information to the NVMe CMB sysfs entry. This includes > information about the CMB size, location and capabilities. > > Signed-off-by: Stephen Bates > --- > drivers/nvme/host/pci.c |