From: Jeffrey Hugo <jhugo@codeaurora.org>
To: Loic Poulain <loic.poulain@linaro.org>,
manivannan.sadhasivam@linaro.org, hemantk@codeaurora.org
Cc: linux-arm-msm@vger.kernel.org, bbhatt@codeaurora.org
Subject: Re: [PATCH v2] bus: mhi: core: Fix device hierarchy issue
Date: Tue, 24 Nov 2020 09:36:30 -0700 [thread overview]
Message-ID: <b66d5f09-7560-3b82-84a3-b7cf40c9532e@codeaurora.org> (raw)
In-Reply-To: <1606234711-20125-1-git-send-email-loic.poulain@linaro.org>
On 11/24/2020 9:18 AM, Loic Poulain wrote:
> A MHI client device should be child of the MHI controller device.
> Today both MHI controller and its MHI clients are direct children
> of the same bus device. This patch fixes the hierarchy.
Why?
I'm not particularly arguing for or against this change (I think it
affects me slightly, but not in a breaking way), but this commit text
seems pretty generic. It doesn't really help me understand the
relevance of this change. It seems to be only describing what you are
doing, but not the why. How did you find this? How does this affect
the client drivers? Does it make something the client drivers care
about better?
To put this another way, "should" is an opinion, and you've provided no
facts to assert why your opinion is superior to others.
>
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> ---
> v2: fix commit message
>
> drivers/bus/mhi/core/init.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c
> index 436221c..c7a7354 100644
> --- a/drivers/bus/mhi/core/init.c
> +++ b/drivers/bus/mhi/core/init.c
> @@ -1137,7 +1137,15 @@ struct mhi_device *mhi_alloc_device(struct mhi_controller *mhi_cntrl)
> device_initialize(dev);
> dev->bus = &mhi_bus_type;
> dev->release = mhi_release_device;
> - dev->parent = mhi_cntrl->cntrl_dev;
> +
> + if (mhi_cntrl->mhi_dev) {
> + /* for MHI client devices, parent is the MHI controller device */
> + dev->parent = &mhi_cntrl->mhi_dev->dev;
> + } else {
> + /* for MHI controller device, parent is the bus device (e.g. pci device) */
> + dev->parent = mhi_cntrl->cntrl_dev;
> + }
> +
> mhi_dev->mhi_cntrl = mhi_cntrl;
> mhi_dev->dev_wake = 0;
>
>
--
Jeffrey Hugo
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
next prev parent reply other threads:[~2020-11-24 16:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-24 16:18 [PATCH v2] bus: mhi: core: Fix device hierarchy issue Loic Poulain
2020-11-24 16:31 ` Bjorn Andersson
2020-11-24 16:36 ` Jeffrey Hugo [this message]
2020-11-24 16:57 ` Loic Poulain
2020-11-24 17:37 ` Jeffrey Hugo
2020-11-24 17:50 ` Loic Poulain
2020-11-24 17:48 ` Manivannan Sadhasivam
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=b66d5f09-7560-3b82-84a3-b7cf40c9532e@codeaurora.org \
--to=jhugo@codeaurora.org \
--cc=bbhatt@codeaurora.org \
--cc=hemantk@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=manivannan.sadhasivam@linaro.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