All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Laxman Dewangan <ldewangan@nvidia.com>,
	lee.jones@linaro.org, alexandre.belloni@free-electrons.com,
	javier@osg.samsung.com
Cc: cw00.choi@samsung.com, linux-kernel@vger.kernel.org,
	rtc-linux@googlegroups.com
Subject: Re: [PATCH V3 5/5] rtc: max77686: move initialisation of rtc regmap, irq chip locally
Date: Thu, 04 Feb 2016 09:10:30 +0900	[thread overview]
Message-ID: <56B296F6.3060002@samsung.com> (raw)
In-Reply-To: <1454507233-9959-6-git-send-email-ldewangan@nvidia.com>

On 03.02.2016 22:47, Laxman Dewangan wrote:
> To make RTC block of MAX77686/MAX77802 as independent driver,
> move the registration of i2c device, regmap for register access
> and irq_chip for interrupt support inside the RTC driver.
> Removed the same initialisation from MFD driver.
> 
> Having this change will allow to reuse this driver for different
> PMIC/devices from Maxim Semiconductor if they kept same RTC IP on
> different PMIC. Some of examples as PMIC MAX77620, MAX20024 where
> same RTC IP used and hence driver for these chips will use this
> driver only for RTC support.
> 
> Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> CC: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> CC: Javier Martinez Canillas <javier@osg.samsung.com>
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
> 
> ---
> Changes from V1:
> - Remove changes from Kconfig.
> - Maintain all register definition in max77686 private header and remove
>   the movement to rtc driver.
> - Taken care of all comments on V1 from Krzysztof and Javier.
> 
> Changes from V2:
> - Taken care of missed sequence for removing the resource.
> - Fix the crash when doing unbind by using requested_threaded_irq()
>   instead of demv_requested_threaded_irq().
> 
>  drivers/mfd/max77686.c               |  85 +-------------------
>  drivers/rtc/rtc-max77686.c           | 148 ++++++++++++++++++++++++++++++-----
>  include/linux/mfd/max77686-private.h |   3 -
>  3 files changed, 130 insertions(+), 106 deletions(-)
> 

Looks good and works properly (RTC, unbind/rebind, wakealarm again)
but... after applying this patch the device cannot suspend to RAM after
unbind/rebind.

Reproduce path, after booting:
$ echo max77686-rtc > /sys/bus/platform/drivers/max77686-rtc/unbind
$ echo max77686-rtc > /sys/bus/platform/drivers/max77686-rtc/bind
$ rtcwake -d rtc2 -m mem -s 5 -v
(or instead of rtcwake: echo mem > /sys/power/state)

Proper behaviour:
##############################
[   28.549244] PM: late suspend of devices complete after 2.239 msecs
[   28.556051] PM: noirq suspend of devices complete after 2.078 msecs
[   28.560952] Disabling non-boot CPUs ...
[   28.588392] CPU1: shutdown
[   28.623283] CPU2: shutdown
[   28.653242] CPU3: shutdown

Power usage drops. Device wakes up (either from RTC or from manual, e.g.
key press)
##############################


Behaviour with patch 5/5:
[   67.068586] PM: Syncing filesystems ... done.
[   67.121673] Freezing user space processes ... (elapsed 0.004 seconds)
done.
[   67.123457] Freezing remaining freezable tasks ... (elapsed 0.001
seconds) done.
[   67.182024] wake enabled for irq 125
[   67.184315] wake enabled for irq 127
[   67.187829] wake enabled for irq 147
[   67.191238] wake enabled for irq 148
[   67.195178] dwc2 12480000.hsotg: suspending usb gadget g_ether
[   67.200647] dwc2 12480000.hsotg: new device is full-speed
[   67.206036] dwc2 12480000.hsotg: dwc2_hsotg_ep_disable: called for ep0
[   67.212523] dwc2 12480000.hsotg: dwc2_hsotg_ep_disable: called for ep0
[   67.221742] PM: suspend of devices complete after 93.132 msecs
[   67.226113] VALIVE_1.0V_AP: No configuration
[   67.230399] VCC_1.8V_AP: No configuration
[   67.234385] VCC_2.8V_AP: No configuration
[   67.238373] VCC_1.8V_IO: No configuration
[   67.243130] CAM_ISP_MIPI_1.2V: No configuration
[   67.249142] NFC_AVDD_1.8V: No configuration
[   67.252661] CAM_SENSOR_CORE_1.2V: No configuration
[   67.256648] CAM_ISP_SEN_IO_1.8V: No configuration
[   67.261311] VT_CAM_1.8V: No configuration
[   67.265323] VDDQ_PRE_1.8V: No configuration
[   67.269488] VTF_2.8V: No configuration
[   67.273219] VMEM_VDD_2.8V: No configuration
[   67.277386] TSP_AVDD_3.3V: No configuration
[   67.281553] TSP_VDD_1.8V: No configuration
[   67.285615] LCD_VCC_3.3V: No configuration
[   67.289712] MOTOR_VCC_3.0V: No configuration
[   67.296266] VMEM_1.2V_AP: No configuration
[   67.298902] VCC_SUB_1.35V: No configuration
[   67.303064] VCC_SUB_2.0V: No configuration
[   67.307142] VMEM_VDDF_3.0V: No configuration
[   67.311377] CAM_ISP_CORE_1.2V: No configuration
[   67.318181] PM: late suspend of devices complete after 2.267 msecs
[   67.325046] PM: noirq suspend of devices complete after 2.137 msecs
[   67.329857] Disabling non-boot CPUs ...

No CPU shutdown messages. Power usage not decreased, device does not
wake up.

I don't know yet what is the cause... At first glance it looks okay...

Best regards,
Krzysztof

WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Laxman Dewangan <ldewangan@nvidia.com>,
	lee.jones@linaro.org, alexandre.belloni@free-electrons.com,
	javier@osg.samsung.com
Cc: cw00.choi@samsung.com, linux-kernel@vger.kernel.org,
	rtc-linux@googlegroups.com
Subject: [rtc-linux] Re: [PATCH V3 5/5] rtc: max77686: move initialisation of rtc regmap, irq chip locally
Date: Thu, 04 Feb 2016 09:10:30 +0900	[thread overview]
Message-ID: <56B296F6.3060002@samsung.com> (raw)
In-Reply-To: <1454507233-9959-6-git-send-email-ldewangan@nvidia.com>

On 03.02.2016 22:47, Laxman Dewangan wrote:
> To make RTC block of MAX77686/MAX77802 as independent driver,
> move the registration of i2c device, regmap for register access
> and irq_chip for interrupt support inside the RTC driver.
> Removed the same initialisation from MFD driver.
> 
> Having this change will allow to reuse this driver for different
> PMIC/devices from Maxim Semiconductor if they kept same RTC IP on
> different PMIC. Some of examples as PMIC MAX77620, MAX20024 where
> same RTC IP used and hence driver for these chips will use this
> driver only for RTC support.
> 
> Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> CC: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> CC: Javier Martinez Canillas <javier@osg.samsung.com>
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
> 
> ---
> Changes from V1:
> - Remove changes from Kconfig.
> - Maintain all register definition in max77686 private header and remove
>   the movement to rtc driver.
> - Taken care of all comments on V1 from Krzysztof and Javier.
> 
> Changes from V2:
> - Taken care of missed sequence for removing the resource.
> - Fix the crash when doing unbind by using requested_threaded_irq()
>   instead of demv_requested_threaded_irq().
> 
>  drivers/mfd/max77686.c               |  85 +-------------------
>  drivers/rtc/rtc-max77686.c           | 148 ++++++++++++++++++++++++++++++-----
>  include/linux/mfd/max77686-private.h |   3 -
>  3 files changed, 130 insertions(+), 106 deletions(-)
> 

Looks good and works properly (RTC, unbind/rebind, wakealarm again)
but... after applying this patch the device cannot suspend to RAM after
unbind/rebind.

Reproduce path, after booting:
$ echo max77686-rtc > /sys/bus/platform/drivers/max77686-rtc/unbind
$ echo max77686-rtc > /sys/bus/platform/drivers/max77686-rtc/bind
$ rtcwake -d rtc2 -m mem -s 5 -v
(or instead of rtcwake: echo mem > /sys/power/state)

Proper behaviour:
##############################
[   28.549244] PM: late suspend of devices complete after 2.239 msecs
[   28.556051] PM: noirq suspend of devices complete after 2.078 msecs
[   28.560952] Disabling non-boot CPUs ...
[   28.588392] CPU1: shutdown
[   28.623283] CPU2: shutdown
[   28.653242] CPU3: shutdown

Power usage drops. Device wakes up (either from RTC or from manual, e.g.
key press)
##############################


Behaviour with patch 5/5:
[   67.068586] PM: Syncing filesystems ... done.
[   67.121673] Freezing user space processes ... (elapsed 0.004 seconds)
done.
[   67.123457] Freezing remaining freezable tasks ... (elapsed 0.001
seconds) done.
[   67.182024] wake enabled for irq 125
[   67.184315] wake enabled for irq 127
[   67.187829] wake enabled for irq 147
[   67.191238] wake enabled for irq 148
[   67.195178] dwc2 12480000.hsotg: suspending usb gadget g_ether
[   67.200647] dwc2 12480000.hsotg: new device is full-speed
[   67.206036] dwc2 12480000.hsotg: dwc2_hsotg_ep_disable: called for ep0
[   67.212523] dwc2 12480000.hsotg: dwc2_hsotg_ep_disable: called for ep0
[   67.221742] PM: suspend of devices complete after 93.132 msecs
[   67.226113] VALIVE_1.0V_AP: No configuration
[   67.230399] VCC_1.8V_AP: No configuration
[   67.234385] VCC_2.8V_AP: No configuration
[   67.238373] VCC_1.8V_IO: No configuration
[   67.243130] CAM_ISP_MIPI_1.2V: No configuration
[   67.249142] NFC_AVDD_1.8V: No configuration
[   67.252661] CAM_SENSOR_CORE_1.2V: No configuration
[   67.256648] CAM_ISP_SEN_IO_1.8V: No configuration
[   67.261311] VT_CAM_1.8V: No configuration
[   67.265323] VDDQ_PRE_1.8V: No configuration
[   67.269488] VTF_2.8V: No configuration
[   67.273219] VMEM_VDD_2.8V: No configuration
[   67.277386] TSP_AVDD_3.3V: No configuration
[   67.281553] TSP_VDD_1.8V: No configuration
[   67.285615] LCD_VCC_3.3V: No configuration
[   67.289712] MOTOR_VCC_3.0V: No configuration
[   67.296266] VMEM_1.2V_AP: No configuration
[   67.298902] VCC_SUB_1.35V: No configuration
[   67.303064] VCC_SUB_2.0V: No configuration
[   67.307142] VMEM_VDDF_3.0V: No configuration
[   67.311377] CAM_ISP_CORE_1.2V: No configuration
[   67.318181] PM: late suspend of devices complete after 2.267 msecs
[   67.325046] PM: noirq suspend of devices complete after 2.137 msecs
[   67.329857] Disabling non-boot CPUs ...

No CPU shutdown messages. Power usage not decreased, device does not
wake up.

I don't know yet what is the cause... At first glance it looks okay...

Best regards,
Krzysztof

-- 
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  reply	other threads:[~2016-02-04  0:10 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03 13:47 [PATCH V3 0/5] rtc: max77686: make max77686 rtc driver as IP driver Laxman Dewangan
2016-02-03 13:47 ` [rtc-linux] " Laxman Dewangan
2016-02-03 13:47 ` [PATCH V3 1/5] rtc: max77686: fix checkpatch error Laxman Dewangan
2016-02-03 13:47   ` [rtc-linux] " Laxman Dewangan
2016-02-03 13:47 ` [PATCH V3 2/5] rtc: max77686: use rtc regmap to access RTC registers Laxman Dewangan
2016-02-03 13:47   ` [rtc-linux] " Laxman Dewangan
2016-02-03 13:47 ` [PATCH V3 3/5] rtc: max77686: avoid reference of parent device info multiple places Laxman Dewangan
2016-02-03 13:47   ` [rtc-linux] " Laxman Dewangan
2016-02-03 13:47 ` [PATCH V3 4/5] mfd: max77686: do not set i2c client data for rtc i2c client Laxman Dewangan
2016-02-03 13:47   ` [rtc-linux] " Laxman Dewangan
2016-02-03 13:47 ` [PATCH V3 5/5] rtc: max77686: move initialisation of rtc regmap, irq chip locally Laxman Dewangan
2016-02-03 13:47   ` [rtc-linux] " Laxman Dewangan
2016-02-04  0:10   ` Krzysztof Kozlowski [this message]
2016-02-04  0:10     ` [rtc-linux] " Krzysztof Kozlowski
2016-02-04  2:03     ` Laxman Dewangan
2016-02-04  2:03       ` [rtc-linux] " Laxman Dewangan
2016-02-04  2:50       ` Laxman Dewangan
2016-02-04  2:50         ` [rtc-linux] " Laxman Dewangan
2016-02-04  3:04         ` Javier Martinez Canillas
2016-02-04  3:04           ` [rtc-linux] " Javier Martinez Canillas
2016-02-04 16:49         ` Javier Martinez Canillas
2016-02-04 16:49           ` [rtc-linux] " Javier Martinez Canillas
2016-02-04  6:58       ` Krzysztof Kozlowski
2016-02-04  6:58         ` [rtc-linux] " Krzysztof Kozlowski
2016-02-04  9:08         ` Krzysztof Kozlowski
2016-02-04  9:08           ` [rtc-linux] " Krzysztof Kozlowski
2016-02-04 10:13           ` Laxman Dewangan
2016-02-04 10:13             ` [rtc-linux] " Laxman Dewangan
2016-02-04 17:35             ` Javier Martinez Canillas
2016-02-04 17:35               ` [rtc-linux] " Javier Martinez Canillas
2016-02-05 14:37           ` Laxman Dewangan
2016-02-05 14:37             ` [rtc-linux] " Laxman Dewangan
2016-02-06  5:30             ` Javier Martinez Canillas
2016-02-06  5:30               ` [rtc-linux] " Javier Martinez Canillas
2016-02-06  6:29               ` Laxman Dewangan
2016-02-06  6:29                 ` [rtc-linux] " Laxman Dewangan
2016-02-06 13:01                 ` Javier Martinez Canillas
2016-02-06 13:01                   ` [rtc-linux] " Javier Martinez Canillas
2016-02-06 13:40                   ` Laxman Dewangan
2016-02-06 13:40                     ` [rtc-linux] " Laxman Dewangan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56B296F6.3060002@samsung.com \
    --to=k.kozlowski@samsung.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=cw00.choi@samsung.com \
    --cc=javier@osg.samsung.com \
    --cc=ldewangan@nvidia.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.