[PATCH] rtc/tpo: Driver to support rtc and wakeup on PowerNV platform

2014-09-09 Thread Neelesh Gupta
'+ 3 minutes'` /sys/class/rtc/rtc0/wakealarm [root@tul169p1 linus]# cat /sys/class/rtc/rtc0/wakealarm 1409214402 [root@tul169p1 linus]# FSP: $ smgr mfgState standby $ rtim timeofday System time is valid: 2014/08/28 08:25:16.128924 $ smgr mfgState ipling $ Signed-off-by: Neelesh Gupta neele

Re: [PATCH] powerpc, powernv: Add OPAL platform event driver

2014-09-29 Thread Neelesh Gupta
will be called after the threshold and shutdown the system explicitly. Signed-off-by: Anshuman Khandual khand...@linux.vnet.ibm.com Reviewed-by: Neelesh Gupta neele...@linux.vnet.ibm.com - Neelesh --- arch/powerpc/include/asm/opal.h| 45 +- .../include/uapi/asm

[PATCH v2] rtc/tpo: Driver to support rtc and wakeup on PowerNV platform

2014-09-30 Thread Neelesh Gupta
/wakealarm [root@tul163p1 ~]# cat /sys/class/rtc/rtc0/wakealarm 1412071532 [root@tul163p1 ~]# FSP: $ smgr mfgState standby $ smgr mfgState ipling $ Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com --- Changes in v2 = - Added Documentation/devicetree/bindings/rtc/rtc-opal.txt

Re: [PATCH v2] rtc/tpo: Driver to support rtc and wakeup on PowerNV platform

2014-10-05 Thread Neelesh Gupta
On 09/30/2014 03:46 PM, Neelesh Gupta wrote: The patch implements the OPAL rtc driver that binds with the rtc driver subsystem. The driver uses the platform device infrastructure to probe the rtc device and register it to rtc class framework. The 'wakeup' is supported depending upon

[PATCH v3] rtc/tpo: Driver to support rtc and wakeup on PowerNV platform

2014-10-14 Thread Neelesh Gupta
[root@tul169p1 ~]# FSP: $ smgr mfgState standby $ rtim timeofday System time is valid: 2014/10/14 08:12:04.225115 $ smgr mfgState ipling $ Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com --- Changes in v3 = - Rebased to the latest tree. Changes in v2

Re: [PATCH v3] rtc/tpo: Driver to support rtc and wakeup on PowerNV platform

2014-10-22 Thread Neelesh Gupta
On 10/14/2014 02:08 PM, Neelesh Gupta wrote: The patch implements the OPAL rtc driver that binds with the rtc driver subsystem. The driver uses the platform device infrastructure to probe the rtc device and register it to rtc class framework. The 'wakeup' is supported depending upon

[PATCH] i2c: Driver to expose PowerNV platform i2c busses

2014-11-09 Thread Neelesh Gupta
-by: Neelesh Gupta neele...@linux.vnet.ibm.com Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/include/asm/opal.h| 21 ++ arch/powerpc/platforms/powernv/opal-wrappers.S |1 arch/powerpc/platforms/powernv/opal.c | 48 +++- drivers/i2c

Re: [PATCH] i2c: Driver to expose PowerNV platform i2c busses

2014-11-13 Thread Neelesh Gupta
On 11/13/2014 06:10 PM, Benjamin Herrenschmidt wrote: On Thu, 2014-11-13 at 21:56 +1100, Benjamin Herrenschmidt wrote: No, there is no timeout, if that fails something went quite wrong, it could almost be a BUG_ON (basically we passed a wrong token or a NULL msg). + } + + rc =

Re: [PATCH] i2c: Driver to expose PowerNV platform i2c busses

2014-11-14 Thread Neelesh Gupta
. Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org Review for the I2C parts: diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile index 78d56c5..350aa86 100644 --- a/drivers/i2c/busses/Makefile +++ b/drivers/i2c

[PATCH v2] i2c: Driver to expose PowerNV platform i2c busses

2014-11-16 Thread Neelesh Gupta
-by: Neelesh Gupta neele...@linux.vnet.ibm.com Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/include/asm/opal.h| 29 ++ arch/powerpc/platforms/powernv/opal-wrappers.S |1 arch/powerpc/platforms/powernv/opal.c | 11 + drivers/i2c/busses

Re: [PATCH v2] i2c: Driver to expose PowerNV platform i2c busses

2014-11-20 Thread Neelesh Gupta
On 11/16/2014 10:47 PM, Neelesh Gupta wrote: The patch exposes the available i2c busses on the PowerNV platform to the kernel and implements the bus driver to support i2c and smbus commands. The driver uses the platform device infrastructure to probe the busses on the platform and registers

[PATCH] powerpc/powernv: Infrastructure to support OPAL async completion

2014-03-06 Thread Neelesh Gupta
. Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/include/asm/opal.h | 12 +- arch/powerpc/platforms/powernv/Makefile |2 arch/powerpc/platforms/powernv/opal-async.c | 203

[PATCH] powerpc/powernv: Enable reading and updating of system parameters

2014-03-06 Thread Neelesh Gupta
This patch enables reading and updating of system parameters through OPAL call. Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/include/asm/opal.h| 14 + arch/powerpc/platforms/powernv

[PATCH 0/2] Enable powernv based platform sensors

2014-03-06 Thread Neelesh Gupta
This patchset contains the enablement code to expose platform sensor data on powernv platform. First patch fetches the sensor data from the firmware and second patch being an hwmon driver, enables the sysfs interfaces. --- Neelesh Gupta (1): powerpc/powernv: Enable fetching of platform

[PATCH 1/2] powerpc/powernv: Enable fetching of platform sensor data

2014-03-06 Thread Neelesh Gupta
This patch enables fetching of various platform sensor data through OPAL and expects a sensor handle from the driver to pass to OPAL. Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/include/asm/opal.h

[PATCH 2/2] powerpc/powernv: hwmon driver for power values, fan rpm and temperature

2014-03-06 Thread Neelesh Gupta
Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- drivers/hwmon/Kconfig |8 + drivers/hwmon/Makefile |1 drivers/hwmon/ibmpowernv.c | 529 3 files changed, 538

[PATCH] powerpc/powernv: hwmon driver for power values, fan rpm and temperature

2014-05-14 Thread Neelesh Gupta
fan7_minin2_fault subsystem fan2_fault fan4_fault fan6_fault fan8_fault in3_fault temp1_input fan2_input fan4_input fan6_input fan8_input in4_fault temp1_max [root@tul163p1 ~]# Signed-off-by: Shivaprasad G Bhat sb...@linux.vnet.ibm.com Signed-off-by: Neelesh Gupta neele

Re: [PATCH] powerpc/powernv: hwmon driver for power values, fan rpm and temperature

2014-05-18 Thread Neelesh Gupta
On 05/14/2014 10:39 PM, Guenter Roeck wrote: On Wed, May 14, 2014 at 11:31:53AM +0530, Neelesh Gupta wrote: This patch adds basic kernel enablement for reading power values, fan speed rpm and temperature values on powernv platforms which will be exported to user space through sysfs interface

[PATCH v2] powerpc/powernv: hwmon driver for power values, fan rpm and temperature

2014-05-19 Thread Neelesh Gupta
fan6_input fan8_input name [root@tul163p1 ~]# Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com --- Changes in v2 = - Generic use of devm_* functions in hwmon like using devm_kzalloc() for dynamic memory request, avoiding the need to explicit free of memory. Adding 'struct

Re: [PATCH v2] powerpc/powernv: hwmon driver for power values, fan rpm and temperature

2014-05-26 Thread Neelesh Gupta
Any updates on the patch. - Neelesh On 05/19/2014 07:56 PM, Neelesh Gupta wrote: This patch adds basic kernel enablement for reading power values, fan speed rpm and temperature values on powernv platforms which will be exported to user space through sysfs interface. Test results

Re: [PATCH v2] powerpc/powernv: hwmon driver for power values, fan rpm and temperature

2014-05-30 Thread Neelesh Gupta
On 05/28/2014 01:11 PM, Benjamin Herrenschmidt wrote: On Wed, 2014-05-28 at 00:23 -0700, Guenter Roeck wrote: Consider using of_property_read_u32(). + sdata[count].id = *sensor_id; + sdata[count].type = type; Especially since this is broken for Little Endian !

Re: [PATCH v2] powerpc/powernv: hwmon driver for power values, fan rpm and temperature

2014-06-09 Thread Neelesh Gupta
On 05/28/2014 12:53 PM, Guenter Roeck wrote: On 05/19/2014 07:26 AM, Neelesh Gupta wrote: This patch adds basic kernel enablement for reading power values, fan speed rpm and temperature values on powernv platforms which will be exported to user space through sysfs interface. Test results

[PATCH v3] powerpc/powernv: hwmon driver for power, fan rpm, voltage and temperature

2014-06-18 Thread Neelesh Gupta
in1_fault temp1_max fan11_minfan2_input fan5_fault fan7_minin2_fault uevent fan12_fault fan2_min fan5_input fan8_fault in3_fault [root@ltctul57a-p1 ~]# Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com --- Changes in V3 = - Fixed an endianness bug leading the driver

Re: [PATCH v2] powerpc/powernv: hwmon driver for power values, fan rpm and temperature

2014-06-18 Thread Neelesh Gupta
+} + +static void __init get_sensor_index_attr(const char *name, u32 *index, char *attr) +{ +char *hash_pos = strchr(name, '#'); +char *dash_pos; +u32 copy_len; +char buf[8]; + +memset(buf, 0, sizeof(buf)); +*index = 0; +*attr = '\0'; + +if (hash_pos) { +

[PATCH v4] powerpc/powernv: hwmon driver for power, fan rpm, voltage and temperature

2014-07-04 Thread Neelesh Gupta
fan5_input fan7_input in2_fault subsystem fan1_minfan3_minfan5_minfan7_minin3_fault temp1_input fan2_fault fan4_fault fan6_fault fan8_fault in4_fault temp1_max fan2_input fan4_input fan6_input fan8_input name uevent [root@tul163p1 ~]# Signed-off-by: Neelesh Gupta neele

[PATCH v5] powerpc/powernv: hwmon driver for power, fan rpm, voltage and temperature

2014-07-08 Thread Neelesh Gupta
in2_fault subsystem fan1_minfan3_minfan5_minfan7_minin3_fault temp1_input fan2_fault fan4_fault fan6_fault fan8_fault in4_fault temp1_max fan2_input fan4_input fan6_input fan8_input name uevent [root@tul163p1 ~]# Signed-off-by: Neelesh Gupta neele

[PATCH v3] i2c: Driver to expose PowerNV platform i2c busses

2014-12-07 Thread Neelesh Gupta
-by: Neelesh Gupta neele...@linux.vnet.ibm.com Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- v2 - v3: - Added the device tree binding documentation for the driver. - Sorted the ordering of this new driver added in Makefile. - Removed populating the superfluous .owner field

Re: [v3] i2c: Driver to expose PowerNV platform i2c busses

2014-12-09 Thread Neelesh Gupta
On 12/09/2014 03:15 PM, Michael Ellerman wrote: On Mon, 2014-08-12 at 06:36:16 UTC, Neelesh Gupta wrote: The patch exposes the available i2c busses on the PowerNV platform to the kernel and implements the bus driver to support i2c and smbus commands. The driver uses the platform device

[PATCH v4] i2c: Driver to expose PowerNV platform i2c busses

2014-12-13 Thread Neelesh Gupta
-by: Neelesh Gupta neele...@linux.vnet.ibm.com Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org Acked-by: Wolfram Sang w...@the-dreams.de (I2C part, excluding the bindings) --- v3 - v4: - Rebased to the latest tree. - Exported the opal function 'opal_i2c_request' in opal.c to make

[PATCH 1/2] opal: Fix the overflow of message notifiers head array

2015-02-10 Thread Neelesh Gupta
Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com Reviewed-by: Vasant Hegde hegdevas...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/opal.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc

[PATCH 2/2] opal: Add message notifier unregister function

2015-02-10 Thread Neelesh Gupta
Provide an unregister interface for the opal message notifiers to be called when not needed like during driver unload/remove. Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com Reviewed-by: Vasant Hegde hegdevas...@linux.vnet.ibm.com --- arch/powerpc/include/asm/opal.h |2

Re: [PATCH 2/2] opal: Add message notifier unregister function

2015-02-12 Thread Neelesh Gupta
On 02/11/2015 04:27 PM, Anshuman Khandual wrote: On 02/11/2015 11:57 AM, Neelesh Gupta wrote: Provide an unregister interface for the opal message notifiers to be called when not needed like during driver unload/remove. Why only for unload/remove, you can also use it in cases where you need

[PATCH v2 1/2] opal: Fix the overflow of message notifiers head array

2015-02-10 Thread Neelesh Gupta
Fixes the condition check of incoming message type which can otherwise shoot beyond the message notifiers head array. Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com Reviewed-by: Vasant Hegde hegdevas...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/opal.c | 12 1

[PATCH 2/2] opal: Add message notifier unregister function

2015-02-10 Thread Neelesh Gupta
Provide an unregister interface for the opal message notifiers to be called when not needed like during driver unload/remove. Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com Reviewed-by: Vasant Hegde hegdevas...@linux.vnet.ibm.com --- arch/powerpc/include/asm/opal.h |2

Re: [RFC V2 04/12] i2c: opal: make use of the new infrastructure for quirks

2015-03-10 Thread Neelesh Gupta
I tested the i2c opal driver after updating the patch as below. Basically I think we can also support write-then-{read/write} for the number of messages = 2. Ben, any issues if we support both write plus read/write in the opal driver ? Regards, Neelesh drivers/i2c/busses/i2c-opal.c | 20

Re: [RFC V2 04/12] i2c: opal: make use of the new infrastructure for quirks

2015-03-10 Thread Neelesh Gupta
On 03/11/2015 04:42 AM, Benjamin Herrenschmidt wrote: On Tue, 2015-03-10 at 22:43 +0530, Neelesh Gupta wrote: I tested the i2c opal driver after updating the patch as below. Basically I think we can also support write-then-{read/write} for the number of messages = 2. Ben, any issues if we

Re: [RFC V2 04/12] i2c: opal: make use of the new infrastructure for quirks

2015-03-13 Thread Neelesh Gupta
Hi Wolfram, Based on your patch: [RFC V2 04/12] i2c: opal: make use of the new infrastructure for quirks From: Neelesh Gupta neele...@linux.vnet.ibm.com Subject: [PATCH] i2c: opal: Update quirk flags to do write-then-anything Support write-then-anything in the case of 2 i2c messages for i2c

Re: [PATCH] powerpc/powernv: Silence SYSPARAM warning on boot

2015-05-01 Thread Neelesh Gupta
there is no sysparam node in the device tree. Acked-by: Neelesh Gupta neele...@linux.vnet.ibm.com Signed-off-by: Joel Stanley j...@jms.id.au --- arch/powerpc/platforms/powernv/opal-sysparam.c | 31 +- 1 file changed, 15 insertions(+), 16 deletions

Re: [PATCH] powerpc/powernv: Add poweroff (EPOW, DPO) events support for PowerNV platform

2015-05-02 Thread Neelesh Gupta
On 04/30/2015 11:37 AM, Vipin K Parashar wrote: diff --git a/arch/powerpc/platforms/powernv/opal-poweroff-events.c b/arch/powerpc/platforms/powernv/opal-poweroff-events.c new file mode 100644 index 000..9b169e2 --- /dev/null +++ b/arch/powerpc/platforms/powernv/opal-poweroff-events.c @@

Re: [PATCH V2 1/8] powerpc/powernv: Add a virtual irqchip for opal events

2015-04-30 Thread Neelesh Gupta
Hi Alistair, With all the patches applied on top of 'v4.0-rc7', I see this issue during the boot itself http://pastebin.hursley.ibm.com/918 Few compile warnings and minor comments. drivers/tty/hvc/hvc_opal.c: In function ‘hvc_opal_probe’: drivers/tty/hvc/hvc_opal.c:174:6: warning: unused

Re: [PATCH V2 1/8] powerpc/powernv: Add a virtual irqchip for opal events

2015-04-30 Thread Neelesh Gupta
Hi Alistair, Applied all of the patches on top of 'v4.0-rc7', found this issue during the boot itself http://pastebin.hursley.ibm.com/918. There are few compile warnings and minor comments. drivers/tty/hvc/hvc_opal.c: In function ‘hvc_opal_probe’: drivers/tty/hvc/hvc_opal.c:174:6: warning:

Re: [PATCH] rtc/rtc-opal: Disable rtc-alarms when opal doesn't support tpo

2015-06-03 Thread Neelesh Gupta
opal_rtc_ops.read/set_alarm callback pointers only when tpo is supported. Signed-off-by: Vaibhav Jain vaib...@linux.vnet.ibm.com Acked-by: Neelesh Gupta neele...@linux.vnet.ibm.com Thanks, Neelesh. --- drivers/rtc/rtc-opal.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git

Re: [PATCH V2] drivers/mtd: add powernv flash MTD abstraction driver

2015-05-28 Thread Neelesh Gupta
On 05/28/2015 06:36 PM, Cyril Bur wrote: Powerpc powernv platforms allow access to certain system flash devices through a firmwarwe interface. This change adds an mtd driver for these flash devices. Minor updates from Jeremy Kerr and Joel Stanley. Signed-off-by: Cyril Bur cyril...@gmail.com

Re: [PATCH V3] drivers/mtd: add powernv flash MTD abstraction driver

2015-05-29 Thread Neelesh Gupta
[...] +/** + * @mtd: the device + * @erase: the erase info + * Returns 0 if erase successful or -ERRNO if an error occurred + */ +static int powernv_flash_erase(struct mtd_info *mtd, struct erase_info *erase) +{ + int rc; + + erase-state = MTD_ERASING; + + /* todo: register

Re: [PATCH V2] drivers/mtd: add powernv flash MTD abstraction driver

2015-05-29 Thread Neelesh Gupta
On 05/29/2015 12:57 PM, Cedric Le Goater wrote: Hello, On 05/28/2015 07:25 PM, Neelesh Gupta wrote: On 05/28/2015 06:36 PM, Cyril Bur wrote: + + rc = opal_async_wait_response(token, msg); + opal_async_release_token(token); + if (rc) { + dev_err(dev, opal

Re: [PATCH V3] drivers/mtd: add powernv flash MTD abstraction driver

2015-06-01 Thread Neelesh Gupta
Signed-off-by: Joel Stanley j...@jms.id.au Signed-off-by: Jeremy Kerr j...@ozlabs.org Reviewed-by: Neelesh Gupta neele...@linux.vnet.ibm.com Neelesh. --- Hello Brian and MTD folk, Could I please get an ACK for Michael to take this through the powerpc tree. Thanks. V2: Address Brian Norris

Re: [PATCH] ipmi/powernv: Fix potential invalid pointer dereference

2015-07-29 Thread Neelesh Gupta
...@popple.id.au On Tue, 28 Jul 2015 13:20:07 Neelesh Gupta wrote: On 07/17/2015 02:12 PM, Neelesh Gupta wrote: Hi Corey, On 07/16/2015 08:31 PM, Corey Minyard wrote: Ok, this looks fine. A couple of question... Do I need to send this upstream right now? How well has this been tested? I

Re: [PATCH] ipmi/powernv: Fix potential invalid pointer dereference

2015-07-17 Thread Neelesh Gupta
? Yes, I want this to be be backported to 4.0 stable. Thanks, Neelesh. -corey On 07/16/2015 06:16 AM, Neelesh Gupta wrote: If the OPAL call to receive the ipmi message fails, then we free up the smi message and return. But, the driver still holds the reference to old smi message

[PATCH] ipmi/powernv: Fix potential invalid pointer dereference

2015-07-16 Thread Neelesh Gupta
reset the 'cur_msg' and send reply to the user in addition to freeing the message. Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com --- drivers/char/ipmi/ipmi_powernv.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/char/ipmi/ipmi_powernv.c b

[PATCH] ipmi/powernv: Fix a minor bug

2015-07-08 Thread Neelesh Gupta
, to fix it up, we need to nullify 'cur_msg' in the error case. Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com --- drivers/char/ipmi/ipmi_powernv.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/ipmi/ipmi_powernv.c b/drivers/char/ipmi/ipmi_powernv.c index 9b409c0

Re: ipmi/powernv: Fix a minor bug

2015-07-09 Thread Neelesh Gupta
Hi Michael, On 07/08/2015 04:12 PM, Michael Ellerman wrote: On Wed, 2015-08-07 at 06:27:28 UTC, Neelesh Gupta wrote: If the OPAL call to receive the ipmi message fails, then we free up the smi message before returning. But, the driver still holds the reference to old smi message