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


Groups > linux.kernel > #1632975 > unrolled thread

Re: nvdimm/pmem device lifetime

Started byDan Williams <dan.j.williams@intel.com>
First post2017-04-28 17:40 +0200
Last post2017-04-28 17:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: nvdimm/pmem device lifetime Dan Williams <dan.j.williams@intel.com> - 2017-04-28 17:40 +0200

#1632975 — Re: nvdimm/pmem device lifetime

FromDan Williams <dan.j.williams@intel.com>
Date2017-04-28 17:40 +0200
SubjectRe: nvdimm/pmem device lifetime
Message-ID<tBg9Y-Qc-15@gated-at.bofh.it>
On Thu, Apr 27, 2017 at 9:37 PM, Mika Penttilä
<mika.penttila@nextfour.com> wrote:
> Hi,
>
> Just wondering the pmem struct device vs gendisk lifetimes.. from pmem_attach_disk():
>
>         device_add_disk(dev, disk);
>         devm_add_action_or_reset(dev, pmem_release_disk, disk);
>
>
> where:
> static void pmem_release_disk(void *disk)
> {
>         del_gendisk(disk);
>         put_disk(disk);
> }
>
>
> but device_add_disk() makes disk pin dev (as a parent), and it's unpinned by del_gendisk()
> which is called when dev is released, but it's not because of this circular dependency?

pmem_release_disk() is called when the driver is unbound, well before
the device is released. See the calls to devres_release_all() in the
device_release_driver() path.

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web