From patchwork Sat Nov 7 18:58:13 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 37918 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id BA118B7B69 for ; Sun, 8 Nov 2009 05:58:33 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750948AbZKGS6Z (ORCPT ); Sat, 7 Nov 2009 13:58:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750972AbZKGS6Y (ORCPT ); Sat, 7 Nov 2009 13:58:24 -0500 Received: from www.tglx.de ([62.245.132.106]:46367 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750912AbZKGS6Y (ORCPT ); Sat, 7 Nov 2009 13:58:24 -0500 Received: from localhost.localdomain (www.tglx.de [127.0.0.1]) by www.tglx.de (8.13.8/8.13.8/TGLX-2007100201) with ESMTP id nA7IwNS1006539; Sat, 7 Nov 2009 19:58:23 +0100 Message-Id: <20091107184538.543684450@linutronix.de> User-Agent: quilt/0.47-1 Date: Sat, 07 Nov 2009 18:58:13 -0000 From: Thomas Gleixner To: sparclinux@vger.kernel.org Cc: "David S. Miller" Subject: [patch] sparc: Remove bogus of_set_property_mutex Content-Disposition: inline; filename=sparc-remove-bogus-of-set-property-mutex.patch X-Virus-Scanned: clamav-milter 0.95.1 at www.tglx.de X-Virus-Status: Clean X-Spam-Status: No, score=-1.7 required=5.0 tests=ALL_TRUSTED,AWL autolearn=failed version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on www.tglx.de Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org of_set_property_mutex is taken inside the devtree_lock write locked region which triggers the might_sleep check. The mutex protects the call to prom_setprop() which is not necessary as the code is the only caller of prom_setprop() and already serialized by devtree_lock. The mutex is nowhere else used despite being exported. So it can be removed safely. Signed-off-by: Thomas Gleixner Cc: David S. Miller Cc: sparclinux@vger.kernel.org --- arch/sparc/include/asm/prom.h | 2 -- arch/sparc/kernel/prom_common.c | 5 ----- 2 files changed, 7 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/arch/sparc/include/asm/prom.h =================================================================== --- linux-2.6.orig/arch/sparc/include/asm/prom.h +++ linux-2.6/arch/sparc/include/asm/prom.h @@ -18,7 +18,6 @@ */ #include #include -#include #include #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2 @@ -74,7 +73,6 @@ struct of_irq_controller { extern struct device_node *of_find_node_by_cpuid(int cpuid); extern int of_set_property(struct device_node *node, const char *name, void *val, int len); -extern struct mutex of_set_property_mutex; extern int of_getintprop_default(struct device_node *np, const char *name, int def); Index: linux-2.6/arch/sparc/kernel/prom_common.c =================================================================== --- linux-2.6.orig/arch/sparc/kernel/prom_common.c +++ linux-2.6/arch/sparc/kernel/prom_common.c @@ -62,9 +62,6 @@ int of_getintprop_default(struct device_ } EXPORT_SYMBOL(of_getintprop_default); -DEFINE_MUTEX(of_set_property_mutex); -EXPORT_SYMBOL(of_set_property_mutex); - int of_set_property(struct device_node *dp, const char *name, void *val, int len) { struct property **prevp; @@ -88,9 +85,7 @@ int of_set_property(struct device_node * void *old_val = prop->value; int ret; - mutex_lock(&of_set_property_mutex); ret = prom_setprop(dp->node, name, val, len); - mutex_unlock(&of_set_property_mutex); err = -EINVAL; if (ret >= 0) {