From patchwork Sun Jul 30 15:30:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 9870533 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 41BC66037D for ; Sun, 30 Jul 2017 15:30:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3314428572 for ; Sun, 30 Jul 2017 15:30:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 269C12857E; Sun, 30 Jul 2017 15:30:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F3C028572 for ; Sun, 30 Jul 2017 15:30:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754039AbdG3Pav (ORCPT ); Sun, 30 Jul 2017 11:30:51 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:43222 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753961AbdG3Pau (ORCPT ); Sun, 30 Jul 2017 11:30:50 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 43CB78EE213; Sun, 30 Jul 2017 08:30:50 -0700 (PDT) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J7v-M_6VfQOl; Sun, 30 Jul 2017 08:30:50 -0700 (PDT) Received: from [153.66.254.194] (unknown [50.35.65.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id CACC28EE0E2; Sun, 30 Jul 2017 08:30:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1501428650; bh=gBRZ/npAR8lSSls/zZ08S6U0FF3Y8r9jut8ZjtMzc9M=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Tb9+6w/mEJ/2r3mVZOQpBAAXmFoIWlJWqrKEXfI5p2xogaAWx8NmbvsnKB5uFnCqT oMjvXzad80EM4T9ASt/cBnF2IWtxpCY5oDqGtcGOG6VeyKpfzq1eXlAcGFjl75/FO5 A1qv1hzbtlZ2AWKxBKslG00J++AZdZOQpxOgQ6VI= Message-ID: <1501428648.3670.1.camel@HansenPartnership.com> Subject: Re: parisc 4.13-git, BUG: sleeping function called from invalid context at mm/slab.h:416 From: James Bottomley To: John David Anglin , Meelis Roos Cc: linux-parisc@vger.kernel.org Date: Sun, 30 Jul 2017 08:30:48 -0700 In-Reply-To: References: X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sun, 2017-07-30 at 08:27 -0400, John David Anglin wrote: > On 2017-07-30, at 2:47 AM, Meelis Roos wrote: > > > > > > > > > > > > > > [    1.940000]  [<000000004011b4a4>] > > > > pdc_stable_init+0x2c4/0x458 > > > > > > I don't see this symbol in my build.  I see > > > pdc_stable_initialize. > > > > > > Do you have a patch installed? > > > > No, pristine v4.13-rc2-110-g0b5477d9dabd git. > > > James is correct about pdc_stable_init.  It is enabled by > CONFIG_PDC_STABLE. > > In the backtrace, > > [    1.936053] BUG: sleeping function called from invalid context at > mm/slab.h:416 > [    1.936243] in_atomic(): 1, irqs_disabled(): 0, pid: 1, name: > swapper/0 > [    1.936601] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.13.0-rc2- > 00110-g0b5477d9dabd #111 > [    1.936828] Backtrace: > [    1.936889]  [<0000000040217ac8>] show_stack+0x20/0x38 > [    1.939036]  [<00000000406fbbb0>] dump_stack+0xb0/0x128 > [    1.939174]  [<0000000040274090>] ___might_sleep+0x180/0x1b8 > [    1.940000]  [<0000000040274144>] __might_sleep+0x7c/0xe8 > [    1.940000]  [<0000000040373874>] kmem_cache_alloc+0x14c/0x1e0 > [    1.940000]  [<0000000040419514>] __kernfs_new_node+0x84/0x1b8 > [    1.940000]  [<000000004041b09c>] kernfs_new_node+0x3c/0x78 > [    1.940000]  [<000000004041e040>] kernfs_create_link+0x40/0xd8 > [    1.940000]  [<000000004041f320>] > sysfs_do_create_link_sd.isra.0+0xb0/0x130 > [    1.940000]  [<000000004041f3d4>] sysfs_create_link+0x34/0x58 > [    1.940000]  [<000000004011b4a4>] pdc_stable_init+0x2c4/0x458 > > I don't know how we got to sysfs_create_link.  It is probably from > here: > >         /* Don't forget the root entries */ >         error = sysfs_create_group(stable_kobj, &pdcs_attr_group); > > Presumably, this is the sleeping function but it's not clear how the > incorrect context arises. > > Maybe there is an errant spin_lock somewhere.  For example, see: > https://lkml.org/lkml/2012/3/29/101 > It might be in a unrelated routine. > > Since this code hasn't changed in a long time, it should be possible > to bisect problem. How about this?  There's no need to take the write lock when creating links anyway. James --- -- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c index 7147aa53e9a2..d7c88b1eaf06 100644 --- a/drivers/parisc/pdc_stable.c +++ b/drivers/parisc/pdc_stable.c @@ -331,13 +331,13 @@ pdcspath_hwpath_write(struct pdcspath_entry *entry, const char *buf, size_t coun /* Now, dive in. Write back to the hardware */ pdcspath_store(entry); + write_unlock(&entry->rw_lock); + /* Update the symlink to the real device */ sysfs_remove_link(&entry->kobj, "device"); ret = sysfs_create_link(&entry->kobj, &entry->dev->kobj, "device"); WARN_ON(ret); - write_unlock(&entry->rw_lock); - printk(KERN_INFO PDCS_PREFIX ": changed \"%s\" path to \"%s\"\n", entry->name, buf);