Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp528179imm; Wed, 1 Aug 2018 00:30:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdvhIxybRTq57GWvG05WfgMwb73jiWo6fxIJz99DiWZj5N45V3riR92s8yfwxq4+WHLDBgN X-Received: by 2002:a63:d002:: with SMTP id z2-v6mr4643656pgf.262.1533108613344; Wed, 01 Aug 2018 00:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533108613; cv=none; d=google.com; s=arc-20160816; b=WySfF3bd4kufXL0WPsLUAmcSdUXUhziquiaG8yqkvp+chyeLmeD5fcHYR3QXmuJgCP QrJ8b45aicn3O1KYQ7Fr1fb/M/0KSokDNUE1LAm+TNBoaGwogkTkBrqKfNTN1blK/Bcs U1XyF2Kt9xUtmUvsCvXGzNOaxwBwO7SDq1LrVdS1fyituLWSNhJL+N+WnHd2cG6Jr9hN 2zwy3cV/lGMTCEKHiJ9GVtQZxRQwyVqImD+safhrftW0iOE4gsAi8wi0sxdjBZlxEcBH Z8okcjuP3QJUfa7/xhCXBaC2l0yzb4eELJ5Qly5cQhzsiCBiGwG87FhCf554gFdAPlr9 jyRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:arc-authentication-results; bh=fojuLnYnkVOYM6V6alHdmH7sOUkC15wcpOfE+ePVrTY=; b=t4ykfNdqblqWhxxPEXMWmLA+yGViz7Ka3erMjmN07jSv8JC0RNrypve9F3B0xl8zJe LRS35iNYQ62Vh24W3+OWdeFNoTpYLhIsfA45xgYJDajW1ewwF1AN7FZWATH68b09mpfg VRnRAMj6464Z4VfS7aZLKlcWxK8Q9kOESSlnsUi8O2nhzydIzTBgW9giPkSoirCtL44c K6QJA78hykzX/cAcwpHr1vKHgFtWc9dTVCmsK+tKH4UNNJs6p3uo3qUBgRMp9KqQDlV9 6lhhBzo4urAf6QpZFblrLBq9a5lf1C8Sn4nOu4NMQ11kyyUMrE7oe7lOwjOfsqmF6Lhs pKog== ARC-Authentication-Results: i=1; mx.google.com; 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 a20-v6si15950457pgb.600.2018.08.01.00.29.58; Wed, 01 Aug 2018 00:30: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; 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 S2387553AbeHAJNX (ORCPT + 99 others); Wed, 1 Aug 2018 05:13:23 -0400 Received: from mail-ua0-f196.google.com ([209.85.217.196]:35803 "EHLO mail-ua0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733265AbeHAJNW (ORCPT ); Wed, 1 Aug 2018 05:13:22 -0400 Received: by mail-ua0-f196.google.com with SMTP id q12-v6so12067016ual.2; Wed, 01 Aug 2018 00:29:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fojuLnYnkVOYM6V6alHdmH7sOUkC15wcpOfE+ePVrTY=; b=kDHrL+J5NXPuDKyp2iJ2j3KvGOP5V4meNhK+x1KbKm8g8ULv0F4Q1S48Bt8wQlSvJb kETMlpJo4Iatn/1D/54CIGpgf1KGYa992fuNUTsVHOFBtKW/BnMO5MakiJvQA2WVY1Au RC0L7W6cK4jgmHMeC/5rbC1NqJjJ+z9UH5TQqRS6uP9/jDdoQazmTxc2o7KurftZ9MBR KZRLRhVS/fn2aXa6w13fDT5DNX/dieHb1wODtxnhJqtTYiaECPbKaBxRSDgB2vlScICm nrs3gQtyJCD8fXOFn0TStVqzANXh55MNeAJmfjGuS75pIuBP6iy5UAQQEJHxPBpwbjMr SlHw== X-Gm-Message-State: AOUpUlF/PkXr2XvvcgMJmaEL0X+uPVUFsMBasRSuwoa9vFL5trH8FQLe U2Xge3zMhoY8MKdzgCljf6U94EQGXMglD+1mnzY= X-Received: by 2002:ab0:80e:: with SMTP id a14-v6mr18847465uaf.114.1533108543941; Wed, 01 Aug 2018 00:29:03 -0700 (PDT) MIME-Version: 1.0 References: <6008699.T6Yd1fn3Dk@amdc3058> <1975707.vO8kdHz3oS@amdc3058> In-Reply-To: From: Geert Uytterhoeven Date: Wed, 1 Aug 2018 09:28:52 +0200 Message-ID: Subject: Re: Sleeping from invalid context in udlfb To: Mikulas Patocka Cc: Bartlomiej Zolnierkiewicz , Dave Airlie , Bernie Thompson , Ladislav Michl , DRI Development , Linux Fbdev development list , Greg KH , Jiri Slaby , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mikulas, On Tue, Jul 31, 2018 at 5:23 PM Mikulas Patocka wrote: > BTW when using the udlfb driver as a console, I've got this warning. > vt_console_print takes a spinlock and then calls the framebuffer driver > that sleeps. > > The question is - whose fault is this? Could the console code somehow be > told to print characters without holding a spinlock? Or does it mean that > framebuffer drivers can't sleep? > > udlfb communicates through USB, so the sleeping is inevitable. > > Mikulas > > > BUG: sleeping function called from invalid context at mm/slab.h:421 > in_atomic(): 1, irqs_disabled(): 0, pid: 430, name: kworker/2:3 > 6 locks held by kworker/2:3/430: > #0: 000000001301127e ( (wq_completion)"events"){....} , at: process_one_work+0x17c/0x3a8 > #1: 00000000beacc951 ( (work_completion)(&(&dlfb->init_framebuffer_work)->work)){....} , at: process_one_work+0x17c/0x3a8 > #2: 00000000a402f826 ( registration_lock){....} , at: register_framebuffer+0x28/0x2c0 [fb] > #3: 0000000021cbe902 ( console_lock){....} , at: register_framebuffer+0x258/0x2c0 [fb] > #4: 0000000096d51735 ( console_owner){....} , at: console_unlock+0x174/0x500 > #5: 00000000faa7f206 ( printing_lock){....} , at: vt_console_print+0x60/0x3a0 > Preemption disabled at: [] vt_console_print+0x60/0x3a0 > CPU: 2 PID: 430 Comm: kworker/2:3 Not tainted 4.17.10-debug #3 > Hardware name: Marvell Armada 8040 MacchiatoBin/Armada 8040 MacchiatoBin, BIOS EDK II Jul 30 2018 > Workqueue: events dlfb_init_framebuffer_work [udlfb] > Call trace: > dump_backtrace+0x0/0x150 > show_stack+0x14/0x20 > dump_stack+0x8c/0xac > ___might_sleep+0x140/0x170 > __might_sleep+0x50/0x88 > __kmalloc+0x1b0/0x270 > xhci_urb_enqueue+0xa8/0x460 [xhci_hcd] > usb_hcd_submit_urb+0xc0/0x998 [usbcore] > usb_submit_urb+0x1e0/0x518 [usbcore] > dlfb_submit_urb+0x38/0x98 [udlfb] > dlfb_handle_damage.isra.4+0x1e0/0x210 [udlfb] > dlfb_ops_imageblit+0x28/0x38 [udlfb] > soft_cursor+0x15c/0x1d8 [fb] > bit_cursor+0x324/0x510 [fb] > fbcon_cursor+0x144/0x1a0 [fb] > hide_cursor+0x38/0xa0 > vt_console_print+0x334/0x3a0 > console_unlock+0x274/0x500 > register_framebuffer+0x22c/0x2c0 [fb] > dlfb_init_framebuffer_work+0x1ec/0x2fc [udlfb] > process_one_work+0x1e8/0x3a8 > worker_thread+0x44/0x418 > kthread+0x11c/0x120 > ret_from_fork+0x10/0x18 This is sort of expected: you cannot do USB transfers from printk(). Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds