From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philipp Zabel Subject: Re: [PATCH v14 00/11] mux controller abstraction and iio/i2c muxes Date: Mon, 24 Apr 2017 16:59:29 +0200 Message-ID: <1493045969.2446.47.camel@pengutronix.de> References: <1493022995-16917-1-git-send-email-peda@axentia.se> <1493031179.2446.9.camel@pengutronix.de> <2d978956-d247-917d-4150-a6723917a733@axentia.se> <1493043046.2446.37.camel@pengutronix.de> <6fb34ea5-edc8-c7aa-1d49-f6ce1d33a2d4@axentia.se> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <6fb34ea5-edc8-c7aa-1d49-f6ce1d33a2d4@axentia.se> Sender: linux-kernel-owner@vger.kernel.org To: Peter Rosin Cc: Jonathan Cameron , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Wolfram Sang , Rob Herring , Mark Rutland , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Jonathan Corbet , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, Andrew Morton , Colin Ian King , Paul Gortmaker , kernel@pengutronix.de List-Id: devicetree@vger.kernel.org On Mon, 2017-04-24 at 16:36 +0200, Peter Rosin wrote: [...] > > How about an atomic use_count on the mux_control, a bool shared that is > > only set by the first consumer, and controls whether selecting locks? > > That has the drawback that it is hard to restore the mux-control in a safe > way so that exclusive consumers are allowed after the last shared consumer > puts the mux away. True. > Agreed, it's a corner case, but I had this very similar > patch going through the compiler when I got this mail. Does it work as well > as what you suggested? Yes, this patch works just as well. regards Philipp