Re: [PATCH] powerpc/eeh: eeh_pci_enable(): fix checking of post-request state

2015-10-23 Thread Gavin Shan
On Fri, Oct 23, 2015 at 05:19:46PM +1100, Andrew Donnellan wrote: >In eeh_pci_enable(), after making the request to set the new options, we >call eeh_ops->wait_state() to check that the request finished successfully. > >At the moment, if eeh_ops->wait_state() returns 0, we return 0 without >checkin

Re: [PATCH v3 0/5] clk: qoriq: Move chip-specific knowledge into driver

2015-10-23 Thread Scott Wood
On Sat, 2015-09-19 at 23:29 -0500, Scott Wood wrote: > The existing device tree bindings are error-prone and inflexible. > Correct the mistake by moving the knowledge into the driver, which has > more flexibility in describing the quirks of each chip. This leaves the > device tree to its proper r

Re: [PATCH 5/7] [RFC PATCH 5/7] sparc: rename kernel/iommu_common.h -> include/asm/iommu_common.h

2015-10-23 Thread Nishanth Aravamudan
[Apologies for the subject line, should just have the [RFC PATCH 5/7]] On 23.10.2015 [14:00:08 -0700], Nishanth Aravamudan wrote: > In order to cleanly expose the desired IOMMU page shift via the new > dma_get_page_shift API, we need to have the sparc constants available in > a more typical locati

[PATCH 7/7 v2] drivers/nvme: default to the IOMMU page size

2015-10-23 Thread Nishanth Aravamudan
We received a bug report recently when DDW (64-bit direct DMA on Power) is not enabled for NVMe devices. In that case, we fall back to 32-bit DMA via the IOMMU, which is always done via 4K TCEs (Translation Control Entries). The NVMe device driver, though, assumes that the DMA alignment for the PR

[RFC PATCH 6/7] sparc/dma-mapping: override dma_get_page_shift

2015-10-23 Thread Nishanth Aravamudan
On sparc, the kernel's page size differs from the IOMMU's page size, so override the generic implementation, which always returns the kernel's page size, and return IOMMU_PAGE_SHIFT instead. Signed-off-by: Nishanth Aravamudan --- I know very little about sparc, so please correct me if this patch

[PATCH 5/7] [RFC PATCH 5/7] sparc: rename kernel/iommu_common.h -> include/asm/iommu_common.h

2015-10-23 Thread Nishanth Aravamudan
In order to cleanly expose the desired IOMMU page shift via the new dma_get_page_shift API, we need to have the sparc constants available in a more typical location. There should be no functional impact to this move, but it is untested. Signed-off-by: Nishanth Aravamudan --- arch/sparc/include/a

Re: [PATCH v12 3/6] CPM/QE: use genalloc to manage CPM/QE muram

2015-10-23 Thread Scott Wood
Don't send HTML e-mail. On Fri, 2015-10-23 at 02:06 -0500, Zhao Qiang-B45475 wrote: > On Fri, 2015-10-23 at 11:00 AM, Wood Scott-B07421 > wrote: > > -Original Message- > > From: Wood Scott-B07421 > > Sent: Friday, October 23, 2015 11:00 AM > > To: Zhao Qiang-B45475 > > Cc: linux-ker...@

[PATCH 4/7 v2] pseries/iommu: implement DDW-aware dma_get_page_shift

2015-10-23 Thread Nishanth Aravamudan
When DDW (Dynamic DMA Windows) are present for a device, we have stored the TCE (Translation Control Entry) size in a special device tree property. Check if we have enabled DDW for the device and return the TCE size from that property if present. If the property isn't present, fallback to looking t

[PATCH 3/7 v2] powerpc/dma: implement per-platform dma_get_page_shift

2015-10-23 Thread Nishanth Aravamudan
The IOMMU page size is not always stored in struct iommu on Power. Specifically if a device is configured for DDW (Dynamic DMA Windows aka. 64-bit direct DMA), the used TCE (Translation Control Entry) size is stored in a special device property created at run-time by the DDW configuration code. DDW

Re: [PATCH 0/5 v3] Fix NVMe driver support on Power with 32-bit DMA

2015-10-23 Thread Nishanth Aravamudan
[Sorry, subject should have been 0/7!] On 23.10.2015 [13:54:20 -0700], Nishanth Aravamudan wrote: > We received a bug report recently when DDW (64-bit direct DMA on Power) > is not enabled for NVMe devices. In that case, we fall back to 32-bit > DMA via the IOMMU, which is always done via 4K TCEs

[PATCH 2/7 v2] powerpc/dma-mapping: override dma_get_page_shift

2015-10-23 Thread Nishanth Aravamudan
On Power, the kernel's page size can differ from the IOMMU's page size, so we need to override the generic implementation, which always returns the kernel's page size. Lookup the IOMMU's page size from struct iommu_table, if available. Fallback to the kernel's page size, otherwise. Signed-off-by:

Re: [PATCH v12 4/6] QE/CPM: move muram management functions to qe_common

2015-10-23 Thread Scott Wood
On Fri, 2015-10-23 at 02:45 -0500, Zhao Qiang-B45475 wrote: > On Fri, 2015-10-23 at 11:10 AM, Wood Scott-B07421 > wrote: > > -Original Message- > > From: Wood Scott-B07421 > > Sent: Friday, October 23, 2015 11:10 AM > > To: Zhao Qiang-B45475 > > Cc: linux-ker...@vger.kernel.org; linuxppc

[PATCH 1/7 v3] dma-mapping: add generic dma_get_page_shift API

2015-10-23 Thread Nishanth Aravamudan
Drivers like NVMe need to be able to determine the page size used for DMA transfers. Add a new API that defaults to return PAGE_SHIFT on all architectures. Signed-off-by: Nishanth Aravamudan --- v1 -> v2: Based upon feedback from Christoph Hellwig, implement the IOMMU page size lookup as a g

Re: [PATCH v12 6/6] QE: Move QE from arch/powerpc to drivers/soc

2015-10-23 Thread Scott Wood
On Fri, 2015-10-23 at 02:49 -0500, Zhao Qiang-B45475 wrote: > On Fri, Oct 23, 2015 at 11:20 AM, Wood Scott-B07421 > wrote: > > -Original Message- > > From: Wood Scott-B07421 > > Sent: Friday, October 23, 2015 11:20 AM > > To: Zhao Qiang-B45475 > > Cc: linux-ker...@vger.kernel.org; linuxpp

[PATCH 0/5 v3] Fix NVMe driver support on Power with 32-bit DMA

2015-10-23 Thread Nishanth Aravamudan
We received a bug report recently when DDW (64-bit direct DMA on Power) is not enabled for NVMe devices. In that case, we fall back to 32-bit DMA via the IOMMU, which is always done via 4K TCEs (Translation Control Entries). The NVMe device driver, though, assumes that the DMA alignment for the PR

Re: [PATCH V4 00/31] powerpc/mm: Update page table format for book3s 64

2015-10-23 Thread Denis Kirjanov
On 10/23/15, Aneesh Kumar K.V wrote: > Denis Kirjanov writes: > >> On 10/17/15, Aneesh Kumar K.V wrote: >>> Hi All, >>> >>> This patch series attempt to update book3s 64 linux page table format to >>> make it more flexible. Our current pte format is very restrictive and we >>> overload multiple

[PATCH] powerpc/pseries: Verify CPU doesn't exist before adding

2015-10-23 Thread Nathan Fontenot
When DLPAR adding a CPU we should verify that the CPU does not already exist. Failure to do so can generate a kernel oops; [9.465585] kernel BUG at arch/powerpc/platforms/pseries/dlpar.c:382! [9.465796] Oops: Exception in kernel mode, sig: 5 [#1] This oops can be generated by causing a pr

Re: [PATCH v6 34/37] cxlflash: Fix to escalate to LINK_RESET on login timeout

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:16, Matthew R. Ochs wrote: > From: Manoj Kumar > > A 'login timed out' asynchronous error interrupt is generated if no > response is seen to a FLOGI within 2 seconds. If the time out error > is not escalated to a LINK_RESET the port will not be available for > use. This fix provi

Re: [PATCH v6 33/37] cxlflash: Fix to avoid leaving dangling interrupt resources

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:16, Matthew R. Ochs wrote: > When running with an unsupported AFU, the cxlflash driver fails > the probe. When the driver is removed, the following Oops is > encountered on a show_interrupts() thread: > > Call Trace: > [c01fba5a7a10] [0003] 0x3 (unreliable) > [c

Re: [PATCH v6 32/37] cxlflash: Fix to avoid potential deadlock on EEH

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:15, Matthew R. Ochs wrote: > Ioctl threads that use scsi_execute() can run for an excessive amount > of time due to the fact that they have lengthy timeouts and retry logic > built in. Under normal operation this is not an issue. However, once EEH > enters the picture, a long execu

Re: [PATCH v6 31/37] cxlflash: Correct trace string

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:15, Matthew R. Ochs wrote: > The trace following the failure of alloc_mem() incorrectly identifies > which function failed. This can lead to misdiagnosing a failure. > > Fix the string to correctly indicate that alloc_mem() failed. > > Reported-by: Brian King > Signed-off-by: Matt

Re: [PATCH v6 30/37] cxlflash: Fix to avoid corrupting adapter fops

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:15, Matthew R. Ochs wrote: > The fops owned by the adapter can be corrupted in certain scenarios, > opening a window where certain fops are temporarily NULLed before being > reset to their proper value. This can potentially lead software to make > incorrect decisions, leaving the u

Re: [PATCH v6 29/37] cxlflash: Fix to double the delay each time

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:15, Matthew R. Ochs wrote: > From: Manoj Kumar > > The operator used to double the master context response delay > is incorrect and does not result in delay doubling. > > To fix, use a left shift instead of the XOR operator. > > Reported-by: Tomas Henzl > Signed-off-by: Matthew R

Re: [PATCH v6 27/37] cxlflash: Fix to prevent stale AFU RRQ

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:15, Matthew R. Ochs wrote: > Following an adapter reset, the AFU RRQ that resides in host memory > holds stale data. This can lead to a condition where the RRQ interrupt > handler tries to process stale entries and/or endlessly loops due to an > out of sync generation bit. > > To f

Re: [PATCH v6 26/37] cxlflash: Correct spelling, grammar, and alignment mistakes

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:15, Matthew R. Ochs wrote: > 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 g

Re: [PATCH v6 25/37] cxlflash: Fix to prevent EEH recovery failure

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > 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 will wait to obtain the > context's mutex in order to put the context in an error stat

Re: [PATCH v6 24/37] cxlflash: Fix MMIO and endianness errors

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > 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 driv

Re: [PATCH v6 23/37] cxlflash: Fix function prolog parameters and return codes

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > 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

Re: [PATCH v6 22/37] cxlflash: Remove unnecessary scsi_block_requests

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > 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 > Reviewed-by: Brian King Reviewed-by: Tomas He

Re: [PATCH v6 21/37] cxlflash: Correct behavior in device reset handler following EEH

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > 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

Re: [PATCH v6 20/37] cxlflash: Fix to prevent workq from accessing freed memory

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > 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 an

Re: [PATCH v6 19/37] cxlflash: Correct usage of scsi_host_put()

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > 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 >

Re: [PATCH v6 14/37] cxlflash: Fix location of setting resid

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:13, Matthew R. Ochs wrote: > 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 scen

Re: [PATCH v6 18/37] cxlflash: Fix AFU version access/storage and add check

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > 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. Additional

Re: [PATCH v6 17/37] cxlflash: Remove dual port online dependency

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:13, Matthew R. Ochs wrote: > 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

Re: [PATCH v6 16/37] cxlflash: Fix async interrupt bypass logic

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:13, Matthew R. Ochs wrote: > 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

Re: [PATCH v6 15/37] cxlflash: Fix host link up event handling

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:13, Matthew R. Ochs wrote: > 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 sh

Re: [PATCH v6 13/37] cxlflash: Fix to avoid stall while waiting on TMF

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:13, Matthew R. Ochs wrote: > 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 completio

Re: [PATCH v6 12/37] cxlflash: Fix to avoid spamming the kernel log

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:13, Matthew R. Ochs wrote: > 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. Lastly,

Re: [PATCH v6 11/37] cxlflash: Refine host/device attributes

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:12, Matthew R. Ochs wrote: > 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 > > Suggested-by: Shane Seymour > Signed-off-by: Matthew

Re: Time to remove platforms/cell?

2015-10-23 Thread Marc Dietrich
Am Freitag, 23. Oktober 2015, 12:54:56 schrieb Michael Ellerman: > On Thu, 2015-10-22 at 12:15 -0700, Geoff Levand wrote: > > Hi, > > > > On Fri, 2015-10-09 at 23:13 +0200, Marc Dietrich wrote: > > > Am Freitag, 9. Oktober 2015, 10:45:42 schrieb Geoff Levand: > > > > With the 4.2-rc4 kernel, kexec

RE: [PATCH v12 6/6] QE: Move QE from arch/powerpc to drivers/soc

2015-10-23 Thread Zhao Qiang
On Fri, Oct 23, 2015 at 11:20 AM, Wood Scott-B07421 wrote: > -Original Message- > From: Wood Scott-B07421 > Sent: Friday, October 23, 2015 11:20 AM > To: Zhao Qiang-B45475 > Cc: linux-ker...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; > lau...@codeaurora.org; Xie Xiaobo-R63061 ; > b.

RE: [PATCH v12 4/6] QE/CPM: move muram management functions to qe_common

2015-10-23 Thread Zhao Qiang
On Fri, 2015-10-23 at 11:10 AM, Wood Scott-B07421 wrote: > -Original Message- > From: Wood Scott-B07421 > Sent: Friday, October 23, 2015 11:10 AM > To: Zhao Qiang-B45475 > Cc: linux-ker...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; > lau...@codeaurora.org; Xie Xiaobo-R63061 ; > b...