RE: [PATCH v2 1/2] fsl: Add binding for RCPM

2015-09-16 Thread Yuantian Tang
> -Original Message- > From: Wood Scott-B07421 > Sent: Wednesday, September 16, 2015 10:32 AM > To: Wang Dongsheng-B40534 > Cc: devicet...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; > robh...@kernel.org; linux-arm-ker...@lists.infradead.org; Wang Huan-

[RESEND PATCH 1/1] ASoC: fsl_ssi: Fix checking of dai format for AC97 mode

2015-09-16 Thread Adam Thomson
Current code incorrectly treats dai format for AC97 as bit mask whereas it's actually an integer value. This causes DAI formats other than AC97 (e.g. DSP_B) to trigger AC97 related code, which is incorrect and breaks functionality. This patch fixes the code to correctly compare values to determine

suspicious RCU usage with kvm_pr

2015-09-16 Thread Denis Kirjanov
Hi, I see the following trace on qemu startup (ps700 blade): v4.2-11169-g64d1def [ 143.369638] === [ 143.369640] [ INFO: suspicious RCU usage. ] [ 143.369643] 4.2.0-11169-g64d1def #10 Tainted: G S [ 143.369645] --- [ 143.369647]

Re: [PATCH] powerpc/mm: Recompute hash value after a failed update

2015-09-16 Thread Michael Ellerman
On Wed, 2015-09-16 at 11:27 +0530, Aneesh Kumar K.V wrote: > Michael Ellerman writes: > > > On Wed, 2015-09-16 at 08:53 +0530, Aneesh Kumar K.V wrote: > >> "Aneesh Kumar K.V" writes: > >> > >> > If we had secondary hash flag set, we ended

[PATCH v4 1/2] powerpc32: memcpy: only use dcbz once cache is enabled

2015-09-16 Thread Christophe Leroy
memcpy() uses instruction dcbz to speed up copy by not wasting time loading cache line with data that will be overwritten. Some platform like mpc52xx do no have cache active at startup and can therefore not use memcpy(). Allthough no part of the code explicitly uses memcpy(), GCC makes calls to

[PATCH v4 2/2] powerpc32: memset: only use dcbz once cache is enabled

2015-09-16 Thread Christophe Leroy
memset() uses instruction dcbz to speed up clearing by not wasting time loading cache line with data that will be overwritten. Some platform like mpc52xx do no have cache active at startup and can therefore not use memset(). Allthough no part of the code explicitly uses memset(), GCC may make

Re: suspicious RCU usage with kvm_pr

2015-09-16 Thread Denis Kirjanov
On 9/16/15, Thomas Huth wrote: > On 16/09/15 10:51, Denis Kirjanov wrote: >> Hi, >> >> I see the following trace on qemu startup (ps700 blade): >> >> v4.2-11169-g64d1def >> >> >> [ 143.369638] === >> [ 143.369640] [ INFO: suspicious RCU usage. ] >>

[PATCH] powerpc: Wire up sys_membarrier()

2015-09-16 Thread Michael Ellerman
The selftest passes on 64-bit LE & BE, and 32-bit. Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/systbl.h | 1 + arch/powerpc/include/asm/unistd.h | 2 +- arch/powerpc/include/uapi/asm/unistd.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)

Re: suspicious RCU usage with kvm_pr

2015-09-16 Thread Thomas Huth
On 16/09/15 10:51, Denis Kirjanov wrote: > Hi, > > I see the following trace on qemu startup (ps700 blade): > > v4.2-11169-g64d1def > > > [ 143.369638] === > [ 143.369640] [ INFO: suspicious RCU usage. ] > [ 143.369643] 4.2.0-11169-g64d1def #10 Tainted: G S > [

[PATCH v4 0/2] powerpc32: memcpy/memset: only use dcbz once cache is enabled

2015-09-16 Thread Christophe Leroy
memcpy() and memset() use instruction dcbz to speed up copy by not wasting time loading cache lines with data that will be overwritten. Some platform like mpc52xx do no have cache active at startup and can therefore not use memcpy(). Allthough no part of the code explicitly uses memcpy() and

Re: [PATCH v2] powerpc: msi: mark bitmap with kmemleak_not_leak()

2015-09-16 Thread Catalin Marinas
On Tue, Sep 15, 2015 at 08:14:08PM +0300, Denis Kirjanov wrote: > diff --git a/arch/powerpc/include/asm/msi_bitmap.h > b/arch/powerpc/include/asm/msi_bitmap.h > index 97ac3f4..9a1d2fb 100644 > --- a/arch/powerpc/include/asm/msi_bitmap.h > +++ b/arch/powerpc/include/asm/msi_bitmap.h > @@ -19,6

Re: [PATCH v2] powerpc: msi: mark bitmap with kmemleak_not_leak()

2015-09-16 Thread Denis Kirjanov
On 9/16/15, Catalin Marinas wrote: > On Tue, Sep 15, 2015 at 08:14:08PM +0300, Denis Kirjanov wrote: >> diff --git a/arch/powerpc/include/asm/msi_bitmap.h >> b/arch/powerpc/include/asm/msi_bitmap.h >> index 97ac3f4..9a1d2fb 100644 >> ---

[RFC v2 0/7] atomics: powerpc: Implement relaxed/acquire/release variants of some atomics

2015-09-16 Thread Boqun Feng
Link for v1: https://lkml.org/lkml/2015/8/27/798 Changes since v1: * avoid to introduce macro arch_atomic_op_*() * also fix the problem that cmpxchg, xchg and their atomic_ versions are not full barriers in PPC implementation. * rebase on v4.3-rc1

[RFC v2 3/7] powerpc: atomic: Implement atomic{, 64}_{add, sub}_return_* variants

2015-09-16 Thread Boqun Feng
On powerpc, we don't need a general memory barrier to achieve acquire and release semantics, so __atomic_op_{acquire,release} can be implemented using "lwsync" and "isync". For release semantics, since we only need to ensure all memory accesses that issue before must take effects before the

[RFC v2 5/7] powerpc: atomic: Implement cmpxchg{, 64}_* and atomic{, 64}_cmpxchg_* variants

2015-09-16 Thread Boqun Feng
Unlike other atomic operation variants, cmpxchg{,64}_acquire and atomic{,64}_cmpxchg_acquire don't have acquire semantics if the cmp part fails, so we need to implement these using assembly. Note cmpxchg{,64}_relaxed and atomic{,64}_cmpxchg_relaxed are not compiler barriers. Signed-off-by: Boqun

[RFC v2 1/7] atomics: Add test for atomic operations with _relaxed variants

2015-09-16 Thread Boqun Feng
Some atomic operations now have _{relaxed, acquire, release} variants, this patch then adds some trivial tests for two purpose: 1. test the behavior of these new operations in single-CPU environment. 2. make their code generated before we actually use them somewhere, so

[RFC v2 4/7] powerpc: atomic: Implement xchg_* and atomic{, 64}_xchg_* variants

2015-09-16 Thread Boqun Feng
Implement xchg_relaxed and define atomic{,64}_xchg_* as xchg_relaxed, based on these _relaxed variants, release/acquire variants can be built. Note that xchg_relaxed and atomic_{,64}_xchg_relaxed are not compiler barriers. Signed-off-by: Boqun Feng ---

[RFC v2 2/7] atomics: Allow architectures to define their own __atomic_op_* helpers

2015-09-16 Thread Boqun Feng
Some architectures may have their special barriers for acquire, release and fence semantics, so that general memory barriers(smp_mb__*_atomic()) in the default __atomic_op_*() may be too strong, so allow architectures to define their own helpers which can overwrite the default helpers.

[PATCH v2 00/30] cxlflash: Miscellaneous bug fixes and corrections

2015-09-16 Thread Matthew R. Ochs
This patch set contains various fixes and corrections for issues that were found during test and code review. The series is based upon the code upstreamed in 4.3 and is intended for the rc phase. The entire set is bisectable. Please reference the changelog below for details on what has been

[PATCH v2 02/30] cxlflash: Replace magic numbers with literals

2015-09-16 Thread Matthew R. Ochs
From: Manoj Kumar Magic numbers are not meaningful and can create confusion. As a remedy, replace them with descriptive literals. Replace 512 with literal MAX_SECTOR_UNIT. Replace 5 with literal CMD_RETRIES. Signed-off-by: Matthew R. Ochs

[PATCH v2 03/30] cxlflash: Fix read capacity timeout

2015-09-16 Thread Matthew R. Ochs
From: Manoj Kumar The timeout value for read capacity is too small. Certain devices may take longer to respond and thus the command may prematurely timeout. Additionally the literal used for the timeout is stale. Update the timeout to 30 seconds (matches the value used in

[PATCH v2 04/30] cxlflash: Fix potential oops following LUN removal

2015-09-16 Thread Matthew R. Ochs
When a LUN is removed, the sdev that is associated with the LUN remains intact until its reference count drops to 0. In order to prevent an sdev from being removed while a context is still associated with it, obtain an additional reference per-context for each LUN attached to the context. This

[PATCH v2 05/30] cxlflash: Fix data corruption when vLUN used over multiple cards

2015-09-16 Thread Matthew R. Ochs
If the same virtual LUN is accessed over multiple cards, only accesses made over the first card will be valid. Accesses made over the second card will go to the wrong LUN causing data corruption. This is because the global LUN's mode word was being used to determine whether the LUN table for that

[PATCH v2 01/30] cxlflash: Fix to avoid invalid port_sel value

2015-09-16 Thread Matthew R. Ochs
From: Manoj Kumar If two concurrent MANAGE_LUN ioctls are issued with the same WWID parameter, it would result in an incorrect value of port_sel. This is because port_sel is modified without any locks being held. If the first caller stalls after the return from

[PATCH v2 06/30] cxlflash: Fix to avoid sizeof(bool)

2015-09-16 Thread Matthew R. Ochs
Using sizeof(bool) is considered poor form for various reasons and sparse warns us of that. Correct by changing type from bool to u8. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/superpipe.c | 2 +-

[PATCH v2 08/30] cxlflash: Fix to avoid CXL services during EEH

2015-09-16 Thread Matthew R. Ochs
During an EEH freeze event, certain CXL services should not be called until after the hardware reset has taken place. Doing so can result in unnecessary failures and possibly cause other ill effects by triggering hardware accesses. This translates to a requirement to quiesce all threads that may

[PATCH v2 07/30] cxlflash: Fix context encode mask width

2015-09-16 Thread Matthew R. Ochs
The context encode mask covers more than 32-bits, making it a long integer. This should be noted by appending the ULL width suffix to the mask. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar ---

[PATCH v2 09/30] cxlflash: Fix to stop interrupt processing on remove

2015-09-16 Thread Matthew R. Ochs
Interrupt processing can run in parallel to a remove operation. This can lead to a condition where the interrupt handler is processing with memory that has been freed. To avoid processing an interrupt while memory may be yanked, check for removal while in the interrupt handler. Bail when

[PATCH v2 10/30] cxlflash: Correct naming of limbo state and waitq

2015-09-16 Thread Matthew R. Ochs
Limbo is not an accurate representation of this state and is also not consistent with the terminology that other drivers use to represent this concept. Rename the state and and its associated waitq to 'reset'. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N.

[PATCH v2 11/30] cxlflash: Make functions static

2015-09-16 Thread Matthew R. Ochs
Found during code inspection, that the following functions are not being used outside of the file where they are defined. Make them static. int cxlflash_send_cmd(struct afu *, struct afu_cmd *); void cxlflash_wait_resp(struct afu *, struct afu_cmd *); int cxlflash_afu_reset(struct cxlflash_cfg

[PATCH v2 12/30] cxlflash: Refine host/device attributes

2015-09-16 Thread Matthew R. Ochs
Implement the following suggestions and add two new attributes to allow for debugging the port LUN table. - use scnprintf() instead of snprintf() - use DEVICE_ATTR_RO and DEVICE_ATTR_RW Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar

[PATCH v2 13/30] cxlflash: Fix to avoid spamming the kernel log

2015-09-16 Thread Matthew R. Ochs
During run-time the driver can be very chatty and spam the system kernel log. Various print statements can be limited and/or moved to development-only mode. Additionally, numerous prints can be converted to trace the corresponding device. The following changes were made: - pr_debug to pr_devel

[RFC v2 7/7] powerpc: atomic: Make atomic{, 64}_cmpxchg and cmpxchg a full barrier

2015-09-16 Thread Boqun Feng
According to memory-barriers.txt, cmpxchg and its atomic{,64}_ versions need to imply a full barrier, however they are now just RELEASE+ACQUIRE, which is not a full barrier. So replace PPC_RELEASE_BARRIER and PPC_ACQUIRE_BARRIER with PPC_ATOMIC_ENTRY_BARRIER and PPC_ATOMIC_EXIT_BARRIER in

Re: [BUG] Revert 0b05e2d671c4 'powerpc/32: cacheable_memcpy becomes memcpy'

2015-09-16 Thread Scott Wood
On Wed, 2015-09-16 at 18:23 +0200, Thomas Gleixner wrote: > With this commit applied, my MPC5200 board fails to boot 4.3-rc1. The > boot failure is silent. > > Bisection pointed straight to this commit. Reverting it on top of > 4.3-rc1 works like a charm. Yes, we've been iterating on a fix for

[BUG] Revert 0b05e2d671c4 'powerpc/32: cacheable_memcpy becomes memcpy'

2015-09-16 Thread Thomas Gleixner
With this commit applied, my MPC5200 board fails to boot 4.3-rc1. The boot failure is silent. Bisection pointed straight to this commit. Reverting it on top of 4.3-rc1 works like a charm. Thanks, tglx ___ Linuxppc-dev mailing list

[RFC v2 6/7] powerpc: atomic: Make atomic{, 64}_xchg and xchg a full barrier

2015-09-16 Thread Boqun Feng
According to memory-barriers.txt, xchg and its atomic{,64}_ versions need to imply a full barrier, however they are now just RELEASE+ACQUIRE, which is not a full barrier. So remove the definition of xchg(), and let __atomic_op_fence() build the full-barrier versions of these operations.

Re: [PATCH] powerpc/mm: Recompute hash value after a failed update

2015-09-16 Thread Aneesh Kumar K.V
Michael Ellerman writes: > On Wed, 2015-09-16 at 11:27 +0530, Aneesh Kumar K.V wrote: >> Michael Ellerman writes: >> >> > On Wed, 2015-09-16 at 08:53 +0530, Aneesh Kumar K.V wrote: >> >> "Aneesh Kumar K.V" writes: >>

Re: [PATCH v2 01/30] cxlflash: Fix to avoid invalid port_sel value

2015-09-16 Thread James Bottomley
Could you please add a cover letter (a 0/30) and thread your patches from that? For large patch series, it really does make following everything a lot easier for me (and most other people who use a threaded mail reader). Thanks, James ___

Re: [BUG] Revert 0b05e2d671c4 'powerpc/32: cacheable_memcpy becomes memcpy'

2015-09-16 Thread Thomas Gleixner
On Wed, 16 Sep 2015, Scott Wood wrote: > On Wed, 2015-09-16 at 18:23 +0200, Thomas Gleixner wrote: > > With this commit applied, my MPC5200 board fails to boot 4.3-rc1. The > > boot failure is silent. > > > > Bisection pointed straight to this commit. Reverting it on top of > > 4.3-rc1 works

[PATCH v2 08/30] cxlflash: Fix to avoid CXL services during EEH

2015-09-16 Thread Matthew R. Ochs
During an EEH freeze event, certain CXL services should not be called until after the hardware reset has taken place. Doing so can result in unnecessary failures and possibly cause other ill effects by triggering hardware accesses. This translates to a requirement to quiesce all threads that may

[PATCH v2 14/30] cxlflash: Fix to avoid stall while waiting on TMF

2015-09-16 Thread Matthew R. Ochs
Borrowing the TMF waitq's spinlock causes a stall condition when waiting for the TMF to complete. To remedy, introduce our own spin lock to serialize TMF and use the appropriate wait services. Also add a timeout while waiting for a TMF completion. When a TMF times out, report back a failure such

[PATCH v2 22/30] cxlflash: Correct behavior in device reset handler following EEH

2015-09-16 Thread Matthew R. Ochs
When the device reset handler is entered while a reset operation is taking place, the handler exits without actually sending a reset (TMF) to the targeted device. This behavior is incorrect as the device is not reset. Further complicating matters is the fact that a success is returned even when

[PATCH v5 43/53] powerpc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing

2015-09-16 Thread Yinghai Lu
For device resource PREF bit setting under bridge 64-bit pref resource, we need to make sure only set PREF for 64bit resource, so set IORESOUCE_MEM_64 for 64bit resource during of device resource flags parsing. Link: https://bugzilla.kernel.org/show_bug.cgi?id=96261 Link:

Re: [PATCH v2 01/30] cxlflash: Fix to avoid invalid port_sel value

2015-09-16 Thread Matthew R. Ochs
> On Sep 16, 2015, at 2:18 PM, James Bottomley > wrote: > > Could you please add a cover letter (a 0/30) and thread your patches > from that? For large patch series, it really does make following > everything a lot easier for me (and most other people who

[PATCH v2 13/30] cxlflash: Fix to avoid spamming the kernel log

2015-09-16 Thread Matthew R. Ochs
During run-time the driver can be very chatty and spam the system kernel log. Various print statements can be limited and/or moved to development-only mode. Additionally, numerous prints can be converted to trace the corresponding device. The following changes were made: - pr_debug to pr_devel

[PATCH v2 16/30] cxlflash: Fix host link up event handling

2015-09-16 Thread Matthew R. Ochs
Following a link up event, the LUNs available to the host may have changed. Without rescanning the host, the LUN topology is unknown to the user. In such a state, the user would be unable to locate provisioned resources. To remedy, the host should be rescanned after a link up event.

[PATCH v2 25/30] cxlflash: Fix MMIO and endianness errors

2015-09-16 Thread Matthew R. Ochs
Sparse uncovered several errors with MMIO operations (accessing directly) and handling endianness. These can cause issues when running in different environments. Introduce __iomem and proper endianness tags/swaps where appropriate to make driver sparse clean. Signed-off-by: Matthew R. Ochs

[PATCH v2 26/30] cxlflash: Fix to prevent EEH recovery failure

2015-09-16 Thread Matthew R. Ochs
The process_sense() routine can perform a read capacity which can take some time to complete. If an EEH occurs while waiting on the read capacity, the EEH handler is unable to obtain the context's mutex in order to put the context in an error state. The EEH handler will sit and wait until the

[PATCH v2 06/30] cxlflash: Fix to avoid sizeof(bool)

2015-09-16 Thread Matthew R. Ochs
Using sizeof(bool) is considered poor form for various reasons and sparse warns us of that. Correct by changing type from bool to u8. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/superpipe.c | 2 +-

[PATCH v2 07/30] cxlflash: Fix context encode mask width

2015-09-16 Thread Matthew R. Ochs
The context encode mask covers more than 32-bits, making it a long integer. This should be noted by appending the ULL width suffix to the mask. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar ---

[PATCH v2 17/30] cxlflash: Fix async interrupt bypass logic

2015-09-16 Thread Matthew R. Ochs
A bug was introduced earlier in the development cycle when cleaning up logic statements. Instead of skipping bits that are not set, set bits are skipped, causing async interrupts to not be handled correctly. To fix, simply add back in the proper evaluation for an unset bit. Signed-off-by:

[PATCH v2 18/30] cxlflash: Remove dual port online dependency

2015-09-16 Thread Matthew R. Ochs
At present, both ports must be online for the device to configure properly. Remove this dependency and the unnecessary internal LUN override logic as well. Additionally, as a refactoring measure, change the return code variable name to match that used throughout the driver. Signed-off-by: Matthew

[PATCH v2 23/30] cxlflash: Remove unnecessary scsi_block_requests

2015-09-16 Thread Matthew R. Ochs
The host reset handler is called with I/O already blocked, thus there is no need to explicitly block and unblock I/O in the handler. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by: Brian King

[PATCH 1/6] dmaengine: fsldma: Fix module autoload for OF platform driver

2015-09-16 Thread Luis de Bethencourt
This platform driver has a OF device ID table but the OF module alias information is not created so module autoloading won't work. Signed-off-by: Luis de Bethencourt --- drivers/dma/fsldma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/fsldma.c

[PATCH v2 00/30] cxlflash: Miscellaneous bug fixes and corrections

2015-09-16 Thread Matthew R. Ochs
This patch set contains various fixes and corrections for issues that were found during test and code review. The series is based upon the code upstreamed in 4.3 and is intended for the rc phase. The entire set is bisectable. Please reference the changelog below for details on what has been

[PATCH v2 03/30] cxlflash: Fix read capacity timeout

2015-09-16 Thread Matthew R. Ochs
From: Manoj Kumar The timeout value for read capacity is too small. Certain devices may take longer to respond and thus the command may prematurely timeout. Additionally the literal used for the timeout is stale. Update the timeout to 30 seconds (matches the value used in

[PATCH v2 12/30] cxlflash: Refine host/device attributes

2015-09-16 Thread Matthew R. Ochs
Implement the following suggestions and add two new attributes to allow for debugging the port LUN table. - use scnprintf() instead of snprintf() - use DEVICE_ATTR_RO and DEVICE_ATTR_RW Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar

[PATCH v2 19/30] cxlflash: Fix AFU version access/storage and add check

2015-09-16 Thread Matthew R. Ochs
The AFU version is stored as a non-terminated string of bytes within a 64-bit little-endian register. Presently the value is read directly (no MMIO accessor) and is stored in a buffer that is not big enough to contain a NULL terminator. Additionally the version obtained is not evaluated against a

[PATCH v2 20/30] cxlflash: Correct usage of scsi_host_put()

2015-09-16 Thread Matthew R. Ochs
Currently, scsi_host_put() is being called prematurely in the remove path and is missing entirely in an error cleanup path. The former can lead to memory being freed too early with subsequent access potentially corrupting data whilst the former would result in a memory leak. Move the usage on

[PATCH v2 30/30] MAINTAINERS: Add cxlflash driver

2015-09-16 Thread Matthew R. Ochs
Add stanza for cxlflash SCSI driver. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 310da42..b0b2c3f 100644 ---

[PATCH v5 30/53] PCI: Unify skip_ioresource_align()

2015-09-16 Thread Yinghai Lu
There are powerpc generic version and x86 local version for skip_ioresource_align(). Move the powerpc version to setup-bus.c, and kill x86 local version. Also kill dummy version in microblaze. Cc: Michal Simek Cc: Paul Mackerras Cc: Michael Ellerman

[PATCH v2 24/30] cxlflash: Fix function prolog parameters and return codes

2015-09-16 Thread Matthew R. Ochs
Several function prologs have incorrect parameter names and return code descriptions. This can lead to confusion when reviewing the source and creates inaccurate documentation. To remedy, update the function prologs to properly reflect parameter names and return codes. Signed-off-by: Matthew R.

[PATCH v2 29/30] cxlflash: Fix to avoid state change collision

2015-09-16 Thread Matthew R. Ochs
The adapter state machine is susceptible to missing and/or corrupting state updates at runtime. This can lead to a variety of unintended issues and is due to the lack of a serialization mechanism to protect the adapter state. Use an adapter-wide mutex to serialize state changes. Signed-off-by:

[PATCH v2 01/30] cxlflash: Fix to avoid invalid port_sel value

2015-09-16 Thread Matthew R. Ochs
From: Manoj Kumar If two concurrent MANAGE_LUN ioctls are issued with the same WWID parameter, it would result in an incorrect value of port_sel. This is because port_sel is modified without any locks being held. If the first caller stalls after the return from

[PATCH v2 05/30] cxlflash: Fix data corruption when vLUN used over multiple cards

2015-09-16 Thread Matthew R. Ochs
If the same virtual LUN is accessed over multiple cards, only accesses made over the first card will be valid. Accesses made over the second card will go to the wrong LUN causing data corruption. This is because the global LUN's mode word was being used to determine whether the LUN table for that

[PATCH v2 15/30] cxlflash: Fix location of setting resid

2015-09-16 Thread Matthew R. Ochs
The resid is incorrectly set which can lead to unnecessary retry attempts by the stack. This is due to resid _always_ being set using a value returned from the adapter. Instead, the value should only be interpreted and set when in an underrun scenario. Signed-off-by: Matthew R. Ochs

[PATCH v2 21/30] cxlflash: Fix to prevent workq from accessing freed memory

2015-09-16 Thread Matthew R. Ochs
The workq can process work in parallel with a remove event, leading to a condition where the workq handler can access freed memory. To remedy, the workq should be terminated prior to freeing memory. Move the termination call earlier in remove and use cancel_work_sync() instead of flush_work() as

[PATCH v5 52/53] PCI: Introduce resource_disabled()

2015-09-16 Thread Yinghai Lu
Current is using !flags, and we are going to use IORESOURCE_DISABLED instead of clearing resource flags. Let's convert all !flags to helper function resource_disabled(). resource_disabled will check !flags and IORESOURCE_DISABLED both. Cc: linux-al...@vger.kernel.org Cc:

[PATCH v2 02/30] cxlflash: Replace magic numbers with literals

2015-09-16 Thread Matthew R. Ochs
From: Manoj Kumar Magic numbers are not meaningful and can create confusion. As a remedy, replace them with descriptive literals. Replace 512 with literal MAX_SECTOR_UNIT. Replace 5 with literal CMD_RETRIES. Signed-off-by: Matthew R. Ochs

[PATCH v2 04/30] cxlflash: Fix potential oops following LUN removal

2015-09-16 Thread Matthew R. Ochs
When a LUN is removed, the sdev that is associated with the LUN remains intact until its reference count drops to 0. In order to prevent an sdev from being removed while a context is still associated with it, obtain an additional reference per-context for each LUN attached to the context. This

[PATCH v2 10/30] cxlflash: Correct naming of limbo state and waitq

2015-09-16 Thread Matthew R. Ochs
Limbo is not an accurate representation of this state and is also not consistent with the terminology that other drivers use to represent this concept. Rename the state and and its associated waitq to 'reset'. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N.

[PATCH v2 09/30] cxlflash: Fix to stop interrupt processing on remove

2015-09-16 Thread Matthew R. Ochs
Interrupt processing can run in parallel to a remove operation. This can lead to a condition where the interrupt handler is processing with memory that has been freed. To avoid processing an interrupt while memory may be yanked, check for removal while in the interrupt handler. Bail when

[PATCH v2 27/30] cxlflash: Correct spelling, grammar, and alignment mistakes

2015-09-16 Thread Matthew R. Ochs
There are several spelling and grammar mistakes throughout the driver. Additionally there are a handful of places where there are extra lines and unnecessary variables/statements. These are a nuisance and pollute the driver. Fix spelling and grammar issues. Update some comments for clarity and

Re: [BUG] Revert 0b05e2d671c4 'powerpc/32: cacheable_memcpy becomes memcpy'

2015-09-16 Thread Michael Ellerman
On Wed, 2015-09-16 at 11:29 -0500, Scott Wood wrote: > On Wed, 2015-09-16 at 18:23 +0200, Thomas Gleixner wrote: > > With this commit applied, my MPC5200 board fails to boot 4.3-rc1. The > > boot failure is silent. > > > > Bisection pointed straight to this commit. Reverting it on top of > >

Re: [BUG] Revert 0b05e2d671c4 'powerpc/32: cacheable_memcpy becomes memcpy'

2015-09-16 Thread Steven Rostedt
On Wed, 16 Sep 2015 22:01:06 +0200 (CEST) Thomas Gleixner wrote: > On Wed, 16 Sep 2015, Scott Wood wrote: > > > On Wed, 2015-09-16 at 18:23 +0200, Thomas Gleixner wrote: > > > With this commit applied, my MPC5200 board fails to boot 4.3-rc1. The > > > boot failure is silent.

Re: [PATCH V9 11/11] powerpc/powernv: compound PE for VFs

2015-09-16 Thread Gavin Shan
On Wed, Sep 09, 2015 at 02:01:29PM +0800, Richard Yang wrote: >On Wed, Sep 09, 2015 at 03:22:08PM +1000, Alexey Kardashevskiy wrote: >>On 09/09/2015 01:36 PM, Richard Yang wrote: >>>On Wed, Sep 09, 2015 at 12:48:21PM +1000, Gavin Shan wrote: On Wed, Jul 29, 2015 at 11:17:18AM +0800, Wei Yang

Re: powerpc/boot: Specify ABI v2 when building an LE boot wrapper

2015-09-16 Thread Michael Ellerman
On Tue, 2015-15-09 at 01:24:17 UTC, Benjamin Herrenschmidt wrote: > The kernel does it, not the boot wrapper, which breaks with some > cross compilers that still default to ABI v1. > > Signed-off-by: Benjamin Herrenschmidt > CC: sta...@vger.kernel.org Applied to

Re: [BUG] Revert 0b05e2d671c4 'powerpc/32: cacheable_memcpy becomes memcpy'

2015-09-16 Thread Michael Ellerman
On Wed, 2015-09-16 at 21:54 -0400, Steven Rostedt wrote: > On Wed, 16 Sep 2015 22:01:06 +0200 (CEST) > Thomas Gleixner wrote: > > > On Wed, 16 Sep 2015, Scott Wood wrote: > > > > > On Wed, 2015-09-16 at 18:23 +0200, Thomas Gleixner wrote: > > > > With this commit applied, my

Re: [v4,1/2] powerpc32: memcpy: only use dcbz once cache is enabled

2015-09-16 Thread Michael Ellerman
On Wed, 2015-16-09 at 10:04:51 UTC, LEROY Christophe wrote: > memcpy() uses instruction dcbz to speed up copy by not wasting time > loading cache line with data that will be overwritten. > Some platform like mpc52xx do no have cache active at startup and > can therefore not use memcpy(). Allthough

Re: [BUG] Revert 0b05e2d671c4 'powerpc/32: cacheable_memcpy becomes memcpy'

2015-09-16 Thread Segher Boessenkool
On Thu, Sep 17, 2015 at 12:50:12PM +1000, Michael Ellerman wrote: > On Wed, 2015-09-16 at 21:54 -0400, Steven Rostedt wrote: > > This could be a symptom and not the problem. What the above shows is > > that ftrace tried to convert the mcount at change_protection but what > > it expected was there

Re: [v2] cxl: Fix unbalanced pci_dev_get in cxl_probe

2015-09-16 Thread Michael Ellerman
On Tue, 2015-15-09 at 05:04:07 UTC, Daniel Axtens wrote: > Currently the first thing we do in cxl_probe is to grab a reference > on the pci device. Later on, we call device_register on our adapter. > In our remove path, we call device_unregister, but we never call > pci_dev_put. We therefore leak

Re: [v4,2/2] powerpc32: memset: only use dcbz once cache is enabled

2015-09-16 Thread Michael Ellerman
On Wed, 2015-16-09 at 10:04:53 UTC, LEROY Christophe wrote: > memset() uses instruction dcbz to speed up clearing by not wasting time > loading cache line with data that will be overwritten. > Some platform like mpc52xx do no have cache active at startup and > can therefore not use memset().

Time to remove platforms/cell?

2015-09-16 Thread Michael Ellerman
Discuss ... cheers ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: cxl: Fix build failure due to -Wunused-variable behaviour change

2015-09-16 Thread Michael Ellerman
On Tue, 2015-15-09 at 05:48:34 UTC, Ian Munsie wrote: > From: Ian Munsie > > A recent change in gcc caused this build failure: > > /var/lib/jenkins/workspace/gcc_kernel_build/linux/drivers/misc/cxl/cxl.h:72:27: > error: ‘CXL_PSL_DLCNTL’ defined but not used >

Re: powerpc/mm: Recompute hash value after a failed update

2015-09-16 Thread Michael Ellerman
On Tue, 2015-15-09 at 07:00:08 UTC, "Aneesh Kumar K.V" wrote: > If we had secondary hash flag set, we ended up modifying hash value in > the updatepp code path. Hence with a failed updatepp we will be using > a wrong hash value for the following hash insert. Fix this by > recomputing hash before

[PATCH v3] powerpc: msi: mark bitmap with kmemleak_not_leak()

2015-09-16 Thread Denis Kirjanov
During the MSI bitmap test on boot kmemleak spews the following trace: unreferenced object 0xc0016e86c900 (size 64): comm "swapper/0", pid 1, jiffies 4294893173 (age 518.024s) hex dump (first 32 bytes): 00 00 01 ff 7f ff 7f 37 00 00 00 00 00 00 00 00 ...7

[PATCH v2 14/30] cxlflash: Fix to avoid stall while waiting on TMF

2015-09-16 Thread Matthew R. Ochs
Borrowing the TMF waitq's spinlock causes a stall condition when waiting for the TMF to complete. To remedy, introduce our own spin lock to serialize TMF and use the appropriate wait services. Also add a timeout while waiting for a TMF completion. When a TMF times out, report back a failure such

[PATCH v2 15/30] cxlflash: Fix location of setting resid

2015-09-16 Thread Matthew R. Ochs
The resid is incorrectly set which can lead to unnecessary retry attempts by the stack. This is due to resid _always_ being set using a value returned from the adapter. Instead, the value should only be interpreted and set when in an underrun scenario. Signed-off-by: Matthew R. Ochs

[PATCH v2 16/30] cxlflash: Fix host link up event handling

2015-09-16 Thread Matthew R. Ochs
Following a link up event, the LUNs available to the host may have changed. Without rescanning the host, the LUN topology is unknown to the user. In such a state, the user would be unable to locate provisioned resources. To remedy, the host should be rescanned after a link up event.

[PATCH v2 17/30] cxlflash: Fix async interrupt bypass logic

2015-09-16 Thread Matthew R. Ochs
A bug was introduced earlier in the development cycle when cleaning up logic statements. Instead of skipping bits that are not set, set bits are skipped, causing async interrupts to not be handled correctly. To fix, simply add back in the proper evaluation for an unset bit. Signed-off-by:

[PATCH v2 18/30] cxlflash: Remove dual port online dependency

2015-09-16 Thread Matthew R. Ochs
At present, both ports must be online for the device to configure properly. Remove this dependency and the unnecessary internal LUN override logic as well. Additionally, as a refactoring measure, change the return code variable name to match that used throughout the driver. Signed-off-by: Matthew

[PATCH v2 21/30] cxlflash: Fix to prevent workq from accessing freed memory

2015-09-16 Thread Matthew R. Ochs
The workq can process work in parallel with a remove event, leading to a condition where the workq handler can access freed memory. To remedy, the workq should be terminated prior to freeing memory. Move the termination call earlier in remove and use cancel_work_sync() instead of flush_work() as

[PATCH v2 22/30] cxlflash: Correct behavior in device reset handler following EEH

2015-09-16 Thread Matthew R. Ochs
When the device reset handler is entered while a reset operation is taking place, the handler exits without actually sending a reset (TMF) to the targeted device. This behavior is incorrect as the device is not reset. Further complicating matters is the fact that a success is returned even when

[PATCH v2 23/30] cxlflash: Remove unnecessary scsi_block_requests

2015-09-16 Thread Matthew R. Ochs
The host reset handler is called with I/O already blocked, thus there is no need to explicitly block and unblock I/O in the handler. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by: Brian King

[PATCH v2 20/30] cxlflash: Correct usage of scsi_host_put()

2015-09-16 Thread Matthew R. Ochs
Currently, scsi_host_put() is being called prematurely in the remove path and is missing entirely in an error cleanup path. The former can lead to memory being freed too early with subsequent access potentially corrupting data whilst the former would result in a memory leak. Move the usage on

[PATCH v2 19/30] cxlflash: Fix AFU version access/storage and add check

2015-09-16 Thread Matthew R. Ochs
The AFU version is stored as a non-terminated string of bytes within a 64-bit little-endian register. Presently the value is read directly (no MMIO accessor) and is stored in a buffer that is not big enough to contain a NULL terminator. Additionally the version obtained is not evaluated against a

[PATCH v2 24/30] cxlflash: Fix function prolog parameters and return codes

2015-09-16 Thread Matthew R. Ochs
Several function prologs have incorrect parameter names and return code descriptions. This can lead to confusion when reviewing the source and creates inaccurate documentation. To remedy, update the function prologs to properly reflect parameter names and return codes. Signed-off-by: Matthew R.

[PATCH v2 25/30] cxlflash: Fix MMIO and endianness errors

2015-09-16 Thread Matthew R. Ochs
Sparse uncovered several errors with MMIO operations (accessing directly) and handling endianness. These can cause issues when running in different environments. Introduce __iomem and proper endianness tags/swaps where appropriate to make driver sparse clean. Signed-off-by: Matthew R. Ochs

[PATCH v2 26/30] cxlflash: Fix to prevent EEH recovery failure

2015-09-16 Thread Matthew R. Ochs
The process_sense() routine can perform a read capacity which can take some time to complete. If an EEH occurs while waiting on the read capacity, the EEH handler is unable to obtain the context's mutex in order to put the context in an error state. The EEH handler will sit and wait until the

[PATCH v2 27/30] cxlflash: Correct spelling, grammar, and alignment mistakes

2015-09-16 Thread Matthew R. Ochs
There are several spelling and grammar mistakes throughout the driver. Additionally there are a handful of places where there are extra lines and unnecessary variables/statements. These are a nuisance and pollute the driver. Fix spelling and grammar issues. Update some comments for clarity and

  1   2   >