From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
Cc: igt-dev@lists.freedesktop.org, petri.latvala@intel.com
Subject: Re: [igt-dev] [PATCH i-g-t 1/1] lib/igt_device_scan: clear igt_devs.devs_scanned in igt_devices_free
Date: Wed, 28 Sep 2022 20:45:37 +0200 [thread overview]
Message-ID: <YzSWUSbp7RiarFMI@zkempczy-mobl2> (raw)
In-Reply-To: <87tu52ca09.wl-ashutosh.dixit@intel.com>
On Tue, Sep 20, 2022 at 08:59:18AM -0700, Dixit, Ashutosh wrote:
> On Thu, 15 Sep 2022 06:57:39 -0700, Riana Tauro wrote:
> >
>
> Hi Riana,
>
> > igt_devices_scan returns with empty list if devs_scanned
> > is true and function is called after igt_devices_free
> >
> > clear igt_devs.devs_scanned in igt_devices_free.
>
> The patch seems reasonable but could you please describe where you saw this
> issue? It seems 'igt_devices_scan(true)' (called with force == true) will
> get past this issue. Not too familiar with igt_devices_scan() usage so
> copying some more people.
>
> Also I am not sure why igt_devices_scan() doesn't simply do this:
>
> void igt_devices_scan(bool force)
> {
> if (force && igt_devs.devs_scanned) {
> igt_devices_free();
>
> /* Not needed after this patch */
> igt_devs.devs_scanned = false;
> }
>
>
>
> Thanks.
> --
> Ashutosh
Agree with you. igt_devices_free() should also mark devs_scanned = false
to ensure it will be rescanned regardless force argument. And freeing
code in igt_devices_scan() is redundant now.
@Riana
Please resubmit with:
void igt_devices_scan(bool force)
{
if (force && igt_devs.devs_scanned)
igt_devices_free();
... rest is ok ...
}
and add igt_devs.devs_scanned = false to igt_devices_free().
IMO CI shouldn't complain and this redundancy will be removed.
Thanks
--
Zbigniew
>
>
> >
> > Signed-off-by: Riana Tauro <riana.tauro@intel.com>
> > ---
> > lib/igt_device_scan.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/lib/igt_device_scan.c b/lib/igt_device_scan.c
> > index eb6b45b8..e7c05d5c 100644
> > --- a/lib/igt_device_scan.c
> > +++ b/lib/igt_device_scan.c
> > @@ -1030,6 +1030,7 @@ void igt_devices_free(void)
> > igt_device_free(dev);
> > free(dev);
> > }
> > + igt_devs.devs_scanned = false;
> > }
> >
> > /**
> > --
> > 2.25.1
> >
next prev parent reply other threads:[~2022-09-28 18:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 13:57 [igt-dev] [PATCH i-g-t 0/1] clear igt_devs.devs_scanned in igt_devices_free Riana Tauro
2022-09-15 13:57 ` [igt-dev] [PATCH i-g-t 1/1] lib/igt_device_scan: " Riana Tauro
2022-09-16 5:22 ` Tauro, Riana
2022-09-20 15:59 ` Dixit, Ashutosh
2022-09-20 16:51 ` Tauro, Riana
2022-09-28 18:45 ` Zbigniew Kempczyński [this message]
2022-09-15 15:30 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2022-09-16 2:17 ` [igt-dev] ✓ Fi.CI.IGT: " 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=YzSWUSbp7RiarFMI@zkempczy-mobl2 \
--to=zbigniew.kempczynski@intel.com \
--cc=ashutosh.dixit@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=petri.latvala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox