linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Will Deacon <will@kernel.org>
Cc: joro@8bytes.org, iommu@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2.5/3] iommu/arm-smmu-v3: Undo SMMU enable on probe failure
Date: Tue, 12 Nov 2024 16:25:08 +0000	[thread overview]
Message-ID: <cf5745db-6523-49ea-b21e-7cf51ff47a67@arm.com> (raw)
In-Reply-To: <20241112155750.GC21479@willie-the-truck>

On 12/11/2024 3:57 pm, Will Deacon wrote:
> On Tue, Nov 12, 2024 at 02:49:59PM +0000, Robin Murphy wrote:
>> If SMMU probe fails afer arm_smmu_device_reset(), we leave the SMMU
>> enabled with an empty Stream Table, silently blocking all DMA. This
>> proves rather annoying for debugging said probe failure, so let's handle
>> it a bit better by putting the SMMU back into (more or less) the same
>> state as if it hadn't probed at all.
>>
>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
>> ---
>>   drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
>> index 7908fca962fe..566d66e9c91e 100644
>> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
>> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
>> @@ -4640,6 +4640,7 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
>>   	iommu_device_sysfs_remove(&smmu->iommu);
>>   free_iopf:
>>   	iopf_queue_free(smmu->evtq.iopf);
>> +	arm_smmu_device_disable(smmu);
>>   	return ret;
>>   }
> 
> Heh, this is starting to look an awful lot like arm_smmu_device_remove()...

Indeed, functionally that's rather the point; implementation-wise, you 
know I'd branch straight into the middle of a different function if the 
language let me :)

Robin.


      reply	other threads:[~2024-11-12 16:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-08 18:30 [PATCH 0/3] iommu/arm-smmu: Minor probe_device related improvements Robin Murphy
2024-11-08 18:30 ` [PATCH 1/3] iommu/arm-smmu: Make instance lookup robust Robin Murphy
2024-11-12 15:43   ` Will Deacon
2024-11-12 16:05     ` Robin Murphy
2024-11-08 18:30 ` [PATCH 2/3] iommu/arm-smmu-v3: Clean up iopf queue on probe failure Robin Murphy
2024-11-12 15:55   ` Will Deacon
2024-11-12 17:03     ` Robin Murphy
2024-11-08 18:30 ` [PATCH 3/3] iommu: Manage driver probe deferral better Robin Murphy
2024-11-12 16:00   ` Will Deacon
2024-11-12 14:49 ` [PATCH v2.5/3] iommu/arm-smmu-v3: Undo SMMU enable on probe failure Robin Murphy
2024-11-12 15:57   ` Will Deacon
2024-11-12 16:25     ` Robin Murphy [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=cf5745db-6523-49ea-b21e-7cf51ff47a67@arm.com \
    --to=robin.murphy@arm.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.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).