All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: "Matthew Brost" <matthew.brost@intel.com>,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Mauro Carvalho Chehab" <mauro.chehab@linux.intel.com>,
	"Andi Shyti" <andi.shyti@linux.intel.com>,
	"David Airlie" <airlied@linux.ie>,
	"Mika Kuoppala" <mika.kuoppala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	"Chris Wilson" <chris@chris-wilson.co.uk>,
	"Thomas Hellstrom" <thomas.hellstrom@intel.com>,
	"Chris Wilson" <chris.p.wilson@intel.com>,
	"Fei Yang" <fei.yang@intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Dave Airlie" <airlied@redhat.com>,
	stable@vger.kernel.org,
	"Tejas Upadhyay" <tejaskumarx.surendrakumar.upadhyay@intel.com>,
	"Umesh Nerlige Ramappa" <umesh.nerlige.ramappa@intel.com>,
	"John Harrison" <John.C.Harrison@intel.com>,
	"Bruce Chang" <yu.bruce.chang@intel.com>
Subject: Re: [PATCH 5/6] drm/i915/gt: Serialize GRDOM access between multiple engine resets
Date: Thu, 30 Jun 2022 09:12:41 +0100	[thread overview]
Message-ID: <9477a8f1-3535-ed7f-c491-9ca9f27a10dc@linux.intel.com> (raw)
In-Reply-To: <20220630083256.35a56cb1@sal.lan>

[-- Attachment #1: Type: text/plain, Size: 6309 bytes --]


On 30/06/2022 08:32, Mauro Carvalho Chehab wrote:
> Em Wed, 29 Jun 2022 17:02:59 +0100
> Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> escreveu:
> 
>> On 29/06/2022 16:30, Mauro Carvalho Chehab wrote:
>>> On Tue, 28 Jun 2022 16:49:23 +0100
>>> Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
>>>    
>>>> .. which for me means a different patch 1, followed by patch 6 (moved
>>>> to be patch 2) would be ideal stable material.
>>>>
>>>> Then we have the current patch 2 which is open/unknown (to me at least).
>>>>
>>>> And the rest seem like optimisations which shouldn't be tagged as fixes.
>>>>
>>>> Apart from patch 5 which should be cc: stable, but no fixes as agreed.
>>>>
>>>> Could you please double check if what I am suggesting here is feasible
>>>> to implement and if it is just send those minimal patches out alone?
>>>
>>> Tested and porting just those 3 patches are enough to fix the Broadwell
>>> bug.
>>>
>>> So, I submitted a v2 of this series with just those. They all need to
>>> be backported to stable.
>>
>> I would really like to give even a smaller fix a try. Something like, although not even compile tested:
>>
>> commit 4d5e94aef164772f4d85b3b4c1a46eac9a2bd680
>> Author: Chris Wilson <chris.p.wilson@intel.com>
>> Date:   Wed Jun 29 16:25:24 2022 +0100
>>
>>       drm/i915/gt: Serialize TLB invalidates with GT resets
>>       
>>       Avoid trying to invalidate the TLB in the middle of performing an
>>       engine reset, as this may result in the reset timing out. Currently,
>>       the TLB invalidate is only serialised by its own mutex, forgoing the
>>       uncore lock, but we can take the uncore->lock as well to serialise
>>       the mmio access, thereby serialising with the GDRST.
>>       
>>       Tested on a NUC5i7RYB, BIOS RYBDWi35.86A.0380.2019.0517.1530 with
>>       i915 selftest/hangcheck.
>>       
>>       Cc: stable@vger.kernel.org
>>       Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
>>       Reported-by: Mauro Carvalho Chehab <mchehab@kernel.org>
>>       Tested-by: Mauro Carvalho Chehab <mchehab@kernel.org>
>>       Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>
>>       Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
>>       Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>>       Acked-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>>       Reviewed-by: Andi Shyti <andi.shyti@intel.com>
>>       Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
>>       Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
>> index 8da3314bb6bf..aaadd0b02043 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_gt.c
>> +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
>> @@ -952,7 +952,23 @@ void intel_gt_invalidate_tlbs(struct intel_gt *gt)
>>           mutex_lock(&gt->tlb_invalidate_lock);
>>           intel_uncore_forcewake_get(uncore, FORCEWAKE_ALL);
>>    
>> +       spin_lock_irq(&uncore->lock); /* serialise invalidate with GT reset */
>> +
>> +       for_each_engine(engine, gt, id) {
>> +               struct reg_and_bit rb;
>> +
>> +               rb = get_reg_and_bit(engine, regs == gen8_regs, regs, num);
>> +               if (!i915_mmio_reg_offset(rb.reg))
>> +                       continue;
>> +
>> +               intel_uncore_write_fw(uncore, rb.reg, rb.bit);
>> +       }
>> +
>> +       spin_unlock_irq(&uncore->lock);
>> +
>>           for_each_engine(engine, gt, id) {
>> +               struct reg_and_bit rb;
>> +
>>                   /*
>>                    * HW architecture suggest typical invalidation time at 40us,
>>                    * with pessimistic cases up to 100us and a recommendation to
>> @@ -960,13 +976,11 @@ void intel_gt_invalidate_tlbs(struct intel_gt *gt)
>>                    */
>>                   const unsigned int timeout_us = 100;
>>                   const unsigned int timeout_ms = 4;
>> -               struct reg_and_bit rb;
>>    
>>                   rb = get_reg_and_bit(engine, regs == gen8_regs, regs, num);
>>                   if (!i915_mmio_reg_offset(rb.reg))
>>                           continue;
>>    
>> -               intel_uncore_write_fw(uncore, rb.reg, rb.bit);
>>                   if (__intel_wait_for_register_fw(uncore,
>>                                                    rb.reg, rb.bit, 0,
>>                                                    timeout_us, timeout_ms,
>>
> 
> This won't work, as it is not serializing TLB cache invalidation with
> i915 resets. Besides that, this is more or less merging patches 1 and 3,

Could you explain why you think it is not doing exactly that? In both 
versions end result is TLB flush requests are under the uncore lock and 
waits are outside it.

> placing patches with different rationales altogether. Upstream rule is
> to have one logical change per patch.

I don't think it applies in this case. It is simply splitting into two 
loops so lock can be held across all mmio writes. I think of it this way 
- what is the rationale for sending only the first patch to stable? What 
does it _fix_ on it's own?

>> If this works it would be least painful to backport. The other improvements can then be devoid of the fixes tag.
> 
>  From backport PoV, it wouldn't make any difference applying one patch
> or two. See, intel_gt_invalidate_tlbs() function doesn't exist before
> changeset 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store"),
> so, it shouldn't have merge conflicts while backporting it, maybe except
> if some functions it calls (or parameters) have changed. On such case,
> the backport fix should be trivial, and the end result of backporting
> one folded patch or two would be the same.

Yes a lot of things changed. Not least engine and GT pm code. Note that 
TLB flushing was backported all the way to 4.4 so any hunk you don't 
strictly need can and will bite you. I have attached a tarball of 
patches for you to explore. :)
Regards,

Tvrtko

> If any conflict happens, I can help doing the backports.
> 
>>> I still think that other TLB patches are needed/desired upstream, but
>>> I'll submit them on a separate series. Let's fix the regression first ;-)
>>
>> Yep, that's exactly right.
>>
>> Regards,
>>
>> Tvrtko

[-- Attachment #2: tlbflush-220114-patches.tar.gz --]
[-- Type: application/gzip, Size: 10180 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Mauro Carvalho Chehab" <mauro.chehab@linux.intel.com>,
	"David Airlie" <airlied@linux.ie>,
	intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	"Chris Wilson" <chris@chris-wilson.co.uk>,
	"Thomas Hellstrom" <thomas.hellstrom@intel.com>,
	"Chris Wilson" <chris.p.wilson@intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Dave Airlie" <airlied@redhat.com>,
	stable@vger.kernel.org,
	"Tejas Upadhyay" <tejaskumarx.surendrakumar.upadhyay@intel.com>
Subject: Re: [Intel-gfx] [PATCH 5/6] drm/i915/gt: Serialize GRDOM access between multiple engine resets
Date: Thu, 30 Jun 2022 09:12:41 +0100	[thread overview]
Message-ID: <9477a8f1-3535-ed7f-c491-9ca9f27a10dc@linux.intel.com> (raw)
In-Reply-To: <20220630083256.35a56cb1@sal.lan>

[-- Attachment #1: Type: text/plain, Size: 6309 bytes --]


On 30/06/2022 08:32, Mauro Carvalho Chehab wrote:
> Em Wed, 29 Jun 2022 17:02:59 +0100
> Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> escreveu:
> 
>> On 29/06/2022 16:30, Mauro Carvalho Chehab wrote:
>>> On Tue, 28 Jun 2022 16:49:23 +0100
>>> Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
>>>    
>>>> .. which for me means a different patch 1, followed by patch 6 (moved
>>>> to be patch 2) would be ideal stable material.
>>>>
>>>> Then we have the current patch 2 which is open/unknown (to me at least).
>>>>
>>>> And the rest seem like optimisations which shouldn't be tagged as fixes.
>>>>
>>>> Apart from patch 5 which should be cc: stable, but no fixes as agreed.
>>>>
>>>> Could you please double check if what I am suggesting here is feasible
>>>> to implement and if it is just send those minimal patches out alone?
>>>
>>> Tested and porting just those 3 patches are enough to fix the Broadwell
>>> bug.
>>>
>>> So, I submitted a v2 of this series with just those. They all need to
>>> be backported to stable.
>>
>> I would really like to give even a smaller fix a try. Something like, although not even compile tested:
>>
>> commit 4d5e94aef164772f4d85b3b4c1a46eac9a2bd680
>> Author: Chris Wilson <chris.p.wilson@intel.com>
>> Date:   Wed Jun 29 16:25:24 2022 +0100
>>
>>       drm/i915/gt: Serialize TLB invalidates with GT resets
>>       
>>       Avoid trying to invalidate the TLB in the middle of performing an
>>       engine reset, as this may result in the reset timing out. Currently,
>>       the TLB invalidate is only serialised by its own mutex, forgoing the
>>       uncore lock, but we can take the uncore->lock as well to serialise
>>       the mmio access, thereby serialising with the GDRST.
>>       
>>       Tested on a NUC5i7RYB, BIOS RYBDWi35.86A.0380.2019.0517.1530 with
>>       i915 selftest/hangcheck.
>>       
>>       Cc: stable@vger.kernel.org
>>       Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
>>       Reported-by: Mauro Carvalho Chehab <mchehab@kernel.org>
>>       Tested-by: Mauro Carvalho Chehab <mchehab@kernel.org>
>>       Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>
>>       Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
>>       Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>>       Acked-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>>       Reviewed-by: Andi Shyti <andi.shyti@intel.com>
>>       Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
>>       Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
>> index 8da3314bb6bf..aaadd0b02043 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_gt.c
>> +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
>> @@ -952,7 +952,23 @@ void intel_gt_invalidate_tlbs(struct intel_gt *gt)
>>           mutex_lock(&gt->tlb_invalidate_lock);
>>           intel_uncore_forcewake_get(uncore, FORCEWAKE_ALL);
>>    
>> +       spin_lock_irq(&uncore->lock); /* serialise invalidate with GT reset */
>> +
>> +       for_each_engine(engine, gt, id) {
>> +               struct reg_and_bit rb;
>> +
>> +               rb = get_reg_and_bit(engine, regs == gen8_regs, regs, num);
>> +               if (!i915_mmio_reg_offset(rb.reg))
>> +                       continue;
>> +
>> +               intel_uncore_write_fw(uncore, rb.reg, rb.bit);
>> +       }
>> +
>> +       spin_unlock_irq(&uncore->lock);
>> +
>>           for_each_engine(engine, gt, id) {
>> +               struct reg_and_bit rb;
>> +
>>                   /*
>>                    * HW architecture suggest typical invalidation time at 40us,
>>                    * with pessimistic cases up to 100us and a recommendation to
>> @@ -960,13 +976,11 @@ void intel_gt_invalidate_tlbs(struct intel_gt *gt)
>>                    */
>>                   const unsigned int timeout_us = 100;
>>                   const unsigned int timeout_ms = 4;
>> -               struct reg_and_bit rb;
>>    
>>                   rb = get_reg_and_bit(engine, regs == gen8_regs, regs, num);
>>                   if (!i915_mmio_reg_offset(rb.reg))
>>                           continue;
>>    
>> -               intel_uncore_write_fw(uncore, rb.reg, rb.bit);
>>                   if (__intel_wait_for_register_fw(uncore,
>>                                                    rb.reg, rb.bit, 0,
>>                                                    timeout_us, timeout_ms,
>>
> 
> This won't work, as it is not serializing TLB cache invalidation with
> i915 resets. Besides that, this is more or less merging patches 1 and 3,

Could you explain why you think it is not doing exactly that? In both 
versions end result is TLB flush requests are under the uncore lock and 
waits are outside it.

> placing patches with different rationales altogether. Upstream rule is
> to have one logical change per patch.

I don't think it applies in this case. It is simply splitting into two 
loops so lock can be held across all mmio writes. I think of it this way 
- what is the rationale for sending only the first patch to stable? What 
does it _fix_ on it's own?

>> If this works it would be least painful to backport. The other improvements can then be devoid of the fixes tag.
> 
>  From backport PoV, it wouldn't make any difference applying one patch
> or two. See, intel_gt_invalidate_tlbs() function doesn't exist before
> changeset 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store"),
> so, it shouldn't have merge conflicts while backporting it, maybe except
> if some functions it calls (or parameters) have changed. On such case,
> the backport fix should be trivial, and the end result of backporting
> one folded patch or two would be the same.

Yes a lot of things changed. Not least engine and GT pm code. Note that 
TLB flushing was backported all the way to 4.4 so any hunk you don't 
strictly need can and will bite you. I have attached a tarball of 
patches for you to explore. :)
Regards,

Tvrtko

> If any conflict happens, I can help doing the backports.
> 
>>> I still think that other TLB patches are needed/desired upstream, but
>>> I'll submit them on a separate series. Let's fix the regression first ;-)
>>
>> Yep, that's exactly right.
>>
>> Regards,
>>
>> Tvrtko

[-- Attachment #2: tlbflush-220114-patches.tar.gz --]
[-- Type: application/gzip, Size: 10180 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: "Mauro Carvalho Chehab" <mauro.chehab@linux.intel.com>,
	"David Airlie" <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org,
	"Chris Wilson" <chris@chris-wilson.co.uk>,
	"Fei Yang" <fei.yang@intel.com>,
	"Matthew Brost" <matthew.brost@intel.com>,
	"Mika Kuoppala" <mika.kuoppala@linux.intel.com>,
	"Chris Wilson" <chris.p.wilson@intel.com>,
	"Andi Shyti" <andi.shyti@linux.intel.com>,
	"Dave Airlie" <airlied@redhat.com>,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	intel-gfx@lists.freedesktop.org,
	"Thomas Hellstrom" <thomas.hellstrom@intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	"Bruce Chang" <yu.bruce.chang@intel.com>,
	"Tejas Upadhyay" <tejaskumarx.surendrakumar.upadhyay@intel.com>,
	"Umesh Nerlige Ramappa" <umesh.nerlige.ramappa@intel.com>,
	"John Harrison" <John.C.Harrison@intel.com>
Subject: Re: [PATCH 5/6] drm/i915/gt: Serialize GRDOM access between multiple engine resets
Date: Thu, 30 Jun 2022 09:12:41 +0100	[thread overview]
Message-ID: <9477a8f1-3535-ed7f-c491-9ca9f27a10dc@linux.intel.com> (raw)
In-Reply-To: <20220630083256.35a56cb1@sal.lan>

[-- Attachment #1: Type: text/plain, Size: 6309 bytes --]


On 30/06/2022 08:32, Mauro Carvalho Chehab wrote:
> Em Wed, 29 Jun 2022 17:02:59 +0100
> Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> escreveu:
> 
>> On 29/06/2022 16:30, Mauro Carvalho Chehab wrote:
>>> On Tue, 28 Jun 2022 16:49:23 +0100
>>> Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
>>>    
>>>> .. which for me means a different patch 1, followed by patch 6 (moved
>>>> to be patch 2) would be ideal stable material.
>>>>
>>>> Then we have the current patch 2 which is open/unknown (to me at least).
>>>>
>>>> And the rest seem like optimisations which shouldn't be tagged as fixes.
>>>>
>>>> Apart from patch 5 which should be cc: stable, but no fixes as agreed.
>>>>
>>>> Could you please double check if what I am suggesting here is feasible
>>>> to implement and if it is just send those minimal patches out alone?
>>>
>>> Tested and porting just those 3 patches are enough to fix the Broadwell
>>> bug.
>>>
>>> So, I submitted a v2 of this series with just those. They all need to
>>> be backported to stable.
>>
>> I would really like to give even a smaller fix a try. Something like, although not even compile tested:
>>
>> commit 4d5e94aef164772f4d85b3b4c1a46eac9a2bd680
>> Author: Chris Wilson <chris.p.wilson@intel.com>
>> Date:   Wed Jun 29 16:25:24 2022 +0100
>>
>>       drm/i915/gt: Serialize TLB invalidates with GT resets
>>       
>>       Avoid trying to invalidate the TLB in the middle of performing an
>>       engine reset, as this may result in the reset timing out. Currently,
>>       the TLB invalidate is only serialised by its own mutex, forgoing the
>>       uncore lock, but we can take the uncore->lock as well to serialise
>>       the mmio access, thereby serialising with the GDRST.
>>       
>>       Tested on a NUC5i7RYB, BIOS RYBDWi35.86A.0380.2019.0517.1530 with
>>       i915 selftest/hangcheck.
>>       
>>       Cc: stable@vger.kernel.org
>>       Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
>>       Reported-by: Mauro Carvalho Chehab <mchehab@kernel.org>
>>       Tested-by: Mauro Carvalho Chehab <mchehab@kernel.org>
>>       Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>
>>       Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
>>       Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>>       Acked-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>>       Reviewed-by: Andi Shyti <andi.shyti@intel.com>
>>       Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
>>       Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
>> index 8da3314bb6bf..aaadd0b02043 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_gt.c
>> +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
>> @@ -952,7 +952,23 @@ void intel_gt_invalidate_tlbs(struct intel_gt *gt)
>>           mutex_lock(&gt->tlb_invalidate_lock);
>>           intel_uncore_forcewake_get(uncore, FORCEWAKE_ALL);
>>    
>> +       spin_lock_irq(&uncore->lock); /* serialise invalidate with GT reset */
>> +
>> +       for_each_engine(engine, gt, id) {
>> +               struct reg_and_bit rb;
>> +
>> +               rb = get_reg_and_bit(engine, regs == gen8_regs, regs, num);
>> +               if (!i915_mmio_reg_offset(rb.reg))
>> +                       continue;
>> +
>> +               intel_uncore_write_fw(uncore, rb.reg, rb.bit);
>> +       }
>> +
>> +       spin_unlock_irq(&uncore->lock);
>> +
>>           for_each_engine(engine, gt, id) {
>> +               struct reg_and_bit rb;
>> +
>>                   /*
>>                    * HW architecture suggest typical invalidation time at 40us,
>>                    * with pessimistic cases up to 100us and a recommendation to
>> @@ -960,13 +976,11 @@ void intel_gt_invalidate_tlbs(struct intel_gt *gt)
>>                    */
>>                   const unsigned int timeout_us = 100;
>>                   const unsigned int timeout_ms = 4;
>> -               struct reg_and_bit rb;
>>    
>>                   rb = get_reg_and_bit(engine, regs == gen8_regs, regs, num);
>>                   if (!i915_mmio_reg_offset(rb.reg))
>>                           continue;
>>    
>> -               intel_uncore_write_fw(uncore, rb.reg, rb.bit);
>>                   if (__intel_wait_for_register_fw(uncore,
>>                                                    rb.reg, rb.bit, 0,
>>                                                    timeout_us, timeout_ms,
>>
> 
> This won't work, as it is not serializing TLB cache invalidation with
> i915 resets. Besides that, this is more or less merging patches 1 and 3,

Could you explain why you think it is not doing exactly that? In both 
versions end result is TLB flush requests are under the uncore lock and 
waits are outside it.

> placing patches with different rationales altogether. Upstream rule is
> to have one logical change per patch.

I don't think it applies in this case. It is simply splitting into two 
loops so lock can be held across all mmio writes. I think of it this way 
- what is the rationale for sending only the first patch to stable? What 
does it _fix_ on it's own?

>> If this works it would be least painful to backport. The other improvements can then be devoid of the fixes tag.
> 
>  From backport PoV, it wouldn't make any difference applying one patch
> or two. See, intel_gt_invalidate_tlbs() function doesn't exist before
> changeset 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store"),
> so, it shouldn't have merge conflicts while backporting it, maybe except
> if some functions it calls (or parameters) have changed. On such case,
> the backport fix should be trivial, and the end result of backporting
> one folded patch or two would be the same.

Yes a lot of things changed. Not least engine and GT pm code. Note that 
TLB flushing was backported all the way to 4.4 so any hunk you don't 
strictly need can and will bite you. I have attached a tarball of 
patches for you to explore. :)
Regards,

Tvrtko

> If any conflict happens, I can help doing the backports.
> 
>>> I still think that other TLB patches are needed/desired upstream, but
>>> I'll submit them on a separate series. Let's fix the regression first ;-)
>>
>> Yep, that's exactly right.
>>
>> Regards,
>>
>> Tvrtko

[-- Attachment #2: tlbflush-220114-patches.tar.gz --]
[-- Type: application/gzip, Size: 10180 bytes --]

  reply	other threads:[~2022-06-30  8:12 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 15:27 [PATCH 0/6] Fix TLB invalidate issues with Broadwell Mauro Carvalho Chehab
2022-06-15 15:27 ` Mauro Carvalho Chehab
2022-06-15 15:27 ` [Intel-gfx] " Mauro Carvalho Chehab
2022-06-15 15:27 ` [PATCH 1/6] drm/i915/gt: Ignore TLB invalidations on idle engines Mauro Carvalho Chehab
2022-06-15 15:27   ` Mauro Carvalho Chehab
2022-06-15 15:27   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-06-16  7:21   ` Tvrtko Ursulin
2022-06-16  7:21     ` [Intel-gfx] " Tvrtko Ursulin
2022-06-16  7:21     ` Tvrtko Ursulin
2022-06-23 11:04   ` Andi Shyti
2022-06-23 11:04     ` [Intel-gfx] " Andi Shyti
2022-06-23 11:04     ` Andi Shyti
2022-06-15 15:27 ` [PATCH 2/6] drm/i915/gt: Invalidate TLB of the OA unit at TLB invalidations Mauro Carvalho Chehab
2022-06-15 15:27   ` Mauro Carvalho Chehab
2022-06-15 15:27   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-06-15 17:03   ` Umesh Nerlige Ramappa
2022-06-15 17:03     ` Umesh Nerlige Ramappa
2022-06-23 11:07   ` Andi Shyti
2022-06-23 11:07     ` [Intel-gfx] " Andi Shyti
2022-06-23 11:07     ` Andi Shyti
2022-06-15 15:27 ` [PATCH 3/6] drm/i915/gt: Skip TLB invalidations once wedged Mauro Carvalho Chehab
2022-06-15 15:27   ` Mauro Carvalho Chehab
2022-06-15 15:27   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-06-16  7:25   ` Tvrtko Ursulin
2022-06-16  7:25     ` [Intel-gfx] " Tvrtko Ursulin
2022-06-16  7:25     ` Tvrtko Ursulin
2022-06-23 11:08   ` Andi Shyti
2022-06-23 11:08     ` [Intel-gfx] " Andi Shyti
2022-06-23 11:08     ` Andi Shyti
2022-06-15 15:27 ` [PATCH 4/6] drm/i915/gt: Only invalidate TLBs exposed to user manipulation Mauro Carvalho Chehab
2022-06-15 15:27   ` Mauro Carvalho Chehab
2022-06-15 15:27   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-06-16  7:33   ` Tvrtko Ursulin
2022-06-16  7:33     ` [Intel-gfx] " Tvrtko Ursulin
2022-06-16  7:33     ` Tvrtko Ursulin
2022-06-23 11:13   ` Andi Shyti
2022-06-23 11:13     ` [Intel-gfx] " Andi Shyti
2022-06-23 11:13     ` Andi Shyti
2022-06-15 15:27 ` [PATCH 5/6] drm/i915/gt: Serialize GRDOM access between multiple engine resets Mauro Carvalho Chehab
2022-06-15 15:27   ` Mauro Carvalho Chehab
2022-06-15 15:27   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-06-16  7:35   ` Tvrtko Ursulin
2022-06-16  7:35     ` [Intel-gfx] " Tvrtko Ursulin
2022-06-16  7:35     ` Tvrtko Ursulin
2022-06-23 11:17   ` Andi Shyti
2022-06-23 11:17     ` [Intel-gfx] " Andi Shyti
2022-06-23 11:17     ` Andi Shyti
2022-06-24  8:34     ` Tvrtko Ursulin
2022-06-24  8:34       ` [Intel-gfx] " Tvrtko Ursulin
2022-06-24  8:34       ` Tvrtko Ursulin
2022-06-27  9:00       ` Mauro Carvalho Chehab
2022-06-27  9:00         ` Mauro Carvalho Chehab
2022-06-27  9:00         ` [Intel-gfx] " Mauro Carvalho Chehab
2022-06-28 15:49         ` Tvrtko Ursulin
2022-06-28 15:49           ` [Intel-gfx] " Tvrtko Ursulin
2022-06-28 15:49           ` Tvrtko Ursulin
2022-06-29 15:30           ` Mauro Carvalho Chehab
2022-06-29 15:30             ` [Intel-gfx] " Mauro Carvalho Chehab
2022-06-29 15:30             ` Mauro Carvalho Chehab
2022-06-29 16:02             ` Tvrtko Ursulin
2022-06-29 16:02               ` Tvrtko Ursulin
2022-06-29 16:02               ` [Intel-gfx] " Tvrtko Ursulin
2022-06-30  7:32               ` Mauro Carvalho Chehab
2022-06-30  7:32                 ` [Intel-gfx] " Mauro Carvalho Chehab
2022-06-30  7:32                 ` Mauro Carvalho Chehab
2022-06-30  8:12                 ` Tvrtko Ursulin [this message]
2022-06-30  8:12                   ` Tvrtko Ursulin
2022-06-30  8:12                   ` [Intel-gfx] " Tvrtko Ursulin
2022-06-30 16:01                   ` Mauro Carvalho Chehab
2022-06-30 16:01                     ` [Intel-gfx] " Mauro Carvalho Chehab
2022-06-30 16:01                     ` Mauro Carvalho Chehab
2022-07-01  7:56                     ` Tvrtko Ursulin
2022-07-01  7:56                       ` [Intel-gfx] " Tvrtko Ursulin
2022-07-01  7:56                       ` Tvrtko Ursulin
2022-07-04  8:42                       ` Mauro Carvalho Chehab
2022-07-04  8:42                         ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-04  8:42                         ` Mauro Carvalho Chehab
2022-06-15 15:27 ` [PATCH 6/6] drm/i915/gt: Serialize TLB invalidates with GT resets Mauro Carvalho Chehab
2022-06-15 15:27   ` Mauro Carvalho Chehab
2022-06-15 15:27   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-06-23 11:18   ` Andi Shyti
2022-06-23 11:18     ` [Intel-gfx] " Andi Shyti
2022-06-23 11:18     ` Andi Shyti
2022-06-15 17:26 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Fix TLB invalidate issues with Broadwell Patchwork
2022-06-15 17:26 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-06-15 17:48 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-06-15 23:45 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

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=9477a8f1-3535-ed7f-c491-9ca9f27a10dc@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=John.C.Harrison@intel.com \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=chris.p.wilson@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fei.yang@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.brost@intel.com \
    --cc=mauro.chehab@linux.intel.com \
    --cc=mchehab@kernel.org \
    --cc=mika.kuoppala@linux.intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=tejaskumarx.surendrakumar.upadhyay@intel.com \
    --cc=thomas.hellstrom@intel.com \
    --cc=thomas.hellstrom@linux.intel.com \
    --cc=umesh.nerlige.ramappa@intel.com \
    --cc=yu.bruce.chang@intel.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 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.