From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759489AbcIMQz5 (ORCPT ); Tue, 13 Sep 2016 12:55:57 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:37916 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755321AbcIMQzz (ORCPT ); Tue, 13 Sep 2016 12:55:55 -0400 Subject: Re: [PATCH v1 0/2] i2c: Stop i2c modules being unloaded while in use. To: Peter Rosin , References: <1473278729-16329-1-git-send-email-jim_baxter@mentor.com> <51c45bae-aa5d-bfad-e9d0-d95deb3dc380@axentia.se> CC: Peter Korsgaard , Wolfram Sang , , "Frkuska, Joshua" , jiwang From: "Baxter, Jim" Message-ID: <91828685-c7ba-b5b2-f128-240fdf9ebb44@mentor.com> Date: Tue, 13 Sep 2016 17:55:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <51c45bae-aa5d-bfad-e9d0-d95deb3dc380@axentia.se> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [137.202.0.76] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, > nitpick: Patch subjects for the second patch is wrong. > > "reparented" is a bit dual when dealing with i2c adapter trees. > i2c_mux_add_owned_adapter is perhaps clearer? Agreed, I will update that. > > > Aside from that, I'm not using modules much and need some enlightenment > as to why the i2c_del_mux_adapter() call in i2c_mux_gpio_remove() is not > sufficient and what exactly the problem is? Why would someone/something > unload the i2c-mux module prematurely? It is not a normal operation to remove the i2c gpio mux, however systemd could unload modules out of order if users are restarting services incorrectly and cause unintended side-effects. This change would stop an i2c-mux that maybe controlling a voltage regulator from being unloaded and disabling power to parts of the system unexpectedly. > > > Would it be an alternative to make i2c-mux a proper kernel object of > some kind? I mean, why do not all other mux users also need to modify > the owner? Why is i2c-mux-gpio special? > i2c-mux-gpio is not special, the code inserted by [PATCH v1 1/2] i2c-mux: add i2c_mux_add_reparented_adapter api could be used by other muxes if required. Best regards Jim