mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Anton Volkov <avolkov@ispras.ru>
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org,
	ldv-project@linuxtesting.org,
	Alexey Khoroshilov <khoroshilov@ispras.ru>
Subject: Re: Question about apds990x.ko
Date: Thu, 10 Aug 2017 08:07:55 -0700	[thread overview]
Message-ID: <20170810150755.GB8851@kroah.com> (raw)
In-Reply-To: <6bd7a5d0-97ef-4e04-6914-9e287c7be767@ispras.ru>

On Thu, Aug 10, 2017 at 05:57:30PM +0300, Anton Volkov wrote:
> Hello.
> 
> While searching for races in the Linux kernel I've come across
> "drivers/misc/apds990x.ko" module. Here are questions that I came up with
> while analyzing results. Lines are given using the info from Linux v4.12.
> 
> Consider the following case:
> 
> Thread 1:                      Thread 2:
> apds990x_suspend
> apds990x_resume                apds990x_irq
> -> apds990x_chip_on              if (!pm_runtime_suspended
>                                                   (chip->client->dev)){
>    -> apds990x_configure           if (status & APDS990X_ST_AINT) {
>         chip->again_meas = 1         chip->again_meas = chip->again_next
>         (apds990x.c: line 571)       (apds990x.c: line 505)
>                                    }
>                                   }
> 
> First question. Is this race feasible from your point of view?
> Second question. The check for the device suspension status
> (pm_runtime_suspended()) is present in the interrupt handler, but the
> functions pm_runtime_set_suspended / pm_runtime_set_active are not used in
> apds990x_suspend / apds990x_resume respectively. Do you know about any other
> method being used to make the modification of suspension status?

No idea, sorry.  Maybe the driver authors know?

greg k-h

  reply	other threads:[~2017-08-10 15:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10 14:57 Anton Volkov
2017-08-10 15:07 ` Greg KH [this message]
2017-08-10 15:11   ` Anton Volkov

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=20170810150755.GB8851@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=avolkov@ispras.ru \
    --cc=khoroshilov@ispras.ru \
    --cc=ldv-project@linuxtesting.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®