* [PATCH] iommu/rockchip: Only log stall errors when attaching
@ 2016-03-22 15:04 Tomeu Vizoso
2016-04-05 14:57 ` Joerg Roedel
0 siblings, 1 reply; 4+ messages in thread
From: Tomeu Vizoso @ 2016-03-22 15:04 UTC (permalink / raw)
To: linux-arm-kernel
Move the logging of timeouts when stalling the MMU to
rk_iommu_attach_device, as it's expected that sometimes the MMU won't
get stalled when detaching a device, and it's not a real problem that
would need to be communicated to the user.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---
drivers/iommu/rockchip-iommu.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index 0253ab35c33b..65325b6742e6 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -346,13 +346,7 @@ static int rk_iommu_enable_stall(struct rk_iommu *iommu)
rk_iommu_command(iommu, RK_MMU_CMD_ENABLE_STALL);
- ret = rk_wait_for(rk_iommu_is_stall_active(iommu), 1);
- if (ret)
- for (i = 0; i < iommu->num_mmu; i++)
- dev_err(iommu->dev, "Enable stall request timed out, status: %#08x\n",
- rk_iommu_read(iommu->bases[i], RK_MMU_STATUS));
-
- return ret;
+ return rk_wait_for(rk_iommu_is_stall_active(iommu), 1);
}
static int rk_iommu_disable_stall(struct rk_iommu *iommu)
@@ -798,8 +792,12 @@ static int rk_iommu_attach_device(struct iommu_domain *domain,
return 0;
ret = rk_iommu_enable_stall(iommu);
- if (ret)
+ if (ret) {
+ for (i = 0; i < iommu->num_mmu; i++)
+ dev_err(iommu->dev, "Enable stall request timed out, status: %#08x\n",
+ rk_iommu_read(iommu->bases[i], RK_MMU_STATUS));
return ret;
+ }
ret = rk_iommu_force_reset(iommu);
if (ret)
--
2.5.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] iommu/rockchip: Only log stall errors when attaching
2016-03-22 15:04 [PATCH] iommu/rockchip: Only log stall errors when attaching Tomeu Vizoso
@ 2016-04-05 14:57 ` Joerg Roedel
2016-04-05 16:48 ` Heiko Stuebner
0 siblings, 1 reply; 4+ messages in thread
From: Joerg Roedel @ 2016-04-05 14:57 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Mar 22, 2016 at 04:04:33PM +0100, Tomeu Vizoso wrote:
> Move the logging of timeouts when stalling the MMU to
> rk_iommu_attach_device, as it's expected that sometimes the MMU won't
> get stalled when detaching a device, and it's not a real problem that
> would need to be communicated to the user.
>
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Heiko, any opinion on this patch?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] iommu/rockchip: Only log stall errors when attaching
2016-04-05 14:57 ` Joerg Roedel
@ 2016-04-05 16:48 ` Heiko Stuebner
2016-04-05 17:10 ` Heiko Stuebner
0 siblings, 1 reply; 4+ messages in thread
From: Heiko Stuebner @ 2016-04-05 16:48 UTC (permalink / raw)
To: linux-arm-kernel
Am Dienstag, 5. April 2016, 16:57:26 schrieb Joerg Roedel:
> On Tue, Mar 22, 2016 at 04:04:33PM +0100, Tomeu Vizoso wrote:
> > Move the logging of timeouts when stalling the MMU to
> > rk_iommu_attach_device, as it's expected that sometimes the MMU won't
> > get stalled when detaching a device, and it's not a real problem that
> > would need to be communicated to the user.
> >
> > Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
>
> Heiko, any opinion on this patch?
I don't know enough about iommus (and the rockchip implementation) to judge
if this is correct. The reasoning sound right though and it seems to fix an
issue for Tomeu.
One complaint would be that I'd expect the behaviour to match between the
enable and disable functions. Meaning I'd want the error message from
rk_iommu_disable_stall to also move rk_iommu_attach_device.
Heiko
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] iommu/rockchip: Only log stall errors when attaching
2016-04-05 16:48 ` Heiko Stuebner
@ 2016-04-05 17:10 ` Heiko Stuebner
0 siblings, 0 replies; 4+ messages in thread
From: Heiko Stuebner @ 2016-04-05 17:10 UTC (permalink / raw)
To: linux-arm-kernel
Am Dienstag, 5. April 2016, 09:48:15 schrieb Heiko Stuebner:
> Am Dienstag, 5. April 2016, 16:57:26 schrieb Joerg Roedel:
> > On Tue, Mar 22, 2016 at 04:04:33PM +0100, Tomeu Vizoso wrote:
> > > Move the logging of timeouts when stalling the MMU to
> > > rk_iommu_attach_device, as it's expected that sometimes the MMU won't
> > > get stalled when detaching a device, and it's not a real problem that
> > > would need to be communicated to the user.
> > >
> > > Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> >
> > Heiko, any opinion on this patch?
>
> I don't know enough about iommus (and the rockchip implementation) to
> judge if this is correct. The reasoning sound right though and it seems
> to fix an issue for Tomeu.
>
> One complaint would be that I'd expect the behaviour to match between the
> enable and disable functions. Meaning I'd want the error message from
> rk_iommu_disable_stall to also move rk_iommu_attach_device.
hmm, or does John's patch maybe tie into this problem?
Aka, does the iommu simply does not detect when it's already stalled and
emits the timeout then?
Tomeu, in which cases do you see the excess error message?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-04-05 17:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-22 15:04 [PATCH] iommu/rockchip: Only log stall errors when attaching Tomeu Vizoso
2016-04-05 14:57 ` Joerg Roedel
2016-04-05 16:48 ` Heiko Stuebner
2016-04-05 17:10 ` Heiko Stuebner
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).