public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: iommu@lists.linux.dev, Will Deacon <will@kernel.org>,
	Joerg Roedel <joro@8bytes.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Michael Walle <michael@walle.cc>,
	Laurentiu Tudor <laurentiu.tudor@nxp.com>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] iommu/arm-smmu: don't unregister on shutdown
Date: Wed, 14 Dec 2022 21:25:45 +0000	[thread overview]
Message-ID: <a3a034b5-9493-e345-bcb4-8c5eef7f9a65@arm.com> (raw)
In-Reply-To: <20221214173418.iwovyxlbogkspjxy@skbuf>

On 2022-12-14 17:34, Vladimir Oltean wrote:
> On Fri, Dec 09, 2022 at 11:24:32AM +0000, Robin Murphy wrote:
>>> Fixes: b06c076ea962 ("Revert "iommu/arm-smmu: Make arm-smmu explicitly non-modular"")
>>
>> I think that's semantically correct, but I'm pretty sure at that point it
>> would have been benign in practice - the observable splat will be a much
>> more recent fallout from me changing the iommu_device_unregister() behaviour
>> in 57365a04c921 ("iommu: Move bus setup to IOMMU device registration"). The
>> assumption therein is that unregister would only happen on probe failure,
>> before the IOMMU instance is in use, or on module unload, which would not be
>> allowed while active devices still hold module references. I overlooked that
>> the SMMU drivers were doing what they do, sorry about that.
> 
> Ok, I'll change the Fixes: tag, I didn't notice that iommu_device_unregister()
> changed in behavior only later, I just looked at current trees and tried
> to infer what went wrong.
> 
>> The change itself looks sensible. The point of this shutdown hook is simply
>> not to leave active translations in place that might confuse future software
>> after reboot/kexec; any housekeeping in the current kernel state is a waste
>> of time anyway. Fancy doing the same for SMMUv3 as well?
> 
> I can try, but I won't have hardware to test.
> 
> Basically the only thing truly relevant for shutdown from arm_smmu_device_remove()
> is arm_smmu_device_disable(), would you agree to a patch which changes
> things as below?
> 
> 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 6d5df91c5c46..d4d8bfee9feb 100644
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> @@ -3854,7 +3854,9 @@ static int arm_smmu_device_remove(struct platform_device *pdev)
>   
>   static void arm_smmu_device_shutdown(struct platform_device *pdev)
>   {
> -	arm_smmu_device_remove(pdev);
> +	struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
> +
> +	arm_smmu_device_disable(smmu);
>   }
>   
>   static const struct of_device_id arm_smmu_of_match[] = {


Looks fine to me! I'll let Will decide if he'd still prefer to do the 
full remove-calls-shutdown reversal here as well for complete 
consistency, but I reckon the minimal diff is no bad thing :)

Cheers,
Robin.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-12-14 21:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08 16:53 [PATCH] iommu/arm-smmu: don't unregister on shutdown Vladimir Oltean
2022-12-09 11:24 ` Robin Murphy
2022-12-14 17:34   ` Vladimir Oltean
2022-12-14 21:25     ` Robin Murphy [this message]
2022-12-15 10:13       ` Vladimir Oltean

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=a3a034b5-9493-e345-bcb4-8c5eef7f9a65@arm.com \
    --to=robin.murphy@arm.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=laurentiu.tudor@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=netdev@vger.kernel.org \
    --cc=vladimir.oltean@nxp.com \
    --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