From: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Will Deacon <will@kernel.org>, Joerg Roedel <joro@8bytes.org>,
Sibi Sankar <sibis@codeaurora.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Jordan Crouse <jcrouse@codeaurora.org>,
Rob Clark <robdclark@gmail.com>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
Evan Green <evgreen@chromium.org>,
Stephen Boyd <swboyd@chromium.org>,
iommu@lists.linux-foundation.org,
Matthias Kaehlcke <mka@chromium.org>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCHv2 3/6] iommu/arm-smmu: Implement iommu_ops->def_domain_type call-back
Date: Mon, 20 Apr 2020 21:57:46 +0530 [thread overview]
Message-ID: <10cac2a08ae90afc88cbadff53a41ec5@codeaurora.org> (raw)
In-Reply-To: <6dd26176-448a-985c-90fc-7c47088015ff@arm.com>
Hi Robin,
On 2020-04-20 20:56, Robin Murphy wrote:
> On 2020-04-20 3:37 pm, Sai Prakash Ranjan wrote:
>> Implement the new def_domain_type call-back for the ARM
>> SMMU driver. We need this to support requesting the domain
>> type by the client devices.
>>
>> Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
>> ---
>> drivers/iommu/arm-smmu.c | 20 ++++++++++++++++++++
>> 1 file changed, 20 insertions(+)
>>
>> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
>> index e622f4e33379..b5d1d52dfbb8 100644
>> --- a/drivers/iommu/arm-smmu.c
>> +++ b/drivers/iommu/arm-smmu.c
>> @@ -1609,6 +1609,25 @@ static void arm_smmu_get_resv_regions(struct
>> device *dev,
>> iommu_dma_get_resv_regions(dev, head);
>> }
>> +static int arm_smmu_def_domain_type(struct device *dev)
>> +{
>> + struct iommu_fwspec *fwspec;
>> + struct arm_smmu_device *smmu;
>> +
>> + fwspec = dev_iommu_fwspec_get(dev);
>> + if (!fwspec || fwspec->ops != &arm_smmu_ops)
>> + return -ENODEV;
>> +
>> + smmu = arm_smmu_get_by_fwnode(fwspec->iommu_fwnode);
>> + if (!smmu)
>> + return -ENODEV;
>> +
>
> AFAICS this should only ever be called for a device in a group, which
> means an initial ->probe_device has succeeded and rather than
> defensively going the long way round, we can safely assume this:
>
> struct arm_smmu_master_cfg = dev_iommu_priv_get(dev);
> struct arm_smmu_impl *impl = cfg->smmu->impl;
>
> if (impl && impl->req_domain)
> return impl->req_domain(dev);
>
Yes you are right, will use this.
Thanks,
Sai
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
member
of Code Aurora Forum, hosted by The Linux Foundation
next prev parent reply other threads:[~2020-04-20 16:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 14:37 [PATCHv2 0/6] iommu/arm-smmu: Allow client devices to select identity mapping Sai Prakash Ranjan
2020-04-20 14:37 ` [PATCHv2 1/6] iommu: arm-smmu-impl: Convert to a generic reset implementation Sai Prakash Ranjan
2020-04-20 14:37 ` [PATCHv2 2/6] iommu/arm-smmu: Allow client devices to select direct mapping Sai Prakash Ranjan
2020-04-20 15:57 ` Robin Murphy
2020-04-20 16:28 ` Sai Prakash Ranjan
2020-04-20 14:37 ` [PATCHv2 3/6] iommu/arm-smmu: Implement iommu_ops->def_domain_type call-back Sai Prakash Ranjan
2020-04-20 15:26 ` Robin Murphy
2020-04-20 16:27 ` Sai Prakash Ranjan [this message]
2020-04-20 14:37 ` [PATCHv2 4/6] iommu/arm-smmu-qcom: Request direct mapping for modem device Sai Prakash Ranjan
2020-04-20 14:37 ` [PATCHv2 5/6] dt-bindings: remoteproc: qcom: Add iommus property Sai Prakash Ranjan
2020-04-20 14:37 ` [PATCHv2 6/6] arm64: dts: qcom: sdm845-cheza: " Sai Prakash Ranjan
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=10cac2a08ae90afc88cbadff53a41ec5@codeaurora.org \
--to=saiprakash.ranjan@codeaurora.org \
--cc=bjorn.andersson@linaro.org \
--cc=evgreen@chromium.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jcrouse@codeaurora.org \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mka@chromium.org \
--cc=robdclark@gmail.com \
--cc=robin.murphy@arm.com \
--cc=sibis@codeaurora.org \
--cc=swboyd@chromium.org \
--cc=will@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).