Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3760753imm; Tue, 11 Sep 2018 01:26:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaBH2vZGUEMPIoeMYSOffiMy+i+H3lVQuEYO6wNFdGUM9FYlgq5cu+bLLhxFhuKyYJ6anca X-Received: by 2002:a62:56d9:: with SMTP id h86-v6mr28275965pfj.229.1536654415869; Tue, 11 Sep 2018 01:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536654415; cv=none; d=google.com; s=arc-20160816; b=VyjZUOUDdNiur8gWDYUzj6aZkQji7jVy54GEvd0FaDJ2kKsvvYM/VFHm03tb4tEZUK Wt4bsVOTOlxXKNjG38wYRx7F71SYBsu9lZ7wOBiMUo8ryqVzkaERa3ihyshvmKqKXxxs FsNeJ9jUsEH+FCsICa5JKRUgNeP1VFHSlEp8lTvJ23K1B7+dparDdlvlvzIWSy3rJTji 5enupJyGlhiA2YD1cnJHtlBJJuujlwP9TIgD7XsUoz6u/2pkbuxXSoibm3iAAHBqnPC2 TW1iTG0DYOxfrXlf87KIib7liCpul5Sz7RtvkpsYrMfWW7/9m2sZi/Mcd/RI1O4OvB11 RMxw== 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=yfYzb8Fkk4QkfK3wT32+KZRLSEelkm70iNASdYUaZWg=; b=k53GjcKTCQkwV5g3356drx/+nt5O7QBZoVCerbXsvfZjU2DR1PdBubuLTla4Tu1Uxb tL/odEl/WMXDkCrv7EvfRcR9GKRqWkTpWhuS/F4QJOHAGmhoGY5WtgTpylESaDtpFQAg o5vMvbk+voc6DA4TvlWo85c4fIQSREDpNgV0uWRxRfwu+oBdlfI6jWJMYW9gDZRkF/F4 KtBR/kAOycFxNGYOfgdIBYQUT3BxAyvLxP0hsdnIYxh3USmM4gcL8slUWbTAFFMgGX33 Dp2XD14G+SRg/4XybXhESmiLFQDDw31XZycT3QBTan9CgLAv87J1MUYPcfJ18RmrocK2 Gr6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b="ZD/hj7eS"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z22-v6si17914658plo.219.2018.09.11.01.26.41; Tue, 11 Sep 2018 01:26:55 -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=@163.com header.s=s110527 header.b="ZD/hj7eS"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726800AbeIKNYZ (ORCPT + 99 others); Tue, 11 Sep 2018 09:24:25 -0400 Received: from m12-18.163.com ([220.181.12.18]:44439 "EHLO m12-18.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726408AbeIKNYY (ORCPT ); Tue, 11 Sep 2018 09:24:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Subject:From:Message-ID:Date:MIME-Version; bh=yfYzb 8Fkk4QkfK3wT32+KZRLSEelkm70iNASdYUaZWg=; b=ZD/hj7eS/Nx0utPCzqJ05 jOXGjATcdGjY5/e5ltEiYUeJ6nR4YvEq8X4jkZMKZxXucsrlzgMPRrx7GK3RWuNy Gcbygmg6HDSQQ9yc5642mJB2JVM3BOM0megB+uhwdWiFy+Z5brs2WrGMwwyDIXb+ MVcxdKlfsiBd/eMNYjEfkI= Received: from [166.111.71.58] (unknown [166.111.71.58]) by smtp14 (Coremail) with SMTP id EsCowADXHh_xe5dbptGYSw--.8087S2; Tue, 11 Sep 2018 16:25:21 +0800 (CST) Subject: Re: [PATCH v2] usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt() To: Sebastian Andrzej Siewior , Jia-Ju Bai Cc: gregkh@linuxfoundation.org, johan@kernel.org, bjorn@mork.no, mingo@kernel.org, oneukum@suse.com, viro@zeniv.linux.org.uk, mark.rutland@arm.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180901081210.16655-1-baijiaju1990@gmail.com> <20180911074930.2g6ryk7qe46cijhi@linutronix.de> From: Jia-Ju Bai Message-ID: <80bf95d7-7485-d74c-2e41-73bd358aa2c6@163.com> Date: Tue, 11 Sep 2018 16:25:21 +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: <20180911074930.2g6ryk7qe46cijhi@linutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-CM-TRANSID: EsCowADXHh_xe5dbptGYSw--.8087S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrtw4DCF4kZw1DXF43Kw4rXwb_yoWfAFg_Wr 1rX3yxAw4UJF47JrnrGrZ093s8G3y8Wry8JwsxWry7Jr15Xw4rW3WDAr98Gr1rXrW5t3Z8 Wa9FgryFv3sF9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU52-e5UUUUU== X-Originating-IP: [166.111.71.58] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/1tbiYxG+elaD0l296gAAs7 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/9/11 15:49, Sebastian Andrzej Siewior wrote: > On 2018-09-01 16:12:10 [+0800], Jia-Ju Bai wrote: >> wdm_in_callback() is a completion handler function for the USB driver. >> So it should not sleep. But it calls service_outstanding_interrupt(), >> which calls usb_submit_urb() with GFP_KERNEL. > At which point does wdm_in_callback() invoke > service_outstanding_interrupt()? I don't see it. I see one invocation > from wdm_read() and another from service_interrupt_work(). > > Also, if that would be the case, then spin_unlock_irq() in an USB > completion handler (which might run in IRQ context with interrupts > disabled) would be wrong. Yes, you are right. I checked an old kernel version Linux-4.16 and got this report. The current code looks much different from the code that I checked. Sorry for my false report, and thanks for your correction. Best wishes, Jia-Ju Bai