Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755321Ab0KJJuW (ORCPT ); Wed, 10 Nov 2010 04:50:22 -0500 Received: from www.tglx.de ([62.245.132.106]:42036 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753805Ab0KJJuT (ORCPT ); Wed, 10 Nov 2010 04:50:19 -0500 Date: Wed, 10 Nov 2010 10:49:44 +0100 (CET) From: Thomas Gleixner To: Grant Likely cc: Maciej Szmigiero , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Anton Vorontsov , Greg Kroah-Hartman , Uwe Kleine-K?nig , Andrew Morton , Arnd Bergmann , Jonathan Cameron , Ben Nizette Subject: Re: [GPIO]implement sleeping GPIO chip removal In-Reply-To: <20101110050947.GC4110@angua.secretlab.ca> Message-ID: References: <4CD6F049.10102@o2.pl> <20101110050947.GC4110@angua.secretlab.ca> User-Agent: Alpine 2.00 (LFD 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: 1145 Lines: 29 On Tue, 9 Nov 2010, Grant Likely wrote: > On Sun, Nov 07, 2010 at 07:30:33PM +0100, Maciej Szmigiero wrote: > > [GPIO]implement sleeping GPIO chip removal > > > > Existing GPIO chip removal code is only of "non-blocking" type: if the chip is currently > > requested it just returns -EBUSY. > > This is bad for devices which disappear and reappear, like those on hot pluggable buses, > > because it forces the driver to call gpiochip_remove() in loop until it returns 0. > > > > This patch implements a new function which sleeps until device is free instead of > > returning -EBUSY like gpiochip_remove(). > > > > Signed-off-by: Maciej Szmigiero > > This patch makes me uncomfortable, but I'm not entirely sure why. Is Maybe because it open codes a sloppy refcounting with a loop and magic sleeps instead of converting the code to kobjects and proper refcounting ? Thanks, tglx -- 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/