From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751277AbdK0Fsw (ORCPT ); Mon, 27 Nov 2017 00:48:52 -0500 Received: from mga06.intel.com ([134.134.136.31]:49000 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750966AbdK0Fsu (ORCPT ); Mon, 27 Nov 2017 00:48:50 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,463,1505804400"; d="scan'208";a="6619401" Date: Mon, 27 Nov 2017 11:22:15 +0530 From: Vinod Koul To: Srinivas Kandagatla Cc: Greg KH , broonie@kernel.org, alsa-devel@alsa-project.org, sdharia@codeaurora.org, bp@suse.de, poeschel@lemonage.de, treding@nvidia.com, andreas.noever@gmail.com, alan@linux.intel.com, mathieu.poirier@linaro.org, daniel@ffwll.ch, jkosina@suse.cz, sharon.dvir1@mail.huji.ac.il, joe@perches.com, davem@davemloft.net, james.hogan@imgtec.com, michael.opdenacker@free-electrons.com, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, arnd@arndb.de Subject: Re: [PATCH v7 04/13] slimbus: core: Add slim controllers support Message-ID: <20171127055215.GQ3187@localhost> References: <20171115141043.29202-1-srinivas.kandagatla@linaro.org> <20171115141043.29202-5-srinivas.kandagatla@linaro.org> <20171116164233.GB3187@localhost> <55794ca5-b70a-4866-1e80-bc0e78880c50@linaro.org> <20171117044222.GK3187@localhost> <20171117081322.GF10671@kroah.com> <64797182-9244-e6e7-8044-dbc404cdda7c@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <64797182-9244-e6e7-8044-dbc404cdda7c@linaro.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 20, 2017 at 06:47:58AM +0000, Srinivas Kandagatla wrote: > >>>thanks for the comments. > >>> > >>> > >>>On 16/11/17 16:42, Vinod Koul wrote: > >>>>On Wed, Nov 15, 2017 at 02:10:34PM +0000,srinivas.kandagatla@linaro.org wrote: > >>>> > >>>>>+static void slim_dev_release(struct device *dev) > >>>>>+{ > >>>>>+ struct slim_device *sbdev = to_slim_device(dev); > >>>>>+ > >>>>>+ put_device(sbdev->ctrl->dev); > >>>>which device would that be? > >>>This is controller device > >>> > >>>>>+static int slim_add_device(struct slim_controller *ctrl, > >>>>>+ struct slim_device *sbdev, > >>>>>+ struct device_node *node) > >>>>>+{ > >>>>>+ sbdev->dev.bus = &slimbus_bus; > >>>>>+ sbdev->dev.parent = ctrl->dev; > >>>>>+ sbdev->dev.release = slim_dev_release; > >>>>>+ sbdev->dev.driver = NULL; > >>>>>+ sbdev->ctrl = ctrl; > >>>>>+ > >>>>>+ dev_set_name(&sbdev->dev, "%x:%x:%x:%x", > >>>>>+ sbdev->e_addr.manf_id, > >>>>>+ sbdev->e_addr.prod_code, > >>>>>+ sbdev->e_addr.dev_index, > >>>>>+ sbdev->e_addr.instance); > >>>>>+ > >>>>>+ get_device(ctrl->dev); > >>>>is this controller device and you ensuring it doesnt go away while you have > >>>>slaves on it? > >>>Yes. > >>I thought since you are marking ctrl->dev as parent, the device core should > >>ensure that parent doesn't go off when you have child device? > >> > >>Greg, is that understanding correct, if so we may not need these calls. > >That understanding should be correct, as the reference count is > >incremented on the parent when a child is added. > > > >It would be trivial for this to be tested, and yes, I am pretty sure you > >don't need this call. > > Thanks for suggestion, I will remove this in next version. I think it might be helpful to test the assumption as Greg noted :) -- ~Vinod