Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1334866

Re: [RFC] component: Fix: Unassign components' masters if bringing up master fails

From Russell King - ARM Linux <linux@arm.linux.org.uk>
Newsgroups linux.kernel
Subject Re: [RFC] component: Fix: Unassign components' masters if bringing up master fails
Date 2016-02-16 00:10 +0100
Message-ID <r2Arg-7MI-5@gated-at.bofh.it> (permalink)
References <r0VTd-6SY-9@gated-at.bofh.it> <r2xa2-5vB-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Feb 15, 2016 at 07:32:02PM +0000, Jon Medhurst (Tixy) wrote:
> It seems to me that for other error cases (that don't result in deletion
> of objects) we would want to leave the references between components and
> masters intact once they have been created.

Indeed we do - because we want to avoid having to redo the matching
work each and every time we try to bring up the master.  It's needless
expense to keep re-running all the matches every time.

> The other components or master should subsequently get cleaned up by
> calling component_del() or component_master_del(), which take care of
> updating the relevant references between components and master.

Correct.

> For component_master_del this is not immediately obvious, but 
> take_down_master calls devres_release_group which causes
> devm_component_match_release to be called.

Also correct.

For component_master_del(), the list of components will be going away,
so there's no point cleaning that list (it's freed when the device
model releases its devres group.)

However, the components themselves must not be left pointing at the
freed memory, otherwise they'll effectively be marked "in-use" by a
non-existent master - that's what "free_master()" is about - ensuring
that when 'struct master' is freed, there are no components left
pointing at the to-be-freed master device.

-- 
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC] component: Fix: Unassign components' masters if bringing up master fails Archit Taneja <architt@codeaurora.org> - 2016-02-11 10:40 +0100
  Re: [RFC] component: Fix: Unassign components' masters if bringing up  master fails Daniel Stone <daniel@fooishbar.org> - 2016-02-15 17:40 +0100
  Re: [RFC] component: Fix: Unassign components' masters if bringing  up master fails "Jon Medhurst (Tixy)" <tixy@linaro.org> - 2016-02-15 20:40 +0100
    Re: [RFC] component: Fix: Unassign components' masters if bringing  up master fails Russell King - ARM Linux <linux@arm.linux.org.uk> - 2016-02-16 00:10 +0100
    Re: [RFC] component: Fix: Unassign components' masters if bringing up  master fails Archit Taneja <architt@codeaurora.org> - 2016-02-16 08:20 +0100

csiph-web