From: Georgi Djakov <georgi.djakov@linaro.org>
To: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Cc: bjorn@kryo.se, Kumar Gala <galak@codeaurora.org>,
Andy Gross <agross@codeaurora.org>,
David Brown <davidb@codeaurora.org>,
linux-kernel@vger.kernel.org, linux-soc@vger.kernel.org,
Jeffrey Hugo <jhugo@codeaurora.org>,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v2 04/11] soc: qcom: Add Shared Memory Driver
Date: Tue, 21 Jul 2015 14:46:44 +0300 [thread overview]
Message-ID: <55AE3124.4010705@linaro.org> (raw)
In-Reply-To: <20150713222729.GC15178@usrtlx11787.corpusers.net>
On 07/14/2015 01:27 AM, Bjorn Andersson wrote:
> On Tue 07 Jul 06:45 PDT 2015, Georgi Djakov wrote:
>
>> Hi Bjorn,
>> Thank you for this patchset! Some nits and a question below.
>>
>
> Thank you!
>
>> On 06/27/2015 12:50 AM, bjorn@kryo.se wrote:
>>> From: Bjorn Andersson <bjorn.andersson@sonymobile.com>
>>>
>>> This adds the Qualcomm Shared Memory Driver (SMD) providing
>>> communication channels to remote processors, ontop of SMEM.
>>>
>>> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
[..]
>> [...]
>>> +static int __init qcom_smd_init(void)
>>> +{
>>> + int ret;
>>> +
>>> + ret = bus_register(&qcom_smd_bus);
>>> + if (ret) {
>>> + pr_err("failed to register smd bus: %d\n", ret);
>>> + return ret;
>>> + }
>>> +
>>> + return platform_driver_register(&qcom_smd_driver);
>>> +}
>>> +arch_initcall(qcom_smd_init);
>>> +
>>> +static void __exit qcom_smd_exit(void)
>>> +{
>>> + platform_driver_unregister(&qcom_smd_driver);
>>> + bus_unregister(&qcom_smd_bus);
>>> +}
>>> +module_exit(qcom_smd_exit);
>>> +
>> [...]
>>> +/**
>>> + * struct qcom_smd_driver - smd driver struct
>>> + * @driver: underlying device driver
>>> + * @probe: invoked when the smd channel is found
>>> + * @remove: invoked when the smd channel is closed
>>> + * @callback: invoked when an inbound message is received on the channel,
>>> + * should return 0 on success or -EBUSY if the data cannot be
>>> + * consumed at this time
>>> + */
>>> +struct qcom_smd_driver {
>>> + struct device_driver driver;
>>> + int (*probe)(struct qcom_smd_device *dev);
>>> + void (*remove)(struct qcom_smd_device *dev);
>>> + int (*callback)(struct qcom_smd_device *, const void *, size_t);
>>> +};
>>> +
>>> +int qcom_smd_driver_register(struct qcom_smd_driver *drv);
>>> +void qcom_smd_driver_unregister(struct qcom_smd_driver *drv);
>>> +
>>> +#define module_qcom_smd_driver(__smd_driver) \
>>> + module_driver(__smd_driver, qcom_smd_driver_register, \
>>> + qcom_smd_driver_unregister)
>>> +
>>
>> This comment is mostly related to your RPM over SMD driver patch, as
>> i have a RPM clock driver based on it. The RPM clock driver registers
>> some fundamental stuff like XO and i had to hack smd-rpm to probe
>> earlier, so that most other drivers can initialize. So i was wondering,
>> what if we register the drivers on the bus earlier? What do you think?
>>
>
> My only concern would be that if we're calling
> qcom_smd_driver_register() before the smd arch_initcall has registered
> the bus it will fail.
>
Maybe we can use core/postcore_initcall for smd, and then arch_initcall
for smd-rpm?
> Part of this I see no problem with modifying the rpm driver to register
> earlier - and it would be good to have those regulators earlier as
> well...
Booting with initcall_debug shows me that most busses are registered at
postcore_initcall - like spmi, i2c, spi etc.
> I've intentionally not done anything about this, because it's helped to
> smoke out a bunch of EPROBE_DEFER issues for me already, but longer term
> it's not okay for all our drivers to fail 2-3 times before the
> regulators are up...
I agree. Thanks!
BR,
Georgi
next prev parent reply other threads:[~2015-07-21 11:46 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-26 21:50 [PATCH v2 00/11] Qualcomm Shared Memory & RPM drivers bjorn
[not found] ` <1435355419-23602-1-git-send-email-bjorn.andersson-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
2015-06-26 21:50 ` [PATCH v2 01/11] soc: qcom: Add device tree binding for SMEM bjorn-UYDU3/A3LUY
2015-07-08 23:56 ` Stephen Boyd
2015-07-09 3:50 ` Andy Gross
[not found] ` <559DB8B2.2090202-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-07-13 22:30 ` Bjorn Andersson
2015-07-23 20:49 ` Andy Gross
2015-06-26 21:50 ` [PATCH v2 02/11] soc: qcom: Add Shared Memory Manager driver bjorn
2015-07-17 21:15 ` Andy Gross
2015-07-23 20:47 ` Andy Gross
2015-06-26 21:50 ` [PATCH v2 03/11] soc: qcom: Add device tree binding for Shared Memory Device bjorn
2015-06-26 21:50 ` [PATCH v2 04/11] soc: qcom: Add Shared Memory Driver bjorn
2015-07-07 13:45 ` Georgi Djakov
2015-07-13 22:27 ` Bjorn Andersson
2015-07-21 11:46 ` Georgi Djakov [this message]
2015-06-26 21:50 ` [PATCH v2 05/11] mfd: devicetree: bindings: Add Qualcomm SMD based RPM DT binding bjorn
2015-07-07 12:16 ` Lee Jones
2015-07-13 21:48 ` Bjorn Andersson
2015-07-23 13:31 ` Lee Jones
2015-07-23 16:41 ` Bjorn Andersson
[not found] ` <20150723164128.GD4753-P9SbAA3LsXe39TS3lRcy0mP6iJigPa5YXqFh9Ls21Oc@public.gmane.org>
2015-07-23 17:16 ` Mark Brown
2015-07-24 9:58 ` Lee Jones
2015-07-24 10:24 ` Mark Brown
[not found] ` <20150724102434.GF11162-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-07-24 17:23 ` Mark Brown
2015-07-27 7:29 ` Lee Jones
2015-07-27 9:53 ` Mark Brown
2015-07-27 10:58 ` Lee Jones
2015-06-26 21:50 ` [PATCH v2 06/11] mfd: qcom-smd-rpm: Driver for the Qualcomm RPM over SMD bjorn
2015-07-07 12:37 ` Lee Jones
2015-07-13 21:58 ` Bjorn Andersson
2015-07-23 13:22 ` Lee Jones
2015-07-23 16:55 ` Bjorn Andersson
2015-07-24 10:06 ` Lee Jones
2015-06-26 21:50 ` [PATCH v2 07/11] regulator: qcom: smd: Regulator driver for the Qualcomm RPM bjorn
2015-06-26 21:50 ` [PATCH v2 08/11] ARM: dts: msm8974: Add tcsr mutex node bjorn
[not found] ` <1435355419-23602-9-git-send-email-bjorn.andersson-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
2015-07-23 20:42 ` Andy Gross
2015-06-26 21:50 ` [PATCH v2 09/11] ARM: dts: msm8974: Add smem reservation and node bjorn
2015-07-23 20:51 ` Andy Gross
2015-06-26 21:50 ` [PATCH v2 10/11] ARM: dts: msm8974: Add smd, rpm and regulator nodes bjorn
2015-06-26 21:50 ` [PATCH v2 11/11] ARM: dts: xperia-honami: Add regulator nodes for Honami bjorn
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=55AE3124.4010705@linaro.org \
--to=georgi.djakov@linaro.org \
--cc=agross@codeaurora.org \
--cc=bjorn.andersson@sonymobile.com \
--cc=bjorn@kryo.se \
--cc=davidb@codeaurora.org \
--cc=galak@codeaurora.org \
--cc=jhugo@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-soc@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).