Re: Not able to set RTC with qpnp-rtc driver

2014-07-24 Thread Siteshwar
Hi Stephen,

Yes, I have DT property qpnp-rtc-write set to 1 in my local kernel
sources. I have set it because I need write access to the clock.

I am aware that Android on Nexus 5 uses time_daemon utility to manage
time. I am trying to port Sailfish OS on Nexus 5 which uses a
different utility called dsme to manage time.

The ioctl call is coming from this code :

https://github.com/nemomobile/dsme/blob/4f8d29664c1b7180b45066c3ac5b3ad50eb91977/modules/iphb.c#L922

and I want this call to be successful. Even if I have qpnp-rtc-write
set to 1 I get a transaction denied message in kernel logs while
setting time. I want to know what is causing this call to fail and how
to avoid it ?

On Thu, Jul 24, 2014 at 4:56 AM, Stephen Boyd sb...@codeaurora.org wrote:
 On 07/23/14 13:28, Siteshwar wrote:
 Hello,

 I am trying to set RTC on Nexus 5 (which uses qpnp-rtc driver).and
 getting a permission error while setting it.

 I am making following call from my application with valid arguments :

 ioctl(rtc_fd, RTC_SET_TIME, tod)

 when I make this call I see below messages in dmesg logs :

 [   26.945670] spmi_pmic_arb fc4cf000.qcom,spmi:
 pmic_arb_wait_for_done: transaction denied (0x5)
 [   26.945743] qcom,qpnp-rtc qpnp-rtc-f85bbe00: SPMI write failed
 [   26.945856] qcom,qpnp-rtc qpnp-rtc-f85bbe00: Write to RTC reg failed 1

 The transaction denied message is coming from
 https://github.com/CyanogenMod/android_kernel_lge_hammerhead/blob/85564c374b6b082fc447f6dae53a630c04b4ef1c/drivers/spmi/spmi-pmic-arb.c#L158

 It's fairly low level stuff and I am not sure why should it give a
 permission error. The only config option I can find from documentation
 is qpnp-rtc-write
 (https://github.com/CyanogenMod/android_kernel_lge_hammerhead/blob/cm-11.0/Documentation/devicetree/bindings/rtc/qpnp-rtc.txt)
 and it is set in my configurations. In what cases I will get this
 error while setting RTC ? Could this be a bug in the driver ?


 qpnp-rtc-write is not a config option. It's a DT property and it states
 that the RTC can be written if it's set to 1 (it really should have been
 a boolean property). If it isn't set the RTC can't be programmed by the
 OS (i.e. it's configured by another entity outside of Linux). Looking at
 the dts files in the cyanogenmod kernel you pointed to I don't see this
 value set to anything but 0. You say that property is set in your
 configurations. Have you modified the DT to have this property set to 1?
 If so, don't do that.

 --
 Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
 hosted by The Linux Foundation




-- 
Regards,
Siteshwar
--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Not able to set RTC with qpnp-rtc driver

2014-07-23 Thread Siteshwar
Hello,

I am trying to set RTC on Nexus 5 (which uses qpnp-rtc driver).and
getting a permission error while setting it.

I am making following call from my application with valid arguments :

ioctl(rtc_fd, RTC_SET_TIME, tod)

when I make this call I see below messages in dmesg logs :

[   26.945670] spmi_pmic_arb fc4cf000.qcom,spmi:
pmic_arb_wait_for_done: transaction denied (0x5)
[   26.945743] qcom,qpnp-rtc qpnp-rtc-f85bbe00: SPMI write failed
[   26.945856] qcom,qpnp-rtc qpnp-rtc-f85bbe00: Write to RTC reg failed 1

The transaction denied message is coming from
https://github.com/CyanogenMod/android_kernel_lge_hammerhead/blob/85564c374b6b082fc447f6dae53a630c04b4ef1c/drivers/spmi/spmi-pmic-arb.c#L158

It's fairly low level stuff and I am not sure why should it give a
permission error. The only config option I can find from documentation
is qpnp-rtc-write
(https://github.com/CyanogenMod/android_kernel_lge_hammerhead/blob/cm-11.0/Documentation/devicetree/bindings/rtc/qpnp-rtc.txt)
and it is set in my configurations. In what cases I will get this
error while setting RTC ? Could this be a bug in the driver ?

-- 
Regards,
Siteshwar
--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Not able to set RTC with qpnp-rtc driver

2014-07-23 Thread Stephen Boyd
On 07/23/14 13:28, Siteshwar wrote:
 Hello,

 I am trying to set RTC on Nexus 5 (which uses qpnp-rtc driver).and
 getting a permission error while setting it.

 I am making following call from my application with valid arguments :

 ioctl(rtc_fd, RTC_SET_TIME, tod)

 when I make this call I see below messages in dmesg logs :

 [   26.945670] spmi_pmic_arb fc4cf000.qcom,spmi:
 pmic_arb_wait_for_done: transaction denied (0x5)
 [   26.945743] qcom,qpnp-rtc qpnp-rtc-f85bbe00: SPMI write failed
 [   26.945856] qcom,qpnp-rtc qpnp-rtc-f85bbe00: Write to RTC reg failed 1

 The transaction denied message is coming from
 https://github.com/CyanogenMod/android_kernel_lge_hammerhead/blob/85564c374b6b082fc447f6dae53a630c04b4ef1c/drivers/spmi/spmi-pmic-arb.c#L158

 It's fairly low level stuff and I am not sure why should it give a
 permission error. The only config option I can find from documentation
 is qpnp-rtc-write
 (https://github.com/CyanogenMod/android_kernel_lge_hammerhead/blob/cm-11.0/Documentation/devicetree/bindings/rtc/qpnp-rtc.txt)
 and it is set in my configurations. In what cases I will get this
 error while setting RTC ? Could this be a bug in the driver ?


qpnp-rtc-write is not a config option. It's a DT property and it states
that the RTC can be written if it's set to 1 (it really should have been
a boolean property). If it isn't set the RTC can't be programmed by the
OS (i.e. it's configured by another entity outside of Linux). Looking at
the dts files in the cyanogenmod kernel you pointed to I don't see this
value set to anything but 0. You say that property is set in your
configurations. Have you modified the DT to have this property set to 1?
If so, don't do that.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html