From: Vasant Hegde <vasant.hegde@amd.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Robin Murphy <robin.murphy@arm.com>,
iommu@lists.linux.dev, joro@8bytes.org,
suravee.suthikulpanit@amd.com, Lianbo Jiang <lijiang@redhat.com>
Subject: Re: [PATCH 1/2] iommu: Take group lock before attaching device in iommu_deferred_attach()
Date: Mon, 24 Jun 2024 21:32:26 +0530 [thread overview]
Message-ID: <fceba6c2-e0eb-4968-bf3d-8a4a8c3880b2@amd.com> (raw)
In-Reply-To: <20240624152534.GR791043@ziepe.ca>
Jason,
On 6/24/2024 8:55 PM, Jason Gunthorpe wrote:
> On Mon, Jun 24, 2024 at 07:50:46PM +0530, Vasant Hegde wrote:
>
>> It may be good thing to add mutex here.. But if any of the caller of these
>> deferred functions hold spin lock again we will hit the similar issue that I hit
>> with AMD driver.
>
> My point was that Intel doesn't support non-sleeping attach, it uses
> GFP_KERNEL, that support seems to be a uniquely AMD thing of the major
> drivers.
As I understand we don't have any hard requirement. We can sleep in attach
device path. I do have a patch to replace dev_data->spinlock to mutex in AMD
driver. I need to do some more testing before sending it out.
>
> So, I don't see an issue with formalizing the lowest common
> denominator in the core code - the context must be sleepable.
>
> Presumably things work because the kdump kernels only run drivers that
> reliably trigger first dma from sleepable contexts. Unless there is
> something AMD only that relies on this special behavior??
AFAIK AMD driver doesn't have any special behaviour in kdump path. When we jump
to crashing kernel (kexec) we don't disable IOMMU and try to init IOMMU with
existing info.
Having said that I have not done exhaustive kdump test with mutex lock. I will
run some more tests and get back to you.
-Vasant
prev parent reply other threads:[~2024-06-24 16:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-28 16:39 [PATCH 1/2] iommu: Take group lock before attaching device in iommu_deferred_attach() Vasant Hegde
2024-05-28 16:39 ` [PATCH 2/2] iommu/amd: Fix Invalid wait context issue Vasant Hegde
2024-05-28 20:43 ` Chris Bainbridge
2024-05-29 6:35 ` Mikhail Gavrilov
2024-05-28 18:06 ` [PATCH 1/2] iommu: Take group lock before attaching device in iommu_deferred_attach() Robin Murphy
2024-05-29 7:24 ` Vasant Hegde
2024-06-10 17:44 ` Jason Gunthorpe
2024-06-24 14:20 ` Vasant Hegde
2024-06-24 15:25 ` Jason Gunthorpe
2024-06-24 16:02 ` Vasant Hegde [this message]
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=fceba6c2-e0eb-4968-bf3d-8a4a8c3880b2@amd.com \
--to=vasant.hegde@amd.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@ziepe.ca \
--cc=joro@8bytes.org \
--cc=lijiang@redhat.com \
--cc=robin.murphy@arm.com \
--cc=suravee.suthikulpanit@amd.com \
/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