Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752982AbdHJO5f (ORCPT ); Thu, 10 Aug 2017 10:57:35 -0400 Received: from mail.ispras.ru ([83.149.199.45]:39824 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752702AbdHJO5d (ORCPT ); Thu, 10 Aug 2017 10:57:33 -0400 From: Anton Volkov Subject: Question about apds990x.ko To: arnd@arndb.de, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org, Alexey Khoroshilov Message-ID: <6bd7a5d0-97ef-4e04-6914-9e287c7be767@ispras.ru> Date: Thu, 10 Aug 2017 17:57:30 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1313 Lines: 33 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? Thank you for your time. -- Anton Volkov Linux Verification Center, ISPRAS web: http://linuxtesting.org e-mail: avolkov@ispras.ru