Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp649769imm; Sat, 7 Jul 2018 05:39:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe5KctS+0t0r8AUh+nwmbiIvZl/LzQ8RXMT8gfAbPEj9zmGnre5ryqMwVcPrM4nkI9ZT844 X-Received: by 2002:a65:6689:: with SMTP id b9-v6mr12499639pgw.326.1530967171376; Sat, 07 Jul 2018 05:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530967171; cv=none; d=google.com; s=arc-20160816; b=T/KJUDX+TzqYOOaQqTK5kfTlmRVetmLGDjvedFop5UFLKi4WEhwotXhU9ZArxwhh9N fF2NSs136p+m6jangykeIDyv6GeeGNDGaXEr8KuE8DSLfnNqkqytavfXxstwIy2BnB5t wRp9HJOj6yC41Elf1tsJDtJe6fHyJdymuC4y+lElVKhLKBCTU6IbkhvMnO7d2Pci3iDL CLd525TK6lB5TiZF9T7d7ukxFG0ruzI46hZdkLpzG1awog2LgBFI9CAdlF9a0LMWoPQG 3xxKWx9M/uATfIyKsR0rGu2FSh2D1m6fcDW9ooiS0VU4aB/3rdNA+4sNBlK0P5RmjxjA 6EUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=qZxRylQae11YeVpp0gIYNgza0FwB/lSPVwmU3koL+iM=; b=nfq5oRhWn2DgNjYkcWQHydzob+uFK7dYlhwQ8DIqwy7PjHq1Va3v3IQaR/FPSE7gRg 6F1svhSOrhADDzLIhkcDGFTEgIJDV+92o7gDkI2UnEgNF/S9XRLaNEo2kJWJmAGTyYHz fx5wXTH/T6VE5xv0sWCk3X3P7w4K400bcJRmlrBTyHcXlDt7wjpdAHlV1PEWJ6+XN/+h MXr5QJIfT32rjRMIRLd/ha5T+ZNcI4XE8NjpU0Sxzi5V6evnaOtK30rEKr9THNuAFUJ5 tRHjHj5KbqbMUdUAdo3AwTVvK6IOcpeQ/G6fWoAMBBJcPc7U39UhsKfjhMCKGvW3FN1c HLZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HQFGW3C9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5-v6si8653pln.405.2018.07.07.05.39.16; Sat, 07 Jul 2018 05:39:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HQFGW3C9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754067AbeGGMih (ORCPT + 99 others); Sat, 7 Jul 2018 08:38:37 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:41304 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753529AbeGGMif (ORCPT ); Sat, 7 Jul 2018 08:38:35 -0400 Received: by mail-pl0-f67.google.com with SMTP id w8-v6so4049188ply.8 for ; Sat, 07 Jul 2018 05:38:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=qZxRylQae11YeVpp0gIYNgza0FwB/lSPVwmU3koL+iM=; b=HQFGW3C9Ybo8gbwXtLxai3rrTnc3SzVa1LFds9XOYmrWSpaCd+NvuowXhbVZs3c0Dd p1thbAnNU/1F4tePzNiSlc4uj9+eiPsr5MCUkmAWsjZZUIBcuTbfu+wBgPC9YbtiGarl +BYalEsPp5C0puNah322GMzxyXEtLYSUzfJ+c+iuPbYsxPS2V/NtBtuIuzZYdikarsE1 wOfPSeJHZJ26Ae/OT7JqRPpPwnatY/X79QnIThcf6UePerd+TuaxHzedgoXZrXC6BtFy lbK7OqL9rTCqxtLzjfPGGfnQJJq4K0MLWTLLJVenmrnSc4snZ3c0HsdopPQUJcYeNoWk B59w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=qZxRylQae11YeVpp0gIYNgza0FwB/lSPVwmU3koL+iM=; b=AcoXt0dVNlpfBPHn32RT41m6lokmHjCC40ajgV8iUz5E0dm0TRA9hm+HaNUsLK1Tat N3Lsy6W8/DhDjKIX4TpAaN49XPj9vjL7bzHmxJDVD2oovdMFG00Kc6wdpxA909aXV3JM TeysbMcotqtXhaGI7N5kfXJuuCBU8p4jpycGuPLRwsYLvKzUVZEiZNWqvggJo+7orxvb hsigtNSVOrymGFCfXBUNrLmHbNTwoBpUh6hPcCIoYOAZN1tPBz/RYSINErkEiDLKJ13G YnUhsOLiJiJhQZZIAj5KvfDrPfCp2byMSjSkBV4cZLEGe44xetVAJjqZbowbETopzwbu iKzw== X-Gm-Message-State: APt69E0enyybElVngfW25NQTpL1mAba2zblJWGNO9ftkh47fqn2TiusX 4cdElppt9sX7RE71/rs+ECU= X-Received: by 2002:a17:902:342:: with SMTP id 60-v6mr13719880pld.311.1530965390233; Sat, 07 Jul 2018 05:09:50 -0700 (PDT) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.250.201? ([2402:f000:1:1501:200:5efe:a66f:fac9]) by smtp.gmail.com with ESMTPSA id n25-v6sm16621850pff.119.2018.07.07.05.09.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jul 2018 05:09:49 -0700 (PDT) Subject: Re: [PATCH] checkpatch: Add warnings for use of mdelay() To: Dan Carpenter Cc: Julia Lawall , Joe Perches , Prakruthi Deepak Heragu , apw@canonical.com, Dan Carpenter , linux-kernel@vger.kernel.org, ckadabi@codeaurora.org, tsoni@codeaurora.org, bryanh@codeaurora.org, Israel Schlesinger , Stepan Moskovchenko References: <1530728333-31590-1-git-send-email-pheragu@codeaurora.org> <173cc189627e0d6618b535fcd1ce6a4c90ce2ad0.camel@perches.com> <20180705081953.pmvpmtzm273eb6yk@mwanda> From: Jia-Ju Bai Message-ID: <8149bc56-7523-9c25-67fd-c92480917039@gmail.com> Date: Sat, 7 Jul 2018 20:09:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/7/6 13:49, Julia Lawall wrote: > > On Thu, 5 Jul 2018, Dan Carpenter wrote: > >> Neither Smatch nor Coccinelle do a good job tracking when you're in >> atomic context. I've wanted to add this to Smatch but even then it >> would be to warn that "We're holding a spinlock so we can't sleep". >> It's trickier to say for sure when you're not holding a lock... > Jia-Ju Bai is working on this. The tool is available on github. It's > still being improved, though, so perhaps it's not yet ready for eg 0-day > inclusion. He can give more details. Thanks for Julia's recommendation :) I am doing the similar work with Julia, from the beginning of this year. We develop two new LLVM-based tools to find two problems in the Linux kernel: (1) Sleeping in atomic context. The tool is named DSAC. (2) Using non-sleep function calls in non-atomic context. The tool is named DCNS. We handle two common examples of atomic context: (1) Holding a spinlock. (2) In an interrupt handler. DSAC and DCNS can basically work now, and some of the defects found by them have been confirmed and fixed in the Linux kernel. But these tools are still being improved. In fact, I encounter a hard problem when writing the tools, namely how to accurately and completely handle function pointer calls. I have handled the function pointer in form of data structure field, but I do not find a good way to handle the function pointer that is used as a function argument. Can someone give me good advice? We also have made slides introducing DSAC and DCNS tools. If you are interested in our work, I can send you the slides :) Best wishes, Jia-Ju Bai