Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Bommu, Krishnaiah" <krishnaiah.bommu@intel.com>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: <igt-dev@lists.freedesktop.org>,
	Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Subject: Re: [PATCH i-g-t v3] tests/core_setmaster: Adjust loop control in tweak_perm
Date: Mon, 5 Aug 2024 10:59:32 +0530	[thread overview]
Message-ID: <5b52d3a3-2c3d-4668-b9f0-f11b4bdceee2@intel.com> (raw)
In-Reply-To: <CACvgo52=CF4Ms3eL16k_1yOJykvS6AMWvicW2NVF1cmrh_-1Fw@mail.gmail.com>

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


On 31-07-2024 23:26, Emil Velikov wrote:
> Hey everyone,
>
> On Wed, 31 Jul 2024 at 09:31, Bommu Krishnaiah
> <krishnaiah.bommu@intel.com> wrote:
>> The `tweak_perm` function now uses `continue` instead of `break` when
>> encountering non-existent card paths. This change addresses the assumption
>> in existing userspace that card paths are contiguous, which may not be true
>> if cards are dynamically removed.
>>
>> Problem Description:
>> The test fails after running the `core_hotunplug@hot*` subtest, where card0 is missing.
>> This leads to a failure in the subsequent `master-drop-set-user` test.
>>
>> Command sequence for reproducing the issue:
>> - Check available cards: `ls /dev/dri/`
>>    - Output: by-path  card0  renderD128
>> - Run the test: `# ./core_hotunplug --r hotrebind-lateclose`
>> - Check again: ‘ls /dev/dri/’
>>    - Output after failure: by-path  card1  renderD129
>> - Run the test: `# ./core_setmaster --r master-drop-set-user`
>>
>> This failures on both XE and i915 for above sequence.
>>
> The commit message is still a bit strange, but I'll refer that to your
> colleague who already gave you good tips.

tests/core_setmaster: Handle the test even if cards are non-continuous

Although most of userspace assumes drm cards to be populated continously,

this assumption may not be always true. After hot unpluging and 
repluging of card

the card may be non-continous.  To address such scenarios where the 
cards can be non-continous

modify the tweak_perm function to loop all possible 
cardnumbers(card0-card255) to confirm are they populated or not.

Problem Description:

The test fails after running the `core_hotunplug@hot*` subtest, where 
card0 is missing.

This leads to a failure in the subsequent `master-drop-set-user` test.

Command sequence for reproducing the issue:

- Check available cards: `ls /dev/dri/`

- Output: by-path  card0  renderD128

- Run the test: `# ./core_hotunplug --r hotrebind-lateclose`

- Check again: ‘ls /dev/dri/’

- Output after failure: by-path  card1  renderD129

- Run the test: `# ./core_setmaster --r master-drop-set-user`

This failures on both XE and i915 for above sequence.

> Fwiw the "existing usespace" refers to mesa, Xorg (both server and
> drivers) as well as gstreamer, if I recall correctly. There may be
> others assume there's no gaps.
here I am referring to IGT, may be as you said few may be continues, but 
this change works for continues also.
>> Signed-off-by: Bommu Krishnaiah<krishnaiah.bommu@intel.com>
>> Cc: Emil Velikov<emil.l.velikov@gmail.com>
>> Cc: Himal Prasad Ghimiray<himal.prasad.ghimiray@intel.com>
>> ---
>>   tests/core_setmaster.c | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/core_setmaster.c b/tests/core_setmaster.c
>> index 9c2083f66..a2758e2f2 100644
>> --- a/tests/core_setmaster.c
>> +++ b/tests/core_setmaster.c
>> @@ -116,9 +116,10 @@ static unsigned tweak_perm(uint8_t *saved_perm, unsigned max_perm, bool save)
>>          for (i = 0; i < max_perm; i++) {
>>                  snprintf(path, sizeof(path), "/dev/dri/card%u", i);
>>
>> -               /* Existing userspace assumes there's no gaps, do the same. */
>> +               /* Userspace cannot always have continuous card0...N due to
>> +                * dynamic unloading or removal of cards */
> Is this "dynamic unloading or removal of cards" a relatively new
> thing? Back when I wrote there test, unloading DRM modules wasn't
> supported (I believe) hence, it wasn't possible to have gaps.

I don't think dynamic unloading or removal of cards is new

core_hotunplug test verifies unloading of i915/xe driver module

>
> Or does this feature/work that only affects IGT and normal day-to-day
> userspace will never hit this case?

as I mentioned in commit message running sequence is not done before

Regards,

Krishna

>
> Should probably mention a word or two about this in the commit
> message/inline comment.
>
> HTH,
> Emil

[-- Attachment #2: Type: text/html, Size: 42776 bytes --]

  reply	other threads:[~2024-08-05  5:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31  8:20 [PATCH i-g-t v3] tests/core_setmaster: Adjust loop control in tweak_perm Bommu Krishnaiah
2024-07-31  9:06 ` ✓ CI.xeBAT: success for " Patchwork
2024-07-31  9:20 ` ✓ Fi.CI.BAT: " Patchwork
2024-07-31  9:53 ` ✗ CI.xeFULL: failure " Patchwork
2024-07-31 17:56 ` [PATCH i-g-t v3] " Emil Velikov
2024-08-05  5:29   ` Bommu, Krishnaiah [this message]
2024-07-31 23:31 ` ✗ Fi.CI.IGT: failure for " 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=5b52d3a3-2c3d-4668-b9f0-f11b4bdceee2@intel.com \
    --to=krishnaiah.bommu@intel.com \
    --cc=emil.l.velikov@gmail.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=igt-dev@lists.freedesktop.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