From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pantelis Antoniou Subject: Re: [PATCH] [RFC] i2c: Don't wait for device release in i2c_del_adapter Date: Fri, 16 Jan 2015 09:19:49 +0200 Message-ID: References: <1421082050-10213-1-git-send-email-pantelis.antoniou@konsulko.com> <20150113152957.GL7660@katana> <20150114144938.4e3c3f52@endymion.delvare> <20150114161525.49c54acc@endymion.delvare> <20150114162442.GB18578@roeck-us.net> <20150114181426.3a39791b@endymion.delvare> <6680B42A-76E8-40CF-9574-ECD00B40AE98@konsulko.com> <20150114204122.GA31119@kroah.com> <20150115225521.GA26542@kroah.com> Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <20150115225521.GA26542-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org> Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Greg Kroah-Hartman Cc: Jean Delvare , Guenter Roeck , Wolfram Sang , Matt Porter , Grant Likely , linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-i2c@vger.kernel.org Hi Greg, > On Jan 16, 2015, at 00:55 , Greg Kroah-Hartman wrote: >=20 > On Thu, Jan 15, 2015 at 06:25:22PM +0200, Pantelis Antoniou wrote: >> Hi Greg, >>=20 >>> On Jan 14, 2015, at 22:41 , Greg Kroah-Hartman wrote: >>>=20 >>> On Wed, Jan 14, 2015 at 07:24:22PM +0200, Pantelis Antoniou wrote: >>>> I=E2=80=99ll try to dig around tomorrow and see what the real devi= ce reference counts >>>> are, but my hunch goes like this: >>>>=20 >>>> MUX >>>> +=E2=80=94- ADAPTER >>>> +=E2=80=94 DEV. >>>>=20 >>>> Mux remove method is called, i2c_del_mux_adapter is called on all = the channels >>>> of the mux, calling in turn i2c_del_adapter which hangs on complet= ion of the >>>> dev_released. >>>>=20 >>>> The call to device_unregister never calls the device_type callback= (i2c_adapter_dev_release) >>>> because the reference count is not 1 at that point, someone else i= s having another >>>> reference. >>>=20 >>=20 >> First of all, my head hurts. Tracking device references ain=E2=80=99= t easy. Is there some kind >> of debugging method you=E2=80=99d recommend for this? >=20 > You can turn on debugging for kobjects and the driver core if you wan= t > to slow down your system log a bunch, but it can be helpful for trick= ier > issues. Or just sprinkle a few printks around. >=20 Turning on debugging for kobjects is like opening the floodgates=E2=80=A6 I managed to make do with a few printks, but some kind of tracking woul= d be helpful.=20 >>> I don't remember the i2c core code at all, that was a long time ago= =2E >>>=20 >>=20 >> Bummer. >=20 > Do you remember code you wrote 12 year ago and haven't looked at for = at > least 11? Why expect others to as well? :) >=20 You=E2=80=99re supposed to be a super-hero maintainer god right? How am= I supposed to continue living with my belief system crumbled like that? :) > thanks, >=20 > greg k-h Regards =E2=80=94 Pantelis