Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3474913imm; Sun, 16 Sep 2018 19:49:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYGoUEJuIqKi8Xyw3Ytjp77m9FsYJ7CnMQSR93I8MPZ+8W0bPnHiyTlaanazkBn35dcP41m X-Received: by 2002:a63:344b:: with SMTP id b72-v6mr21570850pga.184.1537152550318; Sun, 16 Sep 2018 19:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537152550; cv=none; d=google.com; s=arc-20160816; b=YcYjyudJW6F19whguFDzGP7MzkR+Amh76yY5u7gOBxuZ7jokvGsTDCwPJH2oHS6xb0 Wq49blnNGQQELszxp3yQd/ix+ytebRarwuU5fyj3IgJqkS5dBUj0ar9FmFS9dgYc1yzl 8yWCeoefYfIYrbE4blqSYlb2vr9QD98Ikr+iaRHIYnxqLb36gewapz/JaWrzRN+h/Yys +tiYfECmdfmLysXTHPeoPHMYtToGEo7KBdDNsc2t71FsAorMgKZc5DjkeNAHoKL0j5yj Y8Hv1Dwxg/jzl0X5ki9mElVyQJ0VVzKRHDPYfgmUVkfzKs1KKS+dOuOtlDuU6HB2lLsS TeXA== 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; bh=b+W2KgD1+35cPMUuyiWExE3u77Z/RdE9Diza4aKRjG0=; b=egpEJtyt8Ro6HSxQ3QIB8acpX1k4UzPy1mpaA0wweHJInn9Cxdn6Fi0NPTP+5OGPB2 iPkgL0xN3YuAd3bwqon5ScISEg/4i6JXzdUEdYLh09ay6Gy6XaUE1xOyuL7+rminfG6W kZc7rD2VTuKnrhKg3BmUO1Ju3cp475GgYjSwik2vSSB+prjBm5gqOtUpzxd9Ylo78pEB Y5K8PMklrB6sTTtoLWtk85v9Y8VAIVNN7Tr9iMQvCExXVJimyZUoFye72CCTnudlG2MT zr7woDwSnlaB3VnwXWwme6f/X0WNd2oujRQ5/22q6/Z1UflU1N9XsTQ3K2AFmZ81xcs5 alZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S+WGFkfI; 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 i32-v6si14561283pgl.74.2018.09.16.19.48.22; Sun, 16 Sep 2018 19:49:10 -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=S+WGFkfI; 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 S1727782AbeIQILb (ORCPT + 99 others); Mon, 17 Sep 2018 04:11:31 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33924 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726110AbeIQILb (ORCPT ); Mon, 17 Sep 2018 04:11:31 -0400 Received: by mail-pg1-f194.google.com with SMTP id d19-v6so6933476pgv.1 for ; Sun, 16 Sep 2018 19:46:20 -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=b+W2KgD1+35cPMUuyiWExE3u77Z/RdE9Diza4aKRjG0=; b=S+WGFkfINlD50Arb5w+b6lUk/3bBRN0btXbCul2BMriZSrqxh0nsMjSXCwyCXldsxT 3Wwk5DbfWj2MbbJDpbjtLI2OfbbVC8QeuzJA44t7f6R28slvVPKZAhYOyzlGDNXcER1n Gqqjj8I2uWaO7Np5tYb4iFMiQArsM9vHizgCvYHnC3iEKizTshcrUfwfDszkSSy9STcE zdtMFtOBq58xjB59D8wYeLDzKj49T+jBu3wRP9l/5rekGbaY1GlSH+GcyP7S2IfoIoYA B0xnAkqIZYHKzAeu/VT6DJgnhOAkZBWRSaUtMg3l8rLplTk6kQlpGLOIMvq9rEVX4cXe 41uw== 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=b+W2KgD1+35cPMUuyiWExE3u77Z/RdE9Diza4aKRjG0=; b=DH5i5vNDFu8tS/mJNtSy3AfbH8GG0uE9hld2QtrVA1UL4/2CyfmY5Rtv1M0jV2vfMv snZvidg/xDz/Uf2KoPw7BpC2MBBl+wLAAUqLX/nd1o93OY2D+GU4JY2zmFU2QICb5jvs BlGP4UZeRZWM7KcH75wLCisONtn+/q/zO4zlgivckmHnkhuBeiZEzoZzhT/qhILE/yZa xXkR6pI812mSAniy4lzSS0RN2BNDnLBTy3GJQIMlMGNL64qHD/DKqo16Yu8jLTF1ukxu NmAcyETcguXwTdsLC5EeBP4+rZ8NV0S6B2A0md7CLx/bcHcTs50smUl8nUy0vzAiAKTM oZ6Q== X-Gm-Message-State: APzg51DDKn3ZBr8ZkLSlPK3amGnbnFmGf7QnPD0eODSyidwzozogiMmI q9y+MfPs+j60l8Z5XzI8Yfs1DUjm X-Received: by 2002:a62:8704:: with SMTP id i4-v6mr23607957pfe.62.1537152379837; Sun, 16 Sep 2018 19:46:19 -0700 (PDT) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.71.45? ([2402:f000:1:1501:200:5efe:a66f:472d]) by smtp.gmail.com with ESMTPSA id i25-v6sm15691041pgi.31.2018.09.16.19.46.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Sep 2018 19:46:19 -0700 (PDT) Subject: Re: [BUG] mfd: ezx-pcap: Possible sleep-in-atomic-context bugs in pcap_adc_irq() To: Lee Jones Cc: Linux Kernel Mailing List References: <20180917010340.GA3900@dell> From: Jia-Ju Bai Message-ID: Date: Mon, 17 Sep 2018 10:46:17 +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: <20180917010340.GA3900@dell> 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/9/17 9:03, Lee Jones wrote: > On Sat, 15 Sep 2018, Jia-Ju Bai wrote: > >> The driver may sleep in an interrupt handler. >> The function call paths (from bottom to top) in Linux-4.17 are: >> >> [FUNC] mutex_lock_nested >> drivers/mfd/ezx-pcap.c, 272: >> mutex_lock_nested in pcap_adc_irq (interrupt handler) >> >> [FUNC] mutex_lock_nested >> drivers/mfd/ezx-pcap.c, 100: >> mutex_lock_nested in ezx_pcap_read >> drivers/mfd/ezx-pcap.c, 281: >> ezx_pcap_read in pcap_adc_irq (interrupt handler) >> >> [FUNC] mutex_lock_nested >> drivers/mfd/ezx-pcap.c, 85: >> mutex_lock_nested in ezx_pcap_write >> drivers/mfd/ezx-pcap.c, 285: >> ezx_pcap_write in pcap_adc_irq (interrupt handler) >> >> [FUNC] mutex_lock_nested >> drivers/mfd/ezx-pcap.c, 244: >> mutex_lock_nested in pcap_adc_trigger >> drivers/mfd/ezx-pcap.c, 299: >> pcap_adc_trigger in pcap_adc_irq (interrupt handler) >> >> These bugs are found by my static analysis tool DSAC. > Not sure what you want me to do with this. > > Do you have something in mind? > I find some possible bugs in this driver, but I do not know how to correctly fix them... Could you find a good solution? Best wishes, Jia-Ju Bai