All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
@ 2018-07-23 12:56 ` Shaokun Zhang
  0 siblings, 0 replies; 15+ messages in thread
From: Shaokun Zhang @ 2018-07-23 12:56 UTC (permalink / raw)
  To: linux-arm-kernel, iommu; +Cc: Miao Zhong, Robin Murphy, Will Deacon

From: Miao Zhong <zhongmiao@hisilicon.com>

When PRI queue occurs overflow, driver should update the OVACKFLG to
the PRIQ consumer register, otherwise subsequent PRI requests will not
be processed.

Cc: Will Deacon <will.deacon@arm.com>
Cc: Robin Murphy <robin.murphy@arm.com> 
Signed-off-by: Miao Zhong <zhongmiao@hisilicon.com>
---
 drivers/iommu/arm-smmu-v3.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 1d64710..deacc15 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -1301,6 +1301,7 @@ static irqreturn_t arm_smmu_priq_thread(int irq, void *dev)
 
 	/* Sync our overflow flag, as we believe we're up to speed */
 	q->cons = Q_OVF(q, q->prod) | Q_WRP(q, q->cons) | Q_IDX(q, q->cons);
+	writel(q->cons, q->cons_reg);
 	return IRQ_HANDLED;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
@ 2018-07-23 12:56 ` Shaokun Zhang
  0 siblings, 0 replies; 15+ messages in thread
From: Shaokun Zhang @ 2018-07-23 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

From: Miao Zhong <zhongmiao@hisilicon.com>

When PRI queue occurs overflow, driver should update the OVACKFLG to
the PRIQ consumer register, otherwise subsequent PRI requests will not
be processed.

Cc: Will Deacon <will.deacon@arm.com>
Cc: Robin Murphy <robin.murphy@arm.com> 
Signed-off-by: Miao Zhong <zhongmiao@hisilicon.com>
---
 drivers/iommu/arm-smmu-v3.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 1d64710..deacc15 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -1301,6 +1301,7 @@ static irqreturn_t arm_smmu_priq_thread(int irq, void *dev)
 
 	/* Sync our overflow flag, as we believe we're up to speed */
 	q->cons = Q_OVF(q, q->prod) | Q_WRP(q, q->cons) | Q_IDX(q, q->cons);
+	writel(q->cons, q->cons_reg);
 	return IRQ_HANDLED;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
  2018-07-23 12:56 ` Shaokun Zhang
@ 2018-07-23 14:08     ` Jean-Philippe Brucker
  -1 siblings, 0 replies; 15+ messages in thread
From: Jean-Philippe Brucker @ 2018-07-23 14:08 UTC (permalink / raw)
  To: Shaokun Zhang, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: Miao Zhong, Will Deacon

On 23/07/18 13:56, Shaokun Zhang wrote:
> From: Miao Zhong <zhongmiao-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
> 
> When PRI queue occurs overflow, driver should update the OVACKFLG to
> the PRIQ consumer register, otherwise subsequent PRI requests will not
> be processed.

Since the upstream driver doesn't enable PRI in endpoints, I'm not sure
this patch makes sense on its own, but it seems correct anyway. I had a
similar patch in my initial SVA RFC, but for some reason dropped it in
later versions (https://patchwork.kernel.org/patch/9594021/)

It's worth noting that the event queue doesn't have the same problem,
because the SMMU can record new events even if the overflow hasn't been
acknowledged.

Thanks,
Jean

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
@ 2018-07-23 14:08     ` Jean-Philippe Brucker
  0 siblings, 0 replies; 15+ messages in thread
From: Jean-Philippe Brucker @ 2018-07-23 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

On 23/07/18 13:56, Shaokun Zhang wrote:
> From: Miao Zhong <zhongmiao@hisilicon.com>
> 
> When PRI queue occurs overflow, driver should update the OVACKFLG to
> the PRIQ consumer register, otherwise subsequent PRI requests will not
> be processed.

Since the upstream driver doesn't enable PRI in endpoints, I'm not sure
this patch makes sense on its own, but it seems correct anyway. I had a
similar patch in my initial SVA RFC, but for some reason dropped it in
later versions (https://patchwork.kernel.org/patch/9594021/)

It's worth noting that the event queue doesn't have the same problem,
because the SMMU can record new events even if the overflow hasn't been
acknowledged.

Thanks,
Jean

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
  2018-07-23 12:56 ` Shaokun Zhang
@ 2018-07-27  9:41     ` Zhangshaokun
  -1 siblings, 0 replies; 15+ messages in thread
From: Zhangshaokun @ 2018-07-27  9:41 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: Miao Zhong, Will Deacon, Robin Murphy

Hi Will,

I saw it in your trees, is it necessary to Cc stable version?

Cheers,
Shaokun

On 2018/7/23 20:56, Shaokun Zhang wrote:
> From: Miao Zhong <zhongmiao-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
> 
> When PRI queue occurs overflow, driver should update the OVACKFLG to
> the PRIQ consumer register, otherwise subsequent PRI requests will not
> be processed.
> 
> Cc: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
> Cc: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org> 
> Signed-off-by: Miao Zhong <zhongmiao-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
> ---
>  drivers/iommu/arm-smmu-v3.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index 1d64710..deacc15 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -1301,6 +1301,7 @@ static irqreturn_t arm_smmu_priq_thread(int irq, void *dev)
>  
>  	/* Sync our overflow flag, as we believe we're up to speed */
>  	q->cons = Q_OVF(q, q->prod) | Q_WRP(q, q->cons) | Q_IDX(q, q->cons);
> +	writel(q->cons, q->cons_reg);
>  	return IRQ_HANDLED;
>  }
>  
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
@ 2018-07-27  9:41     ` Zhangshaokun
  0 siblings, 0 replies; 15+ messages in thread
From: Zhangshaokun @ 2018-07-27  9:41 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Will,

I saw it in your trees, is it necessary to Cc stable version?

Cheers,
Shaokun

On 2018/7/23 20:56, Shaokun Zhang wrote:
> From: Miao Zhong <zhongmiao@hisilicon.com>
> 
> When PRI queue occurs overflow, driver should update the OVACKFLG to
> the PRIQ consumer register, otherwise subsequent PRI requests will not
> be processed.
> 
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Robin Murphy <robin.murphy@arm.com> 
> Signed-off-by: Miao Zhong <zhongmiao@hisilicon.com>
> ---
>  drivers/iommu/arm-smmu-v3.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index 1d64710..deacc15 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -1301,6 +1301,7 @@ static irqreturn_t arm_smmu_priq_thread(int irq, void *dev)
>  
>  	/* Sync our overflow flag, as we believe we're up to speed */
>  	q->cons = Q_OVF(q, q->prod) | Q_WRP(q, q->cons) | Q_IDX(q, q->cons);
> +	writel(q->cons, q->cons_reg);
>  	return IRQ_HANDLED;
>  }
>  
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
  2018-07-27  9:41     ` Zhangshaokun
@ 2018-07-27  9:48         ` Will Deacon
  -1 siblings, 0 replies; 15+ messages in thread
From: Will Deacon @ 2018-07-27  9:48 UTC (permalink / raw)
  To: Zhangshaokun
  Cc: Miao Zhong, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Robin Murphy, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, Jul 27, 2018 at 05:41:46PM +0800, Zhangshaokun wrote:
> I saw it in your trees, is it necessary to Cc stable version?

I don't think so, given that we don't actually support PRI upstream.

Will

> On 2018/7/23 20:56, Shaokun Zhang wrote:
> > From: Miao Zhong <zhongmiao-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
> > 
> > When PRI queue occurs overflow, driver should update the OVACKFLG to
> > the PRIQ consumer register, otherwise subsequent PRI requests will not
> > be processed.
> > 
> > Cc: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
> > Cc: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org> 
> > Signed-off-by: Miao Zhong <zhongmiao-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
> > ---
> >  drivers/iommu/arm-smmu-v3.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> > index 1d64710..deacc15 100644
> > --- a/drivers/iommu/arm-smmu-v3.c
> > +++ b/drivers/iommu/arm-smmu-v3.c
> > @@ -1301,6 +1301,7 @@ static irqreturn_t arm_smmu_priq_thread(int irq, void *dev)
> >  
> >  	/* Sync our overflow flag, as we believe we're up to speed */
> >  	q->cons = Q_OVF(q, q->prod) | Q_WRP(q, q->cons) | Q_IDX(q, q->cons);
> > +	writel(q->cons, q->cons_reg);
> >  	return IRQ_HANDLED;
> >  }
> >  
> > 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
@ 2018-07-27  9:48         ` Will Deacon
  0 siblings, 0 replies; 15+ messages in thread
From: Will Deacon @ 2018-07-27  9:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 27, 2018 at 05:41:46PM +0800, Zhangshaokun wrote:
> I saw it in your trees, is it necessary to Cc stable version?

I don't think so, given that we don't actually support PRI upstream.

Will

> On 2018/7/23 20:56, Shaokun Zhang wrote:
> > From: Miao Zhong <zhongmiao@hisilicon.com>
> > 
> > When PRI queue occurs overflow, driver should update the OVACKFLG to
> > the PRIQ consumer register, otherwise subsequent PRI requests will not
> > be processed.
> > 
> > Cc: Will Deacon <will.deacon@arm.com>
> > Cc: Robin Murphy <robin.murphy@arm.com> 
> > Signed-off-by: Miao Zhong <zhongmiao@hisilicon.com>
> > ---
> >  drivers/iommu/arm-smmu-v3.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> > index 1d64710..deacc15 100644
> > --- a/drivers/iommu/arm-smmu-v3.c
> > +++ b/drivers/iommu/arm-smmu-v3.c
> > @@ -1301,6 +1301,7 @@ static irqreturn_t arm_smmu_priq_thread(int irq, void *dev)
> >  
> >  	/* Sync our overflow flag, as we believe we're up to speed */
> >  	q->cons = Q_OVF(q, q->prod) | Q_WRP(q, q->cons) | Q_IDX(q, q->cons);
> > +	writel(q->cons, q->cons_reg);
> >  	return IRQ_HANDLED;
> >  }
> >  
> > 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
  2018-07-27  9:48         ` Will Deacon
@ 2018-07-27  9:59             ` Zhangshaokun
  -1 siblings, 0 replies; 15+ messages in thread
From: Zhangshaokun @ 2018-07-27  9:59 UTC (permalink / raw)
  To: Will Deacon
  Cc: Miao Zhong, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Robin Murphy, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r


On 2018/7/27 17:48, Will Deacon wrote:
> On Fri, Jul 27, 2018 at 05:41:46PM +0800, Zhangshaokun wrote:
>> I saw it in your trees, is it necessary to Cc stable version?
> 
> I don't think so, given that we don't actually support PRI upstream.
> 

Got it, thanks your reply.

Shaokun

> Will
> 
>> On 2018/7/23 20:56, Shaokun Zhang wrote:
>>> From: Miao Zhong <zhongmiao-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
>>>
>>> When PRI queue occurs overflow, driver should update the OVACKFLG to
>>> the PRIQ consumer register, otherwise subsequent PRI requests will not
>>> be processed.
>>>
>>> Cc: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
>>> Cc: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org> 
>>> Signed-off-by: Miao Zhong <zhongmiao-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
>>> ---
>>>  drivers/iommu/arm-smmu-v3.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
>>> index 1d64710..deacc15 100644
>>> --- a/drivers/iommu/arm-smmu-v3.c
>>> +++ b/drivers/iommu/arm-smmu-v3.c
>>> @@ -1301,6 +1301,7 @@ static irqreturn_t arm_smmu_priq_thread(int irq, void *dev)
>>>  
>>>  	/* Sync our overflow flag, as we believe we're up to speed */
>>>  	q->cons = Q_OVF(q, q->prod) | Q_WRP(q, q->cons) | Q_IDX(q, q->cons);
>>> +	writel(q->cons, q->cons_reg);
>>>  	return IRQ_HANDLED;
>>>  }
>>>  
>>>
>>
> 
> .
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
@ 2018-07-27  9:59             ` Zhangshaokun
  0 siblings, 0 replies; 15+ messages in thread
From: Zhangshaokun @ 2018-07-27  9:59 UTC (permalink / raw)
  To: linux-arm-kernel


On 2018/7/27 17:48, Will Deacon wrote:
> On Fri, Jul 27, 2018 at 05:41:46PM +0800, Zhangshaokun wrote:
>> I saw it in your trees, is it necessary to Cc stable version?
> 
> I don't think so, given that we don't actually support PRI upstream.
> 

Got it, thanks your reply.

Shaokun

> Will
> 
>> On 2018/7/23 20:56, Shaokun Zhang wrote:
>>> From: Miao Zhong <zhongmiao@hisilicon.com>
>>>
>>> When PRI queue occurs overflow, driver should update the OVACKFLG to
>>> the PRIQ consumer register, otherwise subsequent PRI requests will not
>>> be processed.
>>>
>>> Cc: Will Deacon <will.deacon@arm.com>
>>> Cc: Robin Murphy <robin.murphy@arm.com> 
>>> Signed-off-by: Miao Zhong <zhongmiao@hisilicon.com>
>>> ---
>>>  drivers/iommu/arm-smmu-v3.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
>>> index 1d64710..deacc15 100644
>>> --- a/drivers/iommu/arm-smmu-v3.c
>>> +++ b/drivers/iommu/arm-smmu-v3.c
>>> @@ -1301,6 +1301,7 @@ static irqreturn_t arm_smmu_priq_thread(int irq, void *dev)
>>>  
>>>  	/* Sync our overflow flag, as we believe we're up to speed */
>>>  	q->cons = Q_OVF(q, q->prod) | Q_WRP(q, q->cons) | Q_IDX(q, q->cons);
>>> +	writel(q->cons, q->cons_reg);
>>>  	return IRQ_HANDLED;
>>>  }
>>>  
>>>
>>
> 
> .
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
@ 2018-07-24  4:44 Zhongmiao
  0 siblings, 0 replies; 15+ messages in thread
From: Zhongmiao @ 2018-07-24  4:44 UTC (permalink / raw)
  To: Jean-Philippe Brucker, Zhangshaokun,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Leizhen (ThunderTown)
  Cc: Will Deacon


Hi,

On 24/07/18 12:45, Zhongmiao wrote:
> Yeah,    I haven't tested smmu  eventq  overflow ,  so i'm not sure if there is any problem with smmu eventq.  However, the code shows that there is also a problem after the smmu eventq overflows. ^_^…….

>There really shouldn't be any problem with the eventq. Handling the event overflow in my patch is mostly cosmetic and can be removed. See the Event queue overflow section of the SMMUv3 specification (IHI0070B):

>"Note: In terms of delivering events, a queue in an unacknowledged overflow state does not behave any differently to normal queue state. If software were to consume events and free space but leave overflow unacknowledged, new events could be recorded."

In the smmu v3 protocol ,  The processing of Priq overflow is different from that of Eventq. 

Thanks,
Miao
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
@ 2018-07-24  2:04 Zhongmiao
  0 siblings, 0 replies; 15+ messages in thread
From: Zhongmiao @ 2018-07-24  2:04 UTC (permalink / raw)
  To: Jean-Philippe Brucker, Zhangshaokun,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Leizhen (ThunderTown)
  Cc: Will Deacon


Hi ,

>"Note: In terms of delivering events, a queue in an unacknowledged overflow state does not behave any differently to normal queue state. If software were to consume events and free space but leave overflow unacknowledged, new events could be recorded."

Yeah, I agree with you . But I test  priq , It's going to be a problem.   And  See the PRI queue overflow section of the SMMUv3 specification (IHI0070A):

" Note: On detection of overflow, ARM recommends that software processes the received PRI queue entries as quickly as possible, and follows this with a single write of SMMU_PRIQ_CONS to simultaneously move on the RD pointer and acknowledge receipt of the overflow condition by setting OVACKFLG to the value read from OVFLG."

Thanks,
Miao

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
  2018-07-23 14:43 Zhongmiao
@ 2018-07-23 15:14     ` Jean-Philippe Brucker
  0 siblings, 0 replies; 15+ messages in thread
From: Jean-Philippe Brucker @ 2018-07-23 15:14 UTC (permalink / raw)
  To: Zhongmiao, Zhangshaokun,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Leizhen (ThunderTown)
  Cc: Will Deacon

Hi,

On 23/07/18 15:43, Zhongmiao wrote:
> Yeah,    I haven't tested smmu  eventq  overflow ,  so i'm not sure if there is any problem with smmu eventq.  However, the code shows that there is also a problem after the smmu eventq overflows. ^_^…….

There really shouldn't be any problem with the eventq. Handling the
event overflow in my patch is mostly cosmetic and can be removed. See
the Event queue overflow section of the SMMUv3 specification (IHI0070B):

"Note: In terms of delivering events, a queue in an unacknowledged
overflow state does not behave any differently to normal queue state. If
software were to consume events and free space but leave overflow
unacknowledged, new events could be recorded."

Thanks,
Jean
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
@ 2018-07-23 15:14     ` Jean-Philippe Brucker
  0 siblings, 0 replies; 15+ messages in thread
From: Jean-Philippe Brucker @ 2018-07-23 15:14 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 23/07/18 15:43, Zhongmiao wrote:
> Yeah,    I haven't tested smmu  eventq  overflow ,  so i'm not sure if there is any problem with smmu eventq.  However, the code shows that there is also a problem after the smmu eventq overflows. ^_^??.

There really shouldn't be any problem with the eventq. Handling the
event overflow in my patch is mostly cosmetic and can be removed. See
the Event queue overflow section of the SMMUv3 specification (IHI0070B):

"Note: In terms of delivering events, a queue in an unacknowledged
overflow state does not behave any differently to normal queue state. If
software were to consume events and free space but leave overflow
unacknowledged, new events could be recorded."

Thanks,
Jean

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
@ 2018-07-23 14:43 Zhongmiao
       [not found] ` <8CD08B4737CACA4ABE0228F45E441A916382021E-0LhPdUyVHB9UuCJht5byYAK1hpo4iccwjNknBlVQO8k@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Zhongmiao @ 2018-07-23 14:43 UTC (permalink / raw)
  To: Jean-Philippe Brucker, Zhangshaokun,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Leizhen (ThunderTown)
  Cc: Will Deacon

Hi Jean,

On 23/07/18 22:24, Miao  Zhong wrote:
> From: Miao Zhong <zhongmiao@hisilicon.com>
> 
> When PRI queue occurs overflow, driver should update the OVACKFLG to 
> the PRIQ consumer register, otherwise subsequent PRI requests will not 
> be processed.

>Since the upstream driver doesn't enable PRI in endpoints, I'm not sure this patch makes sense on its own, but it seems correct anyway. I had a similar patch in my initial SVA RFC, but for some reason dropped it in later versions (https://patchwork.kernel.org/patch/9594021/)

I have verified  this patch on  HiSilicon platform  and it works.

>It's worth noting that the event queue doesn't have the same problem, because the SMMU can record new events even if the overflow hasn't been acknowledged.

Yeah,    I haven't tested smmu  eventq  overflow ,  so i'm not sure if there is any problem with smmu eventq.  However, the code shows that there is also a problem after the smmu eventq overflows. ^_^…….

Thanks,
Miao

>Thanks,
>Jean



_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-07-27  9:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-23 12:56 [PATCH] iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register Shaokun Zhang
2018-07-23 12:56 ` Shaokun Zhang
     [not found] ` <1532350618-16486-1-git-send-email-zhangshaokun-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
2018-07-23 14:08   ` Jean-Philippe Brucker
2018-07-23 14:08     ` Jean-Philippe Brucker
2018-07-27  9:41   ` Zhangshaokun
2018-07-27  9:41     ` Zhangshaokun
     [not found]     ` <dfeaf347-afd4-b3f2-eb01-2781028371e8-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
2018-07-27  9:48       ` Will Deacon
2018-07-27  9:48         ` Will Deacon
     [not found]         ` <20180727094816.GM28088-5wv7dgnIgG8@public.gmane.org>
2018-07-27  9:59           ` Zhangshaokun
2018-07-27  9:59             ` Zhangshaokun
2018-07-23 14:43 Zhongmiao
     [not found] ` <8CD08B4737CACA4ABE0228F45E441A916382021E-0LhPdUyVHB9UuCJht5byYAK1hpo4iccwjNknBlVQO8k@public.gmane.org>
2018-07-23 15:14   ` Jean-Philippe Brucker
2018-07-23 15:14     ` Jean-Philippe Brucker
2018-07-24  2:04 Zhongmiao
2018-07-24  4:44 Zhongmiao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.