lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 5 May 2020 16:53:18 +0200
From:   Pavel Machek <pavel@...x.de>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Pavel Machek <pavel@...x.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Stable <stable@...r.kernel.org>,
        Dan Williams <dan.j.williams@...el.com>,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Vinod Koul <vkoul@...nel.org>
Subject: Re: [PATCH 4.19 28/37] dmaengine: dmatest: Fix iteration non-stop
 logic

On Tue 2020-05-05 17:05:37, Andy Shevchenko wrote:
> On Tue, May 5, 2020 at 4:37 PM Pavel Machek <pavel@...x.de> wrote:
> > On Tue 2020-05-05 16:19:11, Andy Shevchenko wrote:
> > > On Tue, May 5, 2020 at 3:58 PM Pavel Machek <pavel@...x.de> wrote:
> > > > On Tue 2020-05-05 15:51:16, Andy Shevchenko wrote:
> > > > > On Tue, May 5, 2020 at 3:37 PM Pavel Machek <pavel@...x.de> wrote:
> > > > > > > So, to the point, the conditional of checking the thread to be stopped being
> > > > > > > first part of conjunction logic prevents to check iterations. Thus, we have to
> > > > > > > always check both conditions
> 
> vvv
> >>>>>> to be able to stop after given iterations.
> ^^^

_If_ you are already stopping due to kthread_should_stop(), you don't
need to check iterations.

If you are not stopping, iterations are always checked.

No, the new code does not "always check both conditions" as you claim.

> Yes. Please, read carefully the commit message (for your convenience I
> emphasized above). I don't want to spend time on this basics stuff
> anymore.

You may want to go through the basics once more. The change clearly
does not do what you said it does; in fact, it does not do anything.

> > If you wanted both conditions to always evaluate, you'd have to do
> >
> > #       while (!kthread_should_stop()
> > #              & !(params->iterations && total_tests >=
> > #              params->iterations)) {
> >
> > (note && -> &). But, again, there's no reason to do that, as second
> > part of expression does not have side effects.
> 
> It fixes a bug in the code, try with and without this change. (I can
> reproduce it here)

I'm not sure if you made mistake during testing, or if you have buggy
compiler or what...
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists