[PATCH v8 4/4] perf,kvm/powerpc: Add support for HCALL reasons

2015-09-24 Thread Hemant Kumar
Powerpc provides hcall events that also provides insights into guest behaviour. Enhance perf kvm stat to record and analyze hcall events. - To trace hcall events : perf kvm stat record - To show the results : perf kvm stat report --event=hcall The result shows the number of hypervisor call

[PATCH v8 3/4] perf,kvm/powerpc: Port perf kvm stat to powerpc

2015-09-24 Thread Hemant Kumar
perf kvm can be used to analyze guest exit reasons. This support already exists in x86. Hence, porting it to powerpc. - To trace KVM events : perf kvm stat record If many guests are running, we can track for a specific guest by using --pid as in : perf kvm stat record --pid - To see the

[PATCH v8 1/4] perf, kvm/{x86, s390}: Remove dependency on uapi/kvm_perf.h

2015-09-24 Thread Hemant Kumar
Its better to remove the dependency on uapi/kvm_perf.h to allow dynamic discovery of kvm events (if its needed). To do this, some extern variables have been introduced with which we can keep the generic functions generic. Signed-off-by: Hemant Kumar --- Changes since v7: - Removed __maybe_unused

[PATCH v8 2/4] perf,kvm/{x86,s390}: Remove const from kvm_events_tp

2015-09-24 Thread Hemant Kumar
This patch removes the "const" qualifier from kvm_events_tp declaration to account for the fact that powerpc will need to update this variable dynamically depending on the machine type. Signed-off-by: Hemant Kumar --- tools/perf/arch/s390/util/kvm-stat.c | 2 +- tools/perf/arch/x86/util/kvm-stat

Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes

2015-09-24 Thread David Miller
From: Florian Fainelli Date: Thu, 24 Sep 2015 18:39:56 -0700 > On 24/09/15 12:17, Russell King - ARM Linux wrote: >> Hi, >> >> The third version of this series fixes the build error which David >> identified, and drops the broken changes for the Cavium Thunger BGX >> ethernet driver as this driv

RE: [PATCH v10 3/5] CPM/QE: use genalloc to manage CPM/QE muram

2015-09-24 Thread Zhao Qiang
On Fri, Sep 25, 2015 at 1:08 PM +0800, Wood Scott-B07421 wrote: > -Original Message- > From: Wood Scott-B07421 > Sent: Friday, September 25, 2015 1:08 PM > To: Zhao Qiang-B45475 > Cc: linux-ker...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; > lau...@codeaurora.org; Xie Xiaobo-R63061; b

Re: [PATCH V3] thermal: qoriq: Add thermal management support

2015-09-24 Thread Scott Wood
On Thu, 2015-09-24 at 22:09 -0500, Jia Hongtao-B38951 wrote: > > -Original Message- > > From: Wood Scott-B07421 > > Sent: Friday, September 25, 2015 6:10 AM > > To: Jia Hongtao-B38951 > > Cc: edubez...@gmail.com; linux...@vger.kernel.org; linuxppc- > > d...@lists.ozlabs.org > > Subject: Re:

Re: [PATCH v10 3/5] CPM/QE: use genalloc to manage CPM/QE muram

2015-09-24 Thread Scott Wood
On Thu, 2015-09-24 at 21:50 -0500, Zhao Qiang-B45475 wrote: > On Fri, Sep 25, 2015 at 7:30 AM +0800, Wood Scott-B07421 wrote: > > -Original Message- > > From: Wood Scott-B07421 > > Sent: Friday, September 25, 2015 7:30 AM > > To: Zhao Qiang-B45475 > > Cc: linux-ker...@vger.kernel.org; linux

[PATCH v2 2/2] powerpc/vdso: Avoid link stack corruption in __get_datapage()

2015-09-24 Thread Michael Neuling
powerpc has a link register (lr) used for calling functions. We "bl " to call a function, and "blr" to return back to the call site. The lr is only a single register, so if we call another function from inside this function (ie. nested calls), software must save away the lr on the software stack b

[PATCH v2 1/2] powerpc/selftest: Add gettimeofday() benchmark

2015-09-24 Thread Michael Neuling
This adds a benchmark directory to the powerpc selftests and adds a gettimeofday() benchmark to it. Suggested-by: Michael Ellerman Signed-off-by: Michael Neuling --- tools/testing/selftests/powerpc/Makefile | 2 +- .../testing/selftests/powerpc/benchmarks/Makefile | 12 + ..

[PATCH v2 0/2] powerpc: powerpc/vdso: Avoid link stack corruption in __get_datapage()

2015-09-24 Thread Michael Neuling
This patch fixes a link stack corruption issue in the VDOS get_datapage() code and adds a benchmark to test it in future. v2: - Split benchmark out of commit message and put in selftests. - Upgrade commit message to essay. ___ Linuxppc-dev mailing l

RE: [PATCH V3] thermal: qoriq: Add thermal management support

2015-09-24 Thread Hongtao Jia
> -Original Message- > From: Wood Scott-B07421 > Sent: Friday, September 25, 2015 6:10 AM > To: Jia Hongtao-B38951 > Cc: edubez...@gmail.com; linux...@vger.kernel.org; linuxppc- > d...@lists.ozlabs.org > Subject: Re: [PATCH V3] thermal: qoriq: Add thermal management support > > On Wed, 20

RE: [PATCH v10 3/5] CPM/QE: use genalloc to manage CPM/QE muram

2015-09-24 Thread Zhao Qiang
On Fri, Sep 25, 2015 at 7:30 AM +0800, Wood Scott-B07421 wrote: > -Original Message- > From: Wood Scott-B07421 > Sent: Friday, September 25, 2015 7:30 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 v3 1/2] fsl: Add binding for RCPM

2015-09-24 Thread Wang Dongsheng
> On Thu, 2015-09-24 at 21:38 -0500, Wang Dongsheng-B40534 wrote: > > > > +* Freescale RCPM Wakeup Source Device Tree Bindings > > > > +--- > > > > +Required rcpm-wakeup property should be added to a device node if the > > > > device > > > > +can be used as a

Re: [PATCH v3 1/2] fsl: Add binding for RCPM

2015-09-24 Thread Scott Wood
On Thu, 2015-09-24 at 21:38 -0500, Wang Dongsheng-B40534 wrote: > > > +* Freescale RCPM Wakeup Source Device Tree Bindings > > > +--- > > > +Required rcpm-wakeup property should be added to a device node if the > > > device > > > +can be used as a wakeup sour

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

2015-09-24 Thread Wang Dongsheng
> > +* Freescale RCPM Wakeup Source Device Tree Bindings > > +--- > > +Required rcpm-wakeup property should be added to a device node if the > > device > > +can be used as a wakeup source. > > + > > + - rcpm-wakeup: The value of the property consists of cell

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

2015-09-24 Thread Wang Dongsheng
Hi Shawn, Thanks for your review. > > From: Wang Dongsheng > > > > RCPM is the Run Control and Power Management module performs all > > device-level tasks associated with device run control and power > > management. > > > > Add this for freescale powerpc platform and layerscape platform. > > > >

[PATCH] powerpc/ps3: Remove unused os_area_db_id_video_mode

2015-09-24 Thread Michael Ellerman
This struct is unused, which is now a build error with gcc 6: error: 'os_area_db_id_video_mode' defined but not used There doesn't seem to be any good reason to keep it around so remove it, it's in the history if anyone needs it. Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/ps3

Re: cxl: Fix lockdep warning while creating afu_err_buff attribute

2015-09-24 Thread Michael Ellerman
On Wed, 2015-23-09 at 03:07:59 UTC, Vaibhav Jain wrote: > Presently a lockdep warning is reported during creation of afu_err_buff > bin_attribute for the afu. This is caused due to the variable attr.key > not pointing to a static class key, hence the function lockdep_init_map > reports this warning

Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes

2015-09-24 Thread Florian Fainelli
On 24/09/15 12:17, Russell King - ARM Linux wrote: > Hi, > > The third version of this series fixes the build error which David > identified, and drops the broken changes for the Cavium Thunger BGX > ethernet driver as this driver requires some complex changes to > resolve the leakage - and this i

Re: [PATCH v3 11/32] cxlflash: Refine host/device attributes

2015-09-24 Thread Brian King
Reviewed-by: Brian King -- Brian King Power Linux I/O IBM Linux Technology Center ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 08/32] cxlflash: Fix to avoid CXL services during EEH

2015-09-24 Thread Brian King
On 09/24/2015 02:38 PM, Matthew R. Ochs wrote: > diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c > index 3e3ccf1..6e85c77 100644 > --- a/drivers/scsi/cxlflash/main.c > +++ b/drivers/scsi/cxlflash/main.c > @@ -2383,16 +2397,14 @@ static pci_ers_result_t > cxlflash_pci_error

Re: [PATCH v3 04/32] cxlflash: Fix potential oops following LUN removal

2015-09-24 Thread Brian King
Reviewed-by: Brian King -- Brian King Power Linux I/O IBM Linux Technology Center ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 29/32] MAINTAINERS: Add cxlflash driver

2015-09-24 Thread Andrew Donnellan
On 25/09/15 05:44, Matthew R. Ochs wrote: Add stanza for cxlflash SCSI driver. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King Reviewed-by: Andrew Donnellan --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/

Re: [PATCH v3 1/3] powerpc/512x: add LocalPlus Bus FIFO device driver

2015-09-24 Thread Timur Tabi
Alexander Popov wrote: +struct mpc512x_lpbfifo_request { + phys_addr_t bus_phys; /* physical address of some device on LPB */ Is this a phys_addr_t or a dma_addr_t? It can't be both a physical address and a bus address. + void *ram_virt; /* virtual address of some reg

Re: [PATCH 1/1] powerpc: Individual System V IPC system calls

2015-09-24 Thread Sam Bobroff
On Fri, Sep 25, 2015 at 10:33:37AM +1000, Michael Ellerman wrote: > On Thu, 2015-09-24 at 15:39 +1000, Sam Bobroff wrote: > > This patch provides individual system call numbers for the following > > System V IPC system calls, on PowerPC, so that they do not need to be > > multiplexed: > > * semop,

Re: [PATCH 1/1] powerpc: Individual System V IPC system calls

2015-09-24 Thread Michael Ellerman
On Thu, 2015-09-24 at 15:39 +1000, Sam Bobroff wrote: > This patch provides individual system call numbers for the following > System V IPC system calls, on PowerPC, so that they do not need to be > multiplexed: > * semop, semget, semctl, semtimedop > * msgsnd, msgrcv, msgget, msgctl > * shmat, shm

Re: [PATCH v3 2/3] powerpc/512x: add a device tree binding for LocalPlus Bus FIFO

2015-09-24 Thread Timur Tabi
Alexander Popov wrote: +- dma-names: should be "rx-tx"; Why bother, if it can only be one value? ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 3/3] dmaengine: mpc512x: initialize with subsys_initcall()

2015-09-24 Thread Timur Tabi
Alexander Popov wrote: Initialize Freescale MPC512x DMA driver with subsys_initcall() to allow the depending drivers to call dma_request_slave_channel() during their probe. Signed-off-by: Alexander Popov Is there any way we can use -EPROBEDEFER instead?

Re: [PATCH] powerpc/vdso: Avoid link stack corruption in __get_datapage()

2015-09-24 Thread Michael Ellerman
On Thu, 2015-09-24 at 13:10 +0300, Denis Kirjanov wrote: > On 9/24/15, Michael Ellerman wrote: > > On 23 September 2015 16:05:02 GMT+10:00, Michael Neuling > > wrote: > >> > >>Testcase tb.c (stolen from Anton) > >> /* gcc -O2 tb.c -o tb */ > >> #include > >> #include > >> > >> int main() >

Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes

2015-09-24 Thread Russell King - ARM Linux
On Fri, Sep 25, 2015 at 12:50:33AM +0200, Andrew Lunn wrote: > > Thanks for testing. Please could you confirm whether the same behaviour > > is observed without the patches, just to make absolutely sure that isn't > > a regression. > > So i tested this now. > > I have two FEC interfaces. One i m

Re: [PATCH v10 3/5] CPM/QE: use genalloc to manage CPM/QE muram

2015-09-24 Thread Scott Wood
On Wed, 2015-09-23 at 00:28 -0500, Zhao Qiang-B45475 wrote: > On Wen, Sep 23, 2015 at 12:03 AM +0800, Wood Scott-B07421 wrote: > > > -Original Message- > > From: Wood Scott-B07421 > > Sent: Wednesday, September 23, 2015 12:03 PM > > To: Zhao Qiang-B45475 > > Cc: linux-ker...@vger.kernel.or

Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes

2015-09-24 Thread Russell King - ARM Linux
On Thu, Sep 24, 2015 at 03:51:37PM -0700, David Miller wrote: > From: Andrew Lunn > Date: Fri, 25 Sep 2015 00:26:54 +0200 > > > On Thu, Sep 24, 2015 at 03:15:54PM -0700, David Miller wrote: > >> From: Andrew Lunn > >> Date: Thu, 24 Sep 2015 23:57:31 +0200 > >> > >> > I built the FEC driver as a

Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes

2015-09-24 Thread Andrew Lunn
> Thanks for testing. Please could you confirm whether the same behaviour > is observed without the patches, just to make absolutely sure that isn't > a regression. So i tested this now. I have two FEC interfaces. One i my main access interface, and the second is used by DSA to access switches.

Re: [PATCH 15/19] KVM: PPC: e500: fix handling local_sid_lookup result

2015-09-24 Thread Scott Wood
On Thu, 2015-09-24 at 16:00 +0200, Andrzej Hajda wrote: > The function can return negative value. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. > > [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 > > Sig

Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes

2015-09-24 Thread David Miller
From: Andrew Lunn Date: Fri, 25 Sep 2015 00:26:54 +0200 > On Thu, Sep 24, 2015 at 03:15:54PM -0700, David Miller wrote: >> From: Andrew Lunn >> Date: Thu, 24 Sep 2015 23:57:31 +0200 >> >> > I built the FEC driver as a module, and it won't unload: >> > >> > kernel:unregister_netdevice: waiting

Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes

2015-09-24 Thread Andrew Lunn
On Thu, Sep 24, 2015 at 03:15:54PM -0700, David Miller wrote: > From: Andrew Lunn > Date: Thu, 24 Sep 2015 23:57:31 +0200 > > > I built the FEC driver as a module, and it won't unload: > > > > kernel:unregister_netdevice: waiting for eth1 to become free. Usage count > > = 1 > > unregister_netd

Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes

2015-09-24 Thread Andrew Lunn
... > While looking at the DSA code, I noticed we have a > of_find_net_device_by_node(), and it looks like users of that are > similarly buggy - it looks like net/dsa/dsa.c is the only user. Fix > that too. ... > The mdiobus code also suffered from the same kind of leak, but thankfully > this

Re: [PATCH RESEND v3 5/9] of_mdio: fix MDIO phy device refcounting

2015-09-24 Thread Rob Herring
On Thu, Sep 24, 2015 at 2:36 PM, Russell King wrote: > bus_find_device() is defined as: > > * This is similar to the bus_for_each_dev() function above, but it > * returns a reference to a device that is 'found' for later use, as > * determined by the @match callback. > > and it does indeed retu

Re: [PATCH] powerpc/e6500: add TMCFG0 register definition

2015-09-24 Thread Scott Wood
On Wed, 2015-09-23 at 18:06 +0300, Laurentiu Tudor wrote: > The register is not currently used in the base kernel > but will be in a forthcoming kvm patch. > > Signed-off-by: Laurentiu Tudor > --- > arch/powerpc/include/asm/reg_booke.h | 6 ++ > 1 file changed, 6 insertions(+) Acked-by: Sco

Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes

2015-09-24 Thread Russell King - ARM Linux
On Thu, Sep 24, 2015 at 11:57:31PM +0200, Andrew Lunn wrote: > Hi Russell > > I tested both of these with my board. It is a Freescale Vybrid, using > the FEC ethernet driver, and i have three switches attached, using > mdio-mux to give three mdio busses. > > No obvious regressions, my board boots

Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes

2015-09-24 Thread David Miller
From: Andrew Lunn Date: Thu, 24 Sep 2015 23:57:31 +0200 > I built the FEC driver as a module, and it won't unload: > > kernel:unregister_netdevice: waiting for eth1 to become free. Usage count = 1 > unregister_netdevice: waiting for eth1 to become free. Usage count = 1 > > i assume because DSA

Re: [PATCH V3] thermal: qoriq: Add thermal management support

2015-09-24 Thread Scott Wood
On Wed, 2015-09-23 at 16:28 +0800, Jia Hongtao wrote: > This driver add thermal management support by enabling TMU (Thermal > Monitoring Unit) on QorIQ platform. > > It's based on thermal of framework: > - Trip points defined in device tree. > - Cpufreq as cooling device registered in qoriq cpufre

Re: [PATCH v2 08/25] powerpc/8xx: Map IMMR area with 512k page at a fixed address

2015-09-24 Thread Scott Wood
On Thu, 2015-09-24 at 11:41 +, David Laight wrote: > From: Christophe Leroy > > Sent: 22 September 2015 17:51 > ... > > Traditionaly, each driver manages one computer board which has its > > own components with its own memory maps. > > But on embedded chips like the MPC8xx, the SOC has all regi

Re: [PATCH v3 11/32] cxlflash: Refine host/device attributes

2015-09-24 Thread Matthew R. Ochs
Somehow the Suggested-by tag was dropped from this one. Adding it back. -matt > On Sep 24, 2015, at 2:39 PM, 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() > -

[PATCH v3 32/32] cxlflash: Correct trace string

2015-09-24 Thread Matthew R. Ochs
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: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers

[PATCH v3 31/32] cxlflash: Fix to avoid corrupting adapter fops

2015-09-24 Thread Matthew R. Ochs
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 user with the inability to function as intended. An

[PATCH v3 30/32] cxlflash: Fix to double the delay each time

2015-09-24 Thread Matthew R. Ochs
From: Manoj Kumar The operator used to double the 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. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 2 +- 1

[PATCH v3 29/32] MAINTAINERS: Add cxlflash driver

2015-09-24 Thread Matthew R. Ochs
Add stanza for cxlflash SCSI driver. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 274f854..f2f3046 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@

[PATCH v3 28/32] cxlflash: Fix to avoid state change collision

2015-09-24 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: Ma

[PATCH v3 27/32] cxlflash: Fix to prevent stale AFU RRQ

2015-09-24 Thread Matthew R. Ochs
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 fix, the AFU RRQ in host memory needs to be cleared afte

[PATCH v3 26/32] cxlflash: Correct spelling, grammar, and alignment mistakes

2015-09-24 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 con

[PATCH v3 25/32] cxlflash: Fix to prevent EEH recovery failure

2015-09-24 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 conte

[PATCH v3 24/32] cxlflash: Fix MMIO and endianness errors

2015-09-24 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 Signe

[PATCH v3 23/32] cxlflash: Fix function prolog parameters and return codes

2015-09-24 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. O

[PATCH v3 22/32] cxlflash: Remove unnecessary scsi_block_requests

2015-09-24 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/main.c | 2 -- 1 file changed, 2 deletions(-) dif

[PATCH v3 21/32] cxlflash: Correct behavior in device reset handler following EEH

2015-09-24 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 the

[PATCH v3 20/32] cxlflash: Fix to prevent workq from accessing freed memory

2015-09-24 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 t

[PATCH v3 19/32] cxlflash: Correct usage of scsi_host_put()

2015-09-24 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 remo

[PATCH RESEND v3 9/9] net: fix net_device refcounting

2015-09-24 Thread Russell King
of_find_net_device_by_node() uses class_find_device() internally to lookup the corresponding network device. class_find_device() returns a reference to the embedded struct device, with its refcount incremented. Add a comment to the definition in net/core/net-sysfs.c indicating the need to drop th

[PATCH v3 18/32] cxlflash: Fix AFU version access/storage and add check

2015-09-24 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 k

[PATCH v3 17/32] cxlflash: Remove dual port online dependency

2015-09-24 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 v3 16/32] cxlflash: Fix async interrupt bypass logic

2015-09-24 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: Matthew

[PATCH v3 15/32] cxlflash: Fix host link up event handling

2015-09-24 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. Signed-off-by

[PATCH v3 14/32] cxlflash: Fix location of setting resid

2015-09-24 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 Signed-off-by

[PATCH v3 13/32] cxlflash: Fix to avoid stall while waiting on TMF

2015-09-24 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 t

[PATCH v3 12/32] cxlflash: Fix to avoid spamming the kernel log

2015-09-24 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 v3 10/32] cxlflash: Make functions static

2015-09-24 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 v3 11/32] cxlflash: Refine host/device attributes

2015-09-24 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 --- drivers/scsi/cxlflash/main.c | 180 ++

[PATCH v3 02/32] cxlflash: Replace magic numbers with literals

2015-09-24 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 Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King

[PATCH v3 09/32] cxlflash: Correct naming of limbo state and waitq

2015-09-24 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. Kumar Reviewed-by: Brian King

[PATCH v3 08/32] cxlflash: Fix to avoid CXL services during EEH

2015-09-24 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 po

[PATCH v3 07/32] cxlflash: Fix context encode mask width

2015-09-24 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/superpipe.h | 2 +- 1 file changed, 1 i

[PATCH v3 06/32] cxlflash: Fix to avoid sizeof(bool)

2015-09-24 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/superpipe.c | 2 +- drivers/scsi/cxlflash/superpi

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

2015-09-24 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 v3 04/32] cxlflash: Fix potential oops following LUN removal

2015-09-24 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 res

[PATCH v3 03/32] cxlflash: Fix read capacity timeout

2015-09-24 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 sd.c) and rework the ti

[PATCH v3 01/32] cxlflash: Fix to avoid invalid port_sel value

2015-09-24 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 find_and_create_lun(), the value o

[PATCH RESEND v3 8/9] phy: add phy_device_remove()

2015-09-24 Thread Russell King
Add a phy_device_remove() function to complement phy_device_register(), which undoes the effects of phy_device_register() by removing the phy device from visibility, but not freeing it. This allows these details to be moved out of the mdio bus code into the phy code where this action belongs. Sig

[PATCH RESEND v3 7/9] phy: fixed-phy: properly validate phy in fixed_phy_update_state()

2015-09-24 Thread Russell King
Validate that the phy_device passed into fixed_phy_update_state() is a fixed-phy device before walking the list of phys for a fixed phy at the same address. Signed-off-by: Russell King --- drivers/net/phy/fixed_phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net

[PATCH RESEND v3 6/9] net: fix phy refcounting in a bunch of drivers

2015-09-24 Thread Russell King
of_phy_find_device() increments the phy struct device refcount, which we need to properly balance. Add code to network drivers using this function to ensure that the struct device refcount is correctly balanced. For xgene, looking back in the history, we should be able to use of_phy_connect() wit

[PATCH RESEND v3 5/9] of_mdio: fix MDIO phy device refcounting

2015-09-24 Thread Russell King
bus_find_device() is defined as: * This is similar to the bus_for_each_dev() function above, but it * returns a reference to a device that is 'found' for later use, as * determined by the @match callback. and it does indeed return a reference-counted pointer to the device: while ((dev

[PATCH RESEND v3 4/9] phy: add proper phy struct device refcounting

2015-09-24 Thread Russell King
Take a refcount on the phy struct device when the phy device is attached to a network device, and drop it after it's detached. This ensures that a refcount is held on the phy device while the device is being used by a network device, thereby preventing the phy_device from being unexpectedly kfree(

[PATCH RESEND v3 3/9] phy: fix mdiobus module safety

2015-09-24 Thread Russell King
Re-implement the mdiobus module refcounting to ensure that we actually ensure that the mdiobus module code does not go away while we might call into it. The old scheme using bus->dev.driver was buggy, because bus->dev is a class device which never has a struct device_driver associated with it, and

[PATCH RESEND v3 2/9] net: dsa: fix of_mdio_find_bus() device refcount leak

2015-09-24 Thread Russell King
Current users of of_mdio_find_bus() leak a struct device refcount, as they fail to clean up the reference obtained inside class_find_device(). Fix the DSA code to properly refcount the returned MDIO bus by: 1. taking a reference on the struct device whenever we assign it to pd->chip[x].host_dev

[PATCH RESEND v3 1/9] phy: fix of_mdio_find_bus() device refcount leak

2015-09-24 Thread Russell King
of_mdio_find_bus() leaks a struct device refcount, caused by using class_find_device() and not realising that the device reference has its refcount incremented: * Note, you will need to drop the reference with put_device() after use. ... while ((dev = class_dev_iter_next(&iter))) {

[PATCH v3 00/32] cxlflash: Miscellaneous bug fixes and corrections

2015-09-24 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 altered

Re: [PATCH v3 1/2] fsl: Add binding for RCPM

2015-09-24 Thread Scott Wood
On Thu, 2015-09-24 at 16:29 +0800, Dongsheng Wang wrote: > +* Freescale RCPM Wakeup Source Device Tree Bindings > +--- > +Required rcpm-wakeup property should be added to a device node if the > device > +can be used as a wakeup source. > + > + - rcpm-wakeup

[PATCH 6/9] net: fix phy refcounting in a bunch of drivers

2015-09-24 Thread Russell King
of_phy_find_device() increments the phy struct device refcount, which we need to properly balance. Add code to network drivers using this function to ensure that the struct device refcount is correctly balanced. For xgene, looking back in the history, we should be able to use of_phy_connect() wit

[PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes

2015-09-24 Thread Russell King - ARM Linux
Hi, The third version of this series fixes the build error which David identified, and drops the broken changes for the Cavium Thunger BGX ethernet driver as this driver requires some complex changes to resolve the leakage - and this is best done by people who can test the driver. Compared to v2,

[PATCH 4/4] perf,kvm/powerpc: Add support for HCALL reasons

2015-09-24 Thread Hemant Kumar
Powerpc provides hcall events that also provides insights into guest behaviour. Enhance perf kvm stat to record and analyze hcall events. - To trace hcall events : perf kvm stat record - To show the results : perf kvm stat report --event=hcall The result shows the number of hypervisor call

[PATCH v7 3/4] perf,kvm/powerpc: Port perf kvm stat to powerpc

2015-09-24 Thread Hemant Kumar
perf kvm can be used to analyze guest exit reasons. This support already exists in x86. Hence, porting it to powerpc. - To trace KVM events : perf kvm stat record If many guests are running, we can track for a specific guest by using --pid as in : perf kvm stat record --pid - To see the

[PATCH v7 2/4] perf,kvm/{x86,s390}: Remove const from kvm_events_tp

2015-09-24 Thread Hemant Kumar
This patch removes the "const" qualifier from kvm_events_tp declaration to account for the fact that powerpc will need to update this variable dynamically depending on the machine type. Signed-off-by: Hemant Kumar --- tools/perf/arch/s390/util/kvm-stat.c | 2 +- tools/perf/arch/x86/util/kvm-stat

[PATCH v7 1/4] perf, kvm/{x86, s390}: Remove dependency on uapi/kvm_perf.h

2015-09-24 Thread Hemant Kumar
Its better to remove the dependency on uapi/kvm_perf.h to allow dynamic discovery of kvm events (if its needed). To do this, some extern variables have been introduced with which we can keep the generic functions generic. Signed-off-by: Hemant Kumar --- tools/perf/arch/s390/util/kvm-stat.c | 10

[PATCH] perf: Fix build break on powerpc due to sample_reg_masks

2015-09-24 Thread Sukadev Bhattiprolu
From d1171a4c34c6100ec8b663ddb803dd69ef3fb7ce Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu Date: Thu, 24 Sep 2015 17:53:49 -0400 Subject: [PATCH] perf: Fix build break on powerpc due to sample_reg_masks perf_regs.c does not get built on Powerpc as CONFIG_PERF_REGS is false. So the weak def

[PATCH v3 3/3] dmaengine: mpc512x: initialize with subsys_initcall()

2015-09-24 Thread Alexander Popov
Initialize Freescale MPC512x DMA driver with subsys_initcall() to allow the depending drivers to call dma_request_slave_channel() during their probe. Signed-off-by: Alexander Popov --- drivers/dma/mpc512x_dma.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/driv

[PATCH v3 2/3] powerpc/512x: add a device tree binding for LocalPlus Bus FIFO

2015-09-24 Thread Alexander Popov
Add a device tree binding for Freescale MPC512x LocalPlus Bus FIFO and introduce the document describing that binding. Signed-off-by: Alexander Popov --- .../bindings/powerpc/fsl/mpc512x_lpbfifo.txt| 21 + arch/powerpc/boot/dts/mpc5121.dtsi | 11 +

[PATCH v3 1/3] powerpc/512x: add LocalPlus Bus FIFO device driver

2015-09-24 Thread Alexander Popov
This driver for Freescale MPC512x LocalPlus Bus FIFO (called SCLPC in the Reference Manual) allows Direct Memory Access transfers between RAM and peripheral devices on LocalPlus Bus. Signed-off-by: Alexander Popov --- arch/powerpc/configs/mpc512x_defconfig| 1 + arch/powerpc/include/as

[PATCH v3 0/3] powerpc/512x: add LocalPlus Bus FIFO device driver

2015-09-24 Thread Alexander Popov
This driver for Freescale MPC512x LocalPlus Bus FIFO (called SCLPC in the Reference Manual) allows Direct Memory Access transfers between RAM and peripheral devices on LocalPlus Bus. Changes in v3: - resource usage in probe() is fixed; - driver methods are made safe against remove(); - dma_requ

Re: [PATCH v2 0/9] Phy, mdiobus, and netdev struct device fixes

2015-09-24 Thread Russell King - ARM Linux
On Wed, Sep 23, 2015 at 04:24:17PM -0700, David Miller wrote: > From: Russell King - ARM Linux > Date: Tue, 22 Sep 2015 17:17:10 +0100 > > > This is the second version of the series, with the comments David had > > on the first patch fixed up. Original series description with updated > > diffsta

  1   2   >