Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4603021imm; Tue, 9 Oct 2018 02:09:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV632GGCq5qAjOs4Yauq5Uidi+UNkLaQzQOZXRp9GXr/FfBumJm1mDUHiSyB7feqsDX9uEXYX X-Received: by 2002:a17:902:e012:: with SMTP id ca18-v6mr27183327plb.195.1539076153786; Tue, 09 Oct 2018 02:09:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539076153; cv=none; d=google.com; s=arc-20160816; b=do+lRHK7J+oVm5d6LmedAu5kpUhjcJ37hZ1vc0aCEFX46G2IHHGreTIxwmw3GRPTY5 Ahstdqjcxuiy/zdXFYZ0rYa6LOSS2m1py5zfShjOpclf/x2E1WyR4z22h21lVArOn9t1 t6aw5sty0b7mDLtchnDP9RINB5gjACpENbmJOBKFwOpVJPInCHDTzamfP5fZ1Pdkf/cx ayUw7qBfBn0ZxH1UnsygSYrUwVZsuN/5V1tamJvHtJ8OYG4Nc/g6Z4cx2ftEHdsQH1NV 82gYoq/8bnlPi3F0hQA40Ij4hmdqAFaKuG3w3B7QTea+kRs0cfQHeP2n1IfewO7mZwae jETg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+Dxn/NDMZ2Y87/vHF6GC+D2GUo1Sd4tLcXImcdpzS+k=; b=oO0hlSIiLaq4LCCExDK4ZLenXuqcy/0kfL0ndU9q2fhyK5NR2e4t3YCeDxhsdZmpr6 qpk6AbAsLSmohmTmVDVToKMSkfsAbESNW1e1XNu8cU8mB2XmBFH5Dfk4LEl2ll8faEV9 oB3iBw36sKhGZY+VV9CVoQGw5DkmQrCgd4QZOuY+c1lcxYFANsl0ZKna/lDvK0doHgBk MWK0/PRmdWBOCyIvSaX3leK6gpGljlPG9yoDiw6o54mMxb1MnPUe9piCuHeW3oDJR6az DnureNpJzWSaEu3VEqscvS0OWNow3Qoi/osdWRyuwB+qy6fV86b0/lDlMTIvcu9kbhVG 53oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XmDcZNfs; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1-v6si3290229pgd.528.2018.10.09.02.08.58; Tue, 09 Oct 2018 02:09:13 -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=@linaro.org header.s=google header.b=XmDcZNfs; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726647AbeJIQXN (ORCPT + 99 others); Tue, 9 Oct 2018 12:23:13 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40690 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725861AbeJIQXN (ORCPT ); Tue, 9 Oct 2018 12:23:13 -0400 Received: by mail-wr1-f68.google.com with SMTP id d2-v6so932315wro.7 for ; Tue, 09 Oct 2018 02:07:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=+Dxn/NDMZ2Y87/vHF6GC+D2GUo1Sd4tLcXImcdpzS+k=; b=XmDcZNfsnIvleGLnEWQhPzhceWc04bYjaUfOh2OZJ8Yd21kfM6zG1VoIHH+gnXVAuW DlJyu4RNLJU+Ju9rNwaKX7eWQyX1n9N4DwQ1u7rEpCx5dxpbW9Z2cPVUCsjg+TwnTbH9 smk1xOKTySCJYlYbGg3266898LE8pMQGzPTvc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=+Dxn/NDMZ2Y87/vHF6GC+D2GUo1Sd4tLcXImcdpzS+k=; b=MdC4MIwJc/M/CWf08E/zgGUjOi3S5tIuCAIc+RY/9nT/9VcAKUoDX29grJYqiqATx8 bl+wxgtRuNso6i0F985uR37aCPhhriIzE9zmT6Q14Y7HHgLpVWYndtzcpQySzFs/Uf7k IYbpSDAOff6K+Se+aFF4/Hj0/CJVYjXShd2W4DOJ6HrqZmtJn7SYhN+HEQttVfA8A620 PWOT1ZVKTHfqhouqQPaSNy+5bHK8NbCvGcFHx/peQBuWKMi8TpNN5HpQlIaSPzDbYWKo VSV/GLLl7+fBLP+oODOmtQxJhPHIpABkZ5d8HkJnEsRdvnCejjZpzgSEt6JQYZqSlsy+ NeEw== X-Gm-Message-State: ABuFfohkhVqtyCq408HFEptqcusX4xFCVKbomnINUun44axJqNO7cYeb 3k7jqTsmVT1eqqSQbGDdGfxQAw== X-Received: by 2002:a5d:6a4a:: with SMTP id t10-v6mr915609wrw.78.1539076037525; Tue, 09 Oct 2018 02:07:17 -0700 (PDT) Received: from dell ([2.27.167.111]) by smtp.gmail.com with ESMTPSA id 195-v6sm18495102wmx.21.2018.10.09.02.07.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Oct 2018 02:07:16 -0700 (PDT) Date: Tue, 9 Oct 2018 02:07:15 -0700 From: Lee Jones To: Jia-Ju Bai Cc: Linux Kernel Mailing List Subject: Re: [BUG] mfd: ezx-pcap: Possible sleep-in-atomic-context bugs in pcap_adc_irq() Message-ID: <20181009090715.GE4939@dell> References: <20180917010340.GA3900@dell> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 17 Sep 2018, Jia-Ju Bai wrote: > > > 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? If you have found bugs and do not intend on fixing them, please report them via the 'File a Bug' option here: https://bugzilla.kernel.org/ -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog