Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754659Ab3JJCXv (ORCPT ); Wed, 9 Oct 2013 22:23:51 -0400 Received: from gir.skynet.ie ([193.1.99.77]:33951 "EHLO gir.skynet.ie" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754416Ab3JJCXu (ORCPT ); Wed, 9 Oct 2013 22:23:50 -0400 Date: Thu, 10 Oct 2013 03:23:45 +0100 (IST) From: Dave Airlie X-X-Sender: airlied@skynet.skynet.ie To: Russell King - ARM Linux cc: Fengguang Wu , Linus Torvalds , xen-devel@lists.xenproject.org, Linux Kernel Mailing List , Greg Kroah-Hartman Subject: Re: [xen] double fault: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC In-Reply-To: <20131008080625.GA25034@n2100.arm.linux.org.uk> Message-ID: References: <20131006082340.GA24568@localhost> <20131007021118.GA27927@localhost> <20131007051038.GA9764@localhost> <20131007083505.GA22585@localhost> <20131008020918.GA1220@localhost> <20131008021452.GA6456@localhost> <20131008080625.GA25034@n2100.arm.linux.org.uk> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1719 Lines: 55 > I think David Arlie also needs a quiet talking to about how to use the > device model: > > int drm_sysfs_device_add(struct drm_minor *minor) > { > minor->kdev.release = drm_sysfs_device_release; > ... > err = device_register(&minor->kdev); > } > > static void drm_sysfs_device_release(struct device *dev) > { > memset(dev, 0, sizeof(struct device)); > return; > } > > Since when has that been acceptable in a release function? Well the commit that added it had a reason that seems to cover some other device model abuses, so maybe someone who actually understands the device model (all 2 people) can review usage. Dave. commit 77d26dc9b9805f322f5a1f6e559b18ad66205bd9 Author: Ma Ling Date: Thu Apr 16 17:51:25 2009 +0800 drm: clean dirty memory after device release In current code we register/unregister connector object by drm_sysfs_connector_add/remove function. However under some cases, we need to dynamically register or unregister device multiple times, so we have to go through register -> unregister ->register routine. Because after device_unregister function our memory is dirty, we need to do clean operation in order to re-register the device, otherwise the system will crash. The patch intends to clean device after device release. Signed-off-by: Ma Ling Signed-off-by: Dave Airlie -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/