From: Georgi Djakov <gdjakov@mm-sol.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
"cjb@laptop.org" <cjb@laptop.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"grant.likely@linaro.org" <grant.likely@linaro.org>,
"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
Pawel Moll <Pawel.Moll@arm.com>,
"swarren@wwwdotorg.org" <swarren@wwwdotorg.org>,
"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
"galak@codeaurora.org" <galak@codeaurora.org>,
"rob@landley.net" <rob@landley.net>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
"subhashj@codeaurora.org" <subhashj@codeaurora.org>
Subject: Re: [PATCH v7 2/2] mmc: sdhci-msm: Initial support for MSM chipsets
Date: Thu, 30 Jan 2014 19:13:24 +0200 [thread overview]
Message-ID: <52EA8834.8010302@mm-sol.com> (raw)
In-Reply-To: <20131209094644.GC28379@e106331-lin.cambridge.arm.com>
On 12/09/2013 11:46 AM, Mark Rutland wrote:
>>> [...]
>>>
>>>> + /*
>>>> + * CORE_SW_RST above may trigger power irq if previous status of PWRCTL
>>>> + * was either BUS_ON or IO_HIGH_V. So before we enable the power irq
>>>> + * interrupt in GIC (by registering the interrupt handler), we need to
>>>> + * ensure that any pending power irq interrupt status is acknowledged
>>>> + * otherwise power irq interrupt handler would be fired prematurely.
>>>> + */
>>>> + irq_status = readl_relaxed(msm_host->core_mem + CORE_PWRCTL_STATUS);
>>>> + writel_relaxed(irq_status, (msm_host->core_mem + CORE_PWRCTL_CLEAR));
>>>> + irq_ctl = readl_relaxed(msm_host->core_mem + CORE_PWRCTL_CTL);
>>>> + if (irq_status & (CORE_PWRCTL_BUS_ON | CORE_PWRCTL_BUS_OFF))
>>>> + irq_ctl |= CORE_PWRCTL_BUS_SUCCESS;
>>>> + if (irq_status & (CORE_PWRCTL_IO_HIGH | CORE_PWRCTL_IO_LOW))
>>>> + irq_ctl |= CORE_PWRCTL_IO_SUCCESS;
>>>> + writel_relaxed(irq_ctl, (msm_host->core_mem + CORE_PWRCTL_CTL));
>>>> + /*
>>>> + * Ensure that above writes are propogated before interrupt enablement
>>>> + * in GIC.
>>>> + */
>>>> + mb();
>>>
>>> Does this guarantee that the device has finished responding to the write
>>> and deasserted the interrupt line (i.e. does the device only acknowledge
>>> the write once that is true)?
>>>
>>
>> I am not sure that i understand your concern. The write to
>> CORE_PWRCTL_CTL should acknowledge and deassert the interrupt.
>
> The mb() ensures that the write has reached the device, and the device's
> slave interface has acknowledged the write. On some devices this
> acknowledgement of the write can be asynchronous with respect to the
> device changing state in response to the write (i.e. the interrupt might
> get deasserted a short time after the write completes). Typically there
> is a register that should be polled to see whether the state change has
> completed.
>
> Does the acknowledgement of the write only occur once the device has
> changed state? Or might it change state in the background?
>
Thanks for clarifying this. All this is correct, but it will be
difficult to answer, because i don't have documentation and i can only
be guessing how exactly the hardware behaves internally.
I can remove this fragment from the initial version to keep it more
simple. Meanwhile i can do some tests reading/polling the status
register to see how and when exactly it changes.
Thanks,
Georgi
next prev parent reply other threads:[~2014-01-30 17:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-06 15:56 [PATCH v7 0/2] mmc: sdhci-msm: Add support for MSM chipsets Georgi Djakov
2013-11-06 15:56 ` [PATCH v7 1/2] mmc: sdhci-msm: Initial SDHCI MSM driver documentation Georgi Djakov
2013-12-05 9:52 ` Mark Rutland
2013-12-06 11:59 ` Georgi Djakov
2013-12-09 9:38 ` Mark Rutland
2014-01-30 17:07 ` Georgi Djakov
2013-11-06 15:56 ` [PATCH v7 2/2] mmc: sdhci-msm: Initial support for MSM chipsets Georgi Djakov
2013-12-05 10:27 ` Mark Rutland
2013-12-06 12:02 ` Georgi Djakov
2013-12-09 9:46 ` Mark Rutland
2014-01-30 17:13 ` Georgi Djakov [this message]
2013-12-09 17:00 ` Courtney Cavin
2014-01-30 17:21 ` Georgi Djakov
2014-01-31 17:31 ` Courtney Cavin
2013-11-14 10:18 ` [PATCH v7 0/2] mmc: sdhci-msm: Add " Ivan T. Ivanov
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=52EA8834.8010302@mm-sol.com \
--to=gdjakov@mm-sol.com \
--cc=Pawel.Moll@arm.com \
--cc=cjb@laptop.org \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=grant.likely@linaro.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=subhashj@codeaurora.org \
--cc=swarren@wwwdotorg.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox