lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171127055215.GQ3187@localhost>
Date:   Mon, 27 Nov 2017 11:22:15 +0530
From:   Vinod Koul <vinod.koul@...el.com>
To:     Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc:     Greg KH <gregkh@...uxfoundation.org>, broonie@...nel.org,
        alsa-devel@...a-project.org, sdharia@...eaurora.org, bp@...e.de,
        poeschel@...onage.de, treding@...dia.com, andreas.noever@...il.com,
        alan@...ux.intel.com, mathieu.poirier@...aro.org, daniel@...ll.ch,
        jkosina@...e.cz, sharon.dvir1@...l.huji.ac.il, joe@...ches.com,
        davem@...emloft.net, james.hogan@...tec.com,
        michael.opdenacker@...e-electrons.com, robh+dt@...nel.org,
        pawel.moll@....com, mark.rutland@....com,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-msm@...r.kernel.org, arnd@...db.de
Subject: Re: [PATCH v7 04/13] slimbus: core: Add slim controllers support

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@...aro.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ