[PATCH v2 13/16] switchtec_ntb: implement doorbell registers

2017-07-18 Thread Logan Gunthorpe
to avoid concurrent read-modify-write accesses. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> --- drivers/ntb/hw/mscc/switchtec_ntb.c | 89 +++

[PATCH v2 10/16] switchtec_ntb: initialize hardware for doorbells and messages

2017-07-18 Thread Logan Gunthorpe
for each partition. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> --- drivers/ntb/hw/mscc/switchtec_ntb.c | 144 1 file chang

[PATCH v2 01/16] switchtec: move structure definitions into a common header

2017-07-18 Thread Logan Gunthorpe
Create the switchtec.h header in include/linux with hardware defines and the switchtec_dev structure. Both moved directly from switchtec.c. This is a prep patch for creating an NTB driver for Switchtec. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bate

[PATCH v2 05/16] ntb: ensure ntb_mw_get_align() is only called when the link is up

2017-07-18 Thread Logan Gunthorpe
goes up. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> --- drivers/ntb/ntb_transport.c | 20 ++-- drivers/ntb/test/ntb_perf.c | 18 +- drivers/ntb/test/ntb_tool.c | 6 +++--- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/drive

[PATCH v2 00/16] Switchtec NTB Support

2017-07-18 Thread Logan Gunthorpe
is based off of ntb-next and can be found in this git repo: https://github.com/sbates130272/linux-p2pmem.git switchtec_ntb_v2 Logan Gunthorpe (16): switchtec: move structure definitions into a common header switchtec: export class symbol for use in upper layer driver switchtec: add NTB

[PATCH v2 04/16] switchtec: add link event notifier callback

2017-07-18 Thread Logan Gunthorpe
from last time we checked. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> Acked-by: Bjorn Helgaas <bhelg...@google.com> --- drivers/pci

[PATCH v2 03/16] switchtec: add NTB hardware register definitions

2017-07-18 Thread Logan Gunthorpe
There are two additional regions: ctrl and dbmsg. The first is for generic NTB control and memory windows. The second is for doorbells and message registers. This patch also adds a number of related constants for using these registers. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Re

[PATCH v2 09/16] switchtec_ntb: initialize hardware for memory windows

2017-07-18 Thread Logan Gunthorpe
windows. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> --- drivers/ntb/hw/mscc/switchtec_ntb.c | 355 1 file changed, 355 inserti

[PATCH v2 06/16] ntb: add check and comment for link up to mw_count() and mw_get_align()

2017-07-18 Thread Logan Gunthorpe
on hardware that this doesn't matter for. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> --- include/linux/ntb.h | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/linux/ntb.h b/include/linux/ntb.h index 609e232c00da..47f2966cfd7f 100644 --- a/include

[PATCH v2 16/16] switchtec_ntb: update switchtec documentation with notes for NTB

2017-07-18 Thread Logan Gunthorpe
The switchtec_ntb driver has a couple requirements on the switchec's hardware configuration so we add these notes to the documentation. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem..

[PATCH v2 08/16] switchtec_ntb: introduce initial NTB driver

2017-07-18 Thread Logan Gunthorpe
Seeing the Switchtec NTB hardware shares the same endpoint as the management endpoint we utilize the class_interface API to register an NTB driver for every Switchtec device in the system that has the NTB class code. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen

[PATCH v2 15/16] switchtec_ntb: add memory window support

2017-07-18 Thread Logan Gunthorpe
parameter is given to limit the size of the advertised memory windows. Higher layers tend to allocate the maximum BAR size and this has a tendency to fail when they try to allocate 4GB of contiguous memory. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bate

[PATCH v2 14/16] switchtec_ntb: implement scratchpad registers

2017-07-18 Thread Logan Gunthorpe
Seeing there is no dedicated hardware for this, we simply add these as entries in the shared memory window. Thus, we could support any number of them but 128 seems like enough, for now. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com&

[PATCH v2 02/16] switchtec: export class symbol for use in upper layer driver

2017-07-18 Thread Logan Gunthorpe
We export the class pointer symbol and add an extern define in the Switchtec header file. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> Acked-by: Bjorn Helgaas &l

[PATCH v2 07/16] ntb: ntb_test: ensure the link is up before trying to configure the mws

2017-07-18 Thread Logan Gunthorpe
continuning. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> --- tools/testing/selftests/ntb/ntb_test.sh | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing/selftests/ntb/ntb_test.sh index 1c12b5855e4f..5fc7ad359e21 100755 --- a

Re: [PATCH v4 1/5] powerpc: io.h: move iomap.h include so that it can use readq/writeq defs

2017-07-19 Thread Logan Gunthorpe
On 18/07/17 11:57 PM, Michael Ellerman wrote: > Seems fair enough, have you tested it at all? It's only been compile tested and the kbuild robot has beat up on it a bit. Thanks, Logan

Re: [PATCH v2 00/16] Switchtec NTB Support

2017-07-18 Thread Logan Gunthorpe
On 18/07/17 11:51 AM, Allen Hubbe wrote: > Acked-by: Allen Hubbe Thanks. > Should the order of 6 and 7 be swapped? Hmm, yes. I'll make the change for a v3 after more feedback comes. > 6 - I think just the comment is best. Rather than prohibit the use of >

Re: [PATCH v4 1/5] powerpc: io.h: move iomap.h include so that it can use readq/writeq defs

2017-07-20 Thread Logan Gunthorpe
On 20/07/17 06:36 AM, Horia Geantă wrote: > include/asm-generic/iomap.h is included before > include/linux/io-64-nonatomic-lo-hi.h: > > include/linux/io.h -> arch/powerpc/include/asm/io.h -> > include/asm-generic/iomap.h > > Thus, the "extern" version of ioread64_lo_hi and friends will be used

[PATCH v3 09/16] switchtec_ntb: initialize hardware for memory windows

2017-07-25 Thread Logan Gunthorpe
windows. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> --- drivers/ntb/hw/mscc/switchtec_ntb.c | 355 1 file changed, 355 inserti

[PATCH v3 01/16] switchtec: move structure definitions into a common header

2017-07-25 Thread Logan Gunthorpe
Create the switchtec.h header in include/linux with hardware defines and the switchtec_dev structure. Both moved directly from switchtec.c. This is a prep patch for creating an NTB driver for Switchtec. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bate

[PATCH v3 11/16] switchtec_ntb: add skeleton NTB driver

2017-07-25 Thread Logan Gunthorpe
Add a skeleton NTB driver which will be filled out in subsequent patches. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> --- drivers/ntb/hw/mscc/swi

[PATCH v3 04/16] switchtec: add link event notifier callback

2017-07-25 Thread Logan Gunthorpe
from last time we checked. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> Acked-by: Bjorn Helgaas <bhelg...@google.com> --- drivers/pci

[PATCH v3 13/16] switchtec_ntb: implement doorbell registers

2017-07-25 Thread Logan Gunthorpe
to avoid concurrent read-modify-write accesses. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> --- drivers/ntb/hw/mscc/switchtec_ntb.c | 89 +++

[PATCH v3 10/16] switchtec_ntb: initialize hardware for doorbells and messages

2017-07-25 Thread Logan Gunthorpe
for each partition. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> --- drivers/ntb/hw/mscc/switchtec_ntb.c | 142 1 file chang

[PATCH v3 06/16] ntb: ensure ntb_mw_get_align() is only called when the link is up

2017-07-25 Thread Logan Gunthorpe
goes up. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> --- drivers/ntb/ntb_transport.c | 20 ++-- drivers/ntb/test/ntb_perf.c | 18 +- drivers/ntb/test/ntb_tool.c | 6 +++--- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/drive

[PATCH v3 00/16] Switchtec NTB Support

2017-07-25 Thread Logan Gunthorpe
*** BLURB HERE *** Logan Gunthorpe (16): switchtec: move structure definitions into a common header switchtec: export class symbol for use in upper layer driver switchtec: add NTB hardware register definitions switchtec: add link event notifier callback ntb: ntb_test: ensure the link is up

[PATCH v3 02/16] switchtec: export class symbol for use in upper layer driver

2017-07-25 Thread Logan Gunthorpe
We export the class pointer symbol and add an extern define in the Switchtec header file. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> Acked-by: Bjorn Helgaas &l

[PATCH v3 14/16] switchtec_ntb: implement scratchpad registers

2017-07-25 Thread Logan Gunthorpe
Seeing there is no dedicated hardware for this, we simply add these as entries in the shared memory window. Thus, we could support any number of them but 128 seems like enough, for now. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com&

[PATCH v3 12/16] switchtec_ntb: add link management

2017-07-25 Thread Logan Gunthorpe
their status. The current status is maintained in a flag so ntb_is_link_up can return quickly. We utilize Switchtec's link status notifier to also check link changes when the switch notices a port changes state. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bate

[PATCH v3 16/16] switchtec_ntb: update switchtec documentation with notes for NTB

2017-07-25 Thread Logan Gunthorpe
The switchtec_ntb driver has a couple requirements on the switchec's hardware configuration so we add these notes to the documentation. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem..

[PATCH v3 03/16] switchtec: add NTB hardware register definitions

2017-07-25 Thread Logan Gunthorpe
There are two additional regions: ctrl and dbmsg. The first is for generic NTB control and memory windows. The second is for doorbells and message registers. This patch also adds a number of related constants for using these registers. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Re

[PATCH v3 05/16] ntb: ntb_test: ensure the link is up before trying to configure the mws

2017-07-25 Thread Logan Gunthorpe
continuning. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> --- tools/testing/selftests/ntb/ntb_test.sh | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing/selftests/ntb/ntb_test.sh index 1c12b5855e4f..5fc7ad359e21 100755 --- a

[PATCH v3 15/16] switchtec_ntb: add memory window support

2017-07-25 Thread Logan Gunthorpe
parameter is given to limit the size of the advertised memory windows. Higher layers tend to allocate the maximum BAR size and this has a tendency to fail when they try to allocate 4GB of contiguous memory. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bate

[PATCH v3 07/16] ntb: add check and comment for link up to mw_count() and mw_get_align()

2017-07-25 Thread Logan Gunthorpe
on hardware that this doesn't matter for. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> --- include/linux/ntb.h | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/linux/ntb.h b/include/linux/ntb.h index 609e232c00da..47f2966cfd7f 100644 --- a/include

[PATCH v3 08/16] switchtec_ntb: introduce initial NTB driver

2017-07-25 Thread Logan Gunthorpe
Seeing the Switchtec NTB hardware shares the same endpoint as the management endpoint we utilize the class_interface API to register an NTB driver for every Switchtec device in the system that has the NTB class code. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen

[PATCH v5 0/6] make io{read|write}64 globally usable

2017-07-26 Thread Logan Gunthorpe
some mistakes with a couple of the defines in io-64-nonatomic* headers - Fixed a typo noticed by Horia. (earlier versions were drastically different) Horia Geantă (1): crypto: caam: cleanup CONFIG_64BIT ifdefs when using io{read|write}64 Logan Gunthorpe (5): powerpc: io.h: move iomap.h

[PATCH v5 1/6] powerpc: io.h: move iomap.h include so that it can use readq/writeq defs

2017-07-26 Thread Logan Gunthorpe
Subsequent patches in this series makes use of the readq and writeq defines in iomap.h. However, as is, they get missed on the powerpc platform seeing the include comes before the define. This patch moves the include down to fix this. Signed-off-by: Logan Gunthorpe <log...@deltatee.com>

[PATCH v5 2/6] powerpc: iomap.c: introduce io{read|write}64_{lo_hi|hi_lo}

2017-07-26 Thread Logan Gunthorpe
These functions will be introduced into the generic iomap.c so they can deal with PIO accesses in hi-lo/lo-hi variants. Thus, the powerpc version of iomap.c will need to provide the same functions even though, in this arch, they are identical to the regular io{read|write}64 functions. ---

[PATCH v5 5/6] ntb: ntb_hw_intel: use io-64-nonatomic instead of in-driver hacks

2017-07-26 Thread Logan Gunthorpe
Now that ioread64 and iowrite64 are available in io-64-nonatomic, we can remove the hack at the top of ntb_hw_intel.c and replace it with an include. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Cc: Jon Mason <jdma...@kudzu.us> Cc: Allen Hubbe <allen.hu...@emc.com> Ac

[PATCH v5 6/6] crypto: caam: cleanup CONFIG_64BIT ifdefs when using io{read|write}64

2017-07-26 Thread Logan Gunthorpe
device endianness, the lower address should be read from / written to first, followed by the upper address. Indeed the I/O accessors in CAAM driver currently don't follow the spec, however this is a good opportunity to fix the code. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> Signed-off-by: Log

[PATCH v5 3/6] iomap: introduce io{read|write}64_{lo_hi|hi_lo}

2017-07-26 Thread Logan Gunthorpe
and writeq are defined. If they are not, then the wrappers that always use non-atomic operations from include/linux/io-64-nonatomic*.h will be used. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org> Cc: Paul Mackerras <pau..

[PATCH v5 4/6] io-64-nonatomic: add io{read|write}64[be]{_lo_hi|_hi_lo} macros

2017-07-26 Thread Logan Gunthorpe
are encouraged to use ioreadXX, et al instead of readX[1], et al -- and mixing ioreadXX with readq is pretty ugly. [1] ldd3: section 9.4.2 Signed-off-by: Logan Gunthorpe <log...@deltatee.com> cc: Christoph Hellwig <h...@lst.de> cc: Arnd Bergmann <a...@arndb.de> cc: Alan Cox <gno..

[PATCH 10/16] switchtec_ntb: initialize hardware for doorbells and messages

2017-06-28 Thread Logan Gunthorpe
provides 28 doorbells for each partition. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> --- drivers/ntb/hw/mscc/switchtec_ntb.c | 144 ++

[PATCH 11/16] switchtec_ntb: add skeleton ntb driver

2017-06-28 Thread Logan Gunthorpe
This patch simply adds a skeleton NTB driver which will be filled out in subsequent patches. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> --- drivers/ntb/hw/ms

[PATCH 00/16]

2017-06-28 Thread Logan Gunthorpe
and fully passes the ntb_test script. This patchset is based off of ntb-next and can be found in this git repo: https://github.com/sbates130272/linux-p2pmem.git switchtec_ntb_next Logan Gunthorpe (16): switchtec: move structure definitions into a common header switchtec: export class symbol for use

[PATCH 04/16] switchtec: add link event notifier callback

2017-06-28 Thread Logan Gunthorpe
from last time we checked. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> --- drivers/pci/switch/switchtec.c | 51 ++ include

[PATCH 02/16] switchtec: export class symbol for use in upper layer driver

2017-06-28 Thread Logan Gunthorpe
We export the class pointer symbol and add an extern define in the switchtec header file. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> --- drivers/pci/swit

[PATCH 01/16] switchtec: move structure definitions into a common header

2017-06-28 Thread Logan Gunthorpe
Create the switchtec.h header in include/linux with hardware defines and the switchtec_dev structure moved directly from switchtec.c. This is a prep patch for created an NTB driver for switchtec. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@rai

[PATCH 05/16] ntb: ensure ntb_mw_get_align is only called when the link is up

2017-06-28 Thread Logan Gunthorpe
goes up. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> --- drivers/ntb/ntb_transport.c | 20 ++-- drivers/ntb/test/ntb_perf.c | 18 +- drivers/ntb/test/ntb_tool.c | 6 +++--- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/drive

[PATCH 12/16] switchtec_ntb: add link management

2017-06-28 Thread Logan Gunthorpe
their status. The current status is maintained in a flag so ntb_is_link_up can return quickly. We utilize switchtec's link status notifier to also check link changes when the switch notices a port changes state. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bate

[PATCH 07/16] ntb: ntb_test: ensure the link is up before trying to configure the mws

2017-06-28 Thread Logan Gunthorpe
continuning. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> --- tools/testing/selftests/ntb/ntb_test.sh | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing/selftests/ntb/ntb_test.sh index 1c12b5855e4f..5fc7ad359e21 100755 --- a

[PATCH 15/16] switchtec_ntb: add memory window support

2017-06-28 Thread Logan Gunthorpe
parameter is given to limit the size of the advertised memory windows. Higher layers tend to allocate the maximum BAR size and this has a tendancy of failing when they try to allocate 4GB of continuous memory. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bate

[PATCH 09/16] switchtec_ntb: initialize hardware for memory windows

2017-06-28 Thread Logan Gunthorpe
of the local memory windows. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> --- drivers/ntb/hw/mscc/switchtec_ntb.c | 338 1 file chang

[PATCH 03/16] switchtec: add ntb hardware register definitions

2017-06-28 Thread Logan Gunthorpe
There are two additional regions: ctrl and dbmsg. The first is for generic ntb control and memory windows. The second for doorbells and message registers. This patch also adds a number of related constants for using these registers. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Re

[PATCH 08/16] switchtec_ntb: introduce initial ntb driver

2017-06-28 Thread Logan Gunthorpe
Seeing the switchtec NTB hardware shares the same endpoint as the management endpoint we utilize the class_interface api to register an NTB driver for every switchtec device in the system that has the NTB class code. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen

[PATCH 06/16] ntb: add check and comment for link up to mw_count and mw_get_align

2017-06-28 Thread Logan Gunthorpe
This patch adds a comment and a check to the ntb_mw_get_align and ntb_mw_count functions so that they always fail if the function is called before the link is up. This is to prevent accidental mis-use in clients that are testing on hardware that this doesn't matter for. Signed-off-by: Logan

[PATCH 13/16] switchtec_ntb: implement doorbell registers

2017-06-28 Thread Logan Gunthorpe
to avoid concurrent read-modify-write accesses. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem...@microsemi.com> --- drivers/ntb/hw/mscc/switchtec_ntb.c | 89 +++

[PATCH 16/16] switchtec_ntb: update switchtec documentation with notes for ntb

2017-06-28 Thread Logan Gunthorpe
The switchtec_ntb driver has a couple requirements on the switchec's hardware configuration so we add these notes to the documentation. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwem..

[PATCH 14/16] switchtec_ntb: implement scratchpad registers

2017-06-28 Thread Logan Gunthorpe
Seeing there is no dedicated hardware for this, we simply add these as entries in the shared memory window. Thus, we could support any number of them but 128 seems like enough, for now. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Reviewed-by: Stephen Bates <sba...@raithlin.com&

Re: [PATCH 14/16] switchtec_ntb: implement scratchpad registers

2017-06-29 Thread Logan Gunthorpe
On 6/29/2017 12:11 PM, Allen Hubbe wrote: This could get in the way of letting the driver support more than two ports later on. Is there already a plan to change this to support more than two ports? Well, as I mentioned this patchset is only to support 2 ports. Future work will expand this

Re: [PATCH 06/16] ntb: add check and comment for link up to mw_count and mw_get_align

2017-06-29 Thread Logan Gunthorpe
On 6/29/2017 12:11 PM, Allen Hubbe wrote: Nak. This breaks a work around for stability issues on some hardware. I am ok with changing the comment to say, this is only supported when called after link up. I would still like to allow these to be called at any time. Specific hardware drivers

Re: [PATCH 12/16] switchtec_ntb: add link management

2017-06-29 Thread Logan Gunthorpe
On 6/29/2017 12:11 PM, Allen Hubbe wrote: Should we only set self_partition? I think each peer should be able to set preferred speed, and negotiate down. As written here, the last peer to set the speed overrides the setting on the peer, and even that is not atomic if they race. This

Re: [PATCH 06/16] ntb: add check and comment for link up to mw_count and mw_get_align

2017-06-29 Thread Logan Gunthorpe
On 6/29/2017 2:13 PM, Allen Hubbe wrote: Unfortunately, it is to work around hardware errata. That is not so trivial to fix. Can you describe more what the work around is doing? Can you share the code? It seems odd that a workaround is based on the alignment restrictions of the mws.

Re: [PATCH 06/16] ntb: add check and comment for link up to mw_count and mw_get_align

2017-06-29 Thread Logan Gunthorpe
On 29/06/17 03:35 PM, Allen Hubbe wrote: >> It is not a workaround for alignment restrictions of the mws. It is a >> restriction to avoid the use of >> doorbells and scratchpads. Memory windows are used exclusively. >> >> Read msi-x local and send that to the peer: > >

Re: [PATCH v3 4/4] crypto: caam: cleanup CONFIG_64BIT ifdefs when using io{read|write}64

2017-06-30 Thread Logan Gunthorpe
On 30/06/17 12:18 AM, Horia Geantă wrote: > On 6/29/2017 7:10 PM, Logan Gunthorpe wrote: >> From: Horia Geantă <horia.gea...@nxp.com> >> >> We can now make use of the io-64-nonatomic-hi-lo header to always > Typo: we are using io-64-nonatomic-lo-hi, not h

[PATCH v3 1/4] iomap: introduce io{read|write}64_{lo_hi|hi_lo}

2017-06-29 Thread Logan Gunthorpe
and writeq are defined. If they are not, then the wrappers that always use non-atomic operations from include/linux/io-64-nonatomic*.h will be used. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org> Cc: Paul Mackerras <pau..

[PATCH v3 2/4] io-64-nonatomic: add io{read|write}64[be]{_lo_hi|_hi_lo} macros

2017-06-29 Thread Logan Gunthorpe
are encouraged to use ioreadXX, et al instead of readX[1], et al -- and mixing ioreadXX with readq is pretty ugly. [1] ldd3: section 9.4.2 Signed-off-by: Logan Gunthorpe <log...@deltatee.com> cc: Christoph Hellwig <h...@lst.de> cc: Arnd Bergmann <a...@arndb.de> cc: Alan Cox <gno..

[PATCH v3 0/4] make io{read|write}64 more globally usable

2017-06-29 Thread Logan Gunthorpe
operations (when appropriate). Thanks, Logan Horia Geantă (1): crypto: caam: cleanup CONFIG_64BIT ifdefs when using io{read|write}64 Logan Gunthorpe (3): iomap: introduce io{read|write}64_{lo_hi|hi_lo} io-64-nonatomic: add io{read|write}64[be]{_lo_hi|_hi_lo} macros ntb: ntb_hw_intel: use io-64

[PATCH v3 3/4] ntb: ntb_hw_intel: use io-64-nonatomic instead of in-driver hacks

2017-06-29 Thread Logan Gunthorpe
Now that ioread64 and iowrite64 are available in io-64-nonatomic, we can remove the hack at the top of ntb_hw_intel.c and replace it with an include. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Cc: Jon Mason <jdma...@kudzu.us> Cc: Allen Hubbe <allen.hu...@emc.com> Ac

Re: [PATCH 00/16]

2017-06-29 Thread Logan Gunthorpe
On 29/06/17 09:15 AM, Greg Kroah-Hartman wrote: > On Wed, Jun 28, 2017 at 09:26:32PM -0600, Logan Gunthorpe wrote: >> Changes since the rfc: > > I think your subject: line is missing something :) Yeah, sorry. A small oversight. Logan

[PATCH v3 4/4] crypto: caam: cleanup CONFIG_64BIT ifdefs when using io{read|write}64

2017-06-29 Thread Logan Gunthorpe
device endianness, the lower address should be read from / written to first, followed by the upper address. Indeed the I/O accessors in CAAM driver currently don't follow the spec, however this is a good opportunity to fix the code. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> Signed-off-by: Log

Re: [PATCH v2 3/3] crypto: caam: cleanup CONFIG_64BIT ifdefs when using io{read|write}64

2017-06-28 Thread Logan Gunthorpe
On 28/06/17 04:20 AM, Arnd Bergmann wrote: > On Wed, Jun 28, 2017 at 1:02 AM, Logan Gunthorpe <log...@deltatee.com> wrote: >> #include >> #include >> -#include >> +#include > > Here you include the hi-lo variant unconditionally. > >>

Re: [PATCH v2 1/3] io-64-nonatomic: add io{read|write}64[be] macros

2017-06-28 Thread Logan Gunthorpe
On 28/06/17 04:11 AM, Arnd Bergmann wrote: > This is wrong since ioread* is not the same read* on x86 and other > architectures that have native PCI PIO accessors, or that require > additional barriers for those. > > You have to copy hi_lo_readq() here, and call ioread32 twice instead > of

[PATCH v2 1/3] io-64-nonatomic: add io{read|write}64[be] macros

2017-06-27 Thread Logan Gunthorpe
This patch adds io{read|write}64[be] macros to point to the readq/writeq in use. This is because new drivers are encouraged to use ioreadXX, et al instead of readX[1], et al -- and mixing ioreadXX with readq is pretty ugly. [1] ldd3: section 9.4.2 Signed-off-by: Logan Gunthorpe <

[PATCH v2 0/3] make io{read|write}64 more globally usable

2017-06-27 Thread Logan Gunthorpe
ifdefs when using io{read|write}64 Logan Gunthorpe (2): io-64-nonatomic: add io{read|write}64[be] macros ntb: ntb_hw_intel: use io-64-nonatomic instead of in-driver hacks drivers/crypto/caam/regs.h| 35 +-- drivers/ntb/hw/intel/ntb_hw_intel.c | 31

[PATCH v2 3/3] crypto: caam: cleanup CONFIG_64BIT ifdefs when using io{read|write}64

2017-06-27 Thread Logan Gunthorpe
From: Horia Geantă <horia.gea...@nxp.com> We can now make use of the io-64-nonatomic-hi-lo header to always provide 64 bit IO operations. So this patch cleans up the extra CONFIG_64BIT ifdefs. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> Signed-off-by: Logan Gunthorpe <log.

[PATCH v2 2/3] ntb: ntb_hw_intel: use io-64-nonatomic instead of in-driver hacks

2017-06-27 Thread Logan Gunthorpe
Now that ioread64 and iowrite64 are available in io-64-nonatomic, we can remove the hack at the top of ntb_hw_intel.c and replace it with an include. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Cc: Jon Mason <jdma...@kudzu.us> Cc: Allen Hubbe <allen.hu...@emc.com> Ac

Re: [PATCH 00/16]

2017-07-05 Thread Logan Gunthorpe
On 05/07/17 01:47 PM, Bjorn Helgaas wrote: > Acked-by: Bjorn Helgaas Thanks Bjorn. I'll make all the changes you've noted in a v2 which I'll send after the merge window. Logan

Re: [PATCH v2 01/21] scatterlist: Introduce sg_map helper functions

2017-04-26 Thread Logan Gunthorpe
On 26/04/17 01:44 AM, Christoph Hellwig wrote: > I think we'll at least need a draft of those to make sense of these > patches. Otherwise they just look very clumsy. Ok, I'll work up a draft proposal and send it in a couple days. But without a lot of cleanup such as this series it's not going

Re: [PATCH v2 01/21] scatterlist: Introduce sg_map helper functions

2017-04-27 Thread Logan Gunthorpe
On 27/04/17 12:53 AM, Christoph Hellwig wrote: > I think you'll need to follow the existing kmap semantics and never > fail the iomem version either. Otherwise you'll have a special case > that's almost never used that has a different error path. > > Again, wrong way. Suddenly making things

Re: [PATCH v2 07/21] crypto: shash, caam: Make use of the new sg_map helper function

2017-04-27 Thread Logan Gunthorpe
On 26/04/17 09:56 PM, Herbert Xu wrote: > On Tue, Apr 25, 2017 at 12:20:54PM -0600, Logan Gunthorpe wrote: >> Very straightforward conversion to the new function in the caam driver >> and shash library. >> >> Signed-off-by: Logan Gunthorpe <log...@deltate

Re: [PATCH v2 01/21] scatterlist: Introduce sg_map helper functions

2017-04-27 Thread Logan Gunthorpe
On 27/04/17 09:27 AM, Jason Gunthorpe wrote: > On Thu, Apr 27, 2017 at 08:53:38AM +0200, Christoph Hellwig wrote: > How about first switching as many call sites as possible to use > sg_copy_X_buffer instead of kmap? Yeah, I could look at doing that first. One problem is we might get more Naks

Re: [PATCH] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-27 Thread Logan Gunthorpe
On 26/04/17 06:55 PM, Dan Williams wrote: > @@ -277,7 +269,10 @@ struct dev_pagemap *find_dev_pagemap(resource_size_t > phys) > * > * Notes: > * 1/ @ref must be 'live' on entry and 'dead' before devm_memunmap_pages() > time > - *(or devm release event). > + *(or devm release

Re: [PATCH v2 01/21] scatterlist: Introduce sg_map helper functions

2017-04-26 Thread Logan Gunthorpe
On 26/04/17 02:59 AM, wrote: > Good to know that somebody is working on this. Those problems troubled > us as well. Thanks Christian. It's a daunting problem and a there's a lot of work to do before we will ever be where we need to be so any help, even an ack, is greatly appreciated. Logan

Re: [PATCH] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-27 Thread Logan Gunthorpe
On 27/04/17 10:38 AM, Dan Williams wrote: > ...is inside a for_each_device_pfn() loop. > Ah, oops. Then that makes perfect sense. Thanks. You may have my review tag if you'd like: Reviewed-by: Logan Gunthorpe <log...@deltatee.com> Logan

Re: [PATCH] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-27 Thread Logan Gunthorpe
On 27/04/17 10:14 AM, Dan Williams wrote: > You're overlooking that the page reference count 1 after > arch_add_memory(). So at the end of time we're just dropping the > arch_add_memory() reference to release the page and related > dev_pagemap. Thanks, that does actually make a lot more sense

[PATCH v2 05/21] drm/i915: Make use of the new sg_map helper function

2017-04-25 Thread Logan Gunthorpe
This is a single straightforward conversion from kmap to sg_map. We also create the i915_gem_object_unmap function to common up the unmap code. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Acked-by: Daniel Vetter <daniel.vet...@ffwll.ch> --- drivers/gpu/drm/i915/i91

[PATCH v2 02/21] libiscsi: Add an internal error code

2017-04-25 Thread Logan Gunthorpe
This is a prep patch to add a new error code to libiscsi. We want to rework some kmap calls to be able to fail. When we do, we'd like to use this error code. This patch simply introduces ISCSI_TCP_INTERNAL_ERR and prints "Internal Error." when it gets hit. Signed-off-by: Logan Gunt

[PATCH v2 01/21] scatterlist: Introduce sg_map helper functions

2017-04-25 Thread Logan Gunthorpe
. Also, in terms of cleanup, a few of the existing kmap(sg_page) users play things a bit loose in terms of whether they apply sg->offset so using these helper functions should help avoid such issues. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> --- include/linux/scatterli

Re: [RFC 1/8] Introduce Peer-to-Peer memory (p2pmem) device

2017-04-25 Thread Logan Gunthorpe
On 25/04/17 05:58 AM, Marta Rybczynska wrote: > I would add one issue that doesn't seem to be addressed: in my experience > P2P doesn't work when IOMMU activated. It works best with deactivation at > the BIOS level, even the kernel options are not enough in some cases. Well this would likely be

Re: [RFC 0/8] Copy Offload with Peer-to-Peer PCI Memory

2017-04-25 Thread Logan Gunthorpe
On 25/04/17 12:30 AM, Knut Omang wrote: > Yes, that's why I used 'significant'. One good thing is that given resources > it can easily be done in parallel with other development, and will give > additional > insight of some form. Yup, well if someone wants to start working on an emulated RDMA

[PATCH v2 08/21] dm-crypt: Make use of the new sg_map helper in 4 call sites

2017-04-25 Thread Logan Gunthorpe
Very straightforward conversion to the new function in all four spots. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Cc: Alasdair Kergon <a...@redhat.com> Cc: Mike Snitzer <snit...@redhat.com> --- drivers/md/dm-crypt.c | 39 ++-

[PATCH v2 19/21] mmc: sdricoh_cs: Make use of the new sg_map helper function

2017-04-25 Thread Logan Gunthorpe
This is a straightforward conversion to the new function. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Cc: Sascha Sommer <saschasom...@freenet.de> Cc: Ulf Hansson <ulf.hans...@linaro.org> --- drivers/mmc/host/sdricoh_cs.c | 14 +- 1 file changed, 9 insertio

[PATCH v2 13/21] scsi: arcmsr, ips, megaraid: Make use of the new sg_map helper function

2017-04-25 Thread Logan Gunthorpe
Very straightforward conversion of three scsi drivers Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Cc: Adaptec OEM Raid Solutions <aacr...@adaptec.com> Cc: Kashyap Desai <kashyap.de...@broadcom.com> Cc: Sumit Saxena <sumit.sax...@broadcom.com> Cc: Shivasharan S

[PATCH v2 10/21] RDS: Make use of the new sg_map helper function

2017-04-25 Thread Logan Gunthorpe
Straightforward conversion except there's no error path, so we make use of SG_MAP_MUST_NOT_FAIL which may BUG_ON in certain cases in the future. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Cc: Santosh Shilimkar <santosh.shilim...@oracle.com> Cc: "David S. Miller"

[PATCH v2 12/21] scsi: hisi_sas, mvsas, gdth: Make use of the new sg_map helper function

2017-04-25 Thread Logan Gunthorpe
Very straightforward conversion of three scsi drivers. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Cc: Achim Leubner <achim_leub...@adaptec.com> Cc: John Garry <john.ga...@huawei.com> --- drivers/scsi/gdth.c| 9 +++-- drivers/scsi/hisi_sas/his

[PATCH v2 20/21] mmc: tifm_sd: Make use of the new sg_map helper function

2017-04-25 Thread Logan Gunthorpe
of the offset but it's already added and used earlier in the code.) There's also no error path, so we use SG_MAP_MUST_NOT_FAIL which may BUG_ON in certain cases in the future. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Cc: Alex Dubov <oa...@yahoo.com> Cc: Ulf Hansson <ulf.han

[PATCH v2 15/21] xen-blkfront: Make use of the new sg_map helper function

2017-04-25 Thread Logan Gunthorpe
Straightforward conversion to the new helper, except due to the lack of error path, we have to use SG_MAP_MUST_NOT_FAIL which may BUG_ON in certain cases in the future. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Cc: Boris Ostrovsky <boris.ostrov...@oracle.com> Cc: Juerge

[PATCH v2 11/21] scsi: ipr, pmcraid, isci: Make use of the new sg_map helper

2017-04-25 Thread Logan Gunthorpe
Very straightforward conversion of three scsi drivers. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Cc: Brian King <brk...@us.ibm.com> Cc: Artur Paszkiewicz <artur.paszkiew...@intel.com> --- drivers/scsi/ipr.c | 27 ++- drivers/scsi/i

[PATCH v2 09/21] staging: unisys: visorbus: Make use of the new sg_map helper function

2017-04-25 Thread Logan Gunthorpe
Straightforward conversion to the new function. Signed-off-by: Logan Gunthorpe <log...@deltatee.com> Acked-by: David Kershner <david.kersh...@unisys.com> --- drivers/staging/unisys/visorhba/visorhba_main.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --g

<    1   2   3   4   5   6   7   8   9   10   >