Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938475AbdD1EiK (ORCPT ); Fri, 28 Apr 2017 00:38:10 -0400 Received: from mail-ve1eur01on0069.outbound.protection.outlook.com ([104.47.1.69]:4055 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751052AbdD1EiE (ORCPT ); Fri, 28 Apr 2017 00:38:04 -0400 Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nextfour.com; To: LKML , Dan Williams From: =?UTF-8?Q?Mika_Penttil=c3=a4?= Subject: nvdimm/pmem device lifetime Message-ID: Date: Fri, 28 Apr 2017 07:37:54 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [194.157.170.61] X-ClientProxiedBy: VI1PR09CA0082.eurprd09.prod.outlook.com (10.174.49.154) To AM4PR0701MB2163.eurprd07.prod.outlook.com (10.167.132.148) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d9a437d-fd63-4cd4-6fdb-08d48df05a7a X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075);SRVR:AM4PR0701MB2163; X-Microsoft-Exchange-Diagnostics: 1;AM4PR0701MB2163;3:6YXNLeBvkLnl9hsxFpPWVDlfBGPksszyNbiB0/ng9egamq1z8jTeQwMueY+tkjse2/sifvQX+4rjVrylxYF/Iqurh60ZlhH05xHEkSD9+GVtDTRl/tRlnyLGROFVPjUUt+MYoZfiQm+Cjh5Q27o4nmATEP1YkQ3JCrYxweVtK4gVzVPW1mfhnajY6VPrYK7+DS3PkmRk9UJgJSLAs32PFq6rACBc5cZfevZnGfvokoF0Shdn8OFXm8sg4iJ+3bSy4HyEW3RUaLPqHjaBYQkK87smnS4+MBwhHgTS1CMpAOn8vz3rXVOAbn+rpnw4JzJv;25:M8clZJjXAQSXXSIv4siWvioDyyXy1KEM12c8H45NbI4V1cdZtkYCFbkCmzmsxx7MU3d4g6XsGgndutAsJ8MCOrum51kuDBULaYAZmUojNWuu4qc2kC1/sTc5nny60o7jEMIXZdhIfDopvuPQwheo4l2eZH6HqUTzaBXa2yalwXwHmaXGRMdmv8bMcQrl/qhvTEO70UHXmQC4UAvqyCkwJk0D86D6dNIPWINpWQKyq+skWz2UkeBMn6QaRVuHTqkhji9PXi3fmFNIn79jcvEMQxpt3F4SDHSXsRw0Fh5Tf0ISrmDvXEd9ldhh0+58DV8UJBrAHxwSXvtH8z6U2W1Er6rF0YCoTfnyOmaOPmgZEb0NhgTWtd9Ds+/W+V3iApkI3+Rp6bv4Fs1FQjnmzCcWcn63KO4KGk6fm8R91qj9bCPwQ22hPJg0Pu0iG33dYP6k7Jc32eRGjbZ8KHae8uZPCx60dc5bb/v+YJT+aba+Dqw= X-Microsoft-Exchange-Diagnostics: 1;AM4PR0701MB2163;31:ulTl8SItIRok6b8HJ50k9e//hWD4oSOoS5wujmdCh59wxsn8Ro0QZs0c/2TQkBXrxLOsop7WPRfPCQMYxIRqpPVUdmEFghECLYkVgdeUUi5sQ31oBvkgvQtcY58t/gIeeR5MWdcbZp2LebQQMowtjBgo7kymEMPhA+CFuADAwP1wy7I+D4ONaSQPcI7WdWiiEsU+aA+HOSTSP47vjoZ4do7/+i1RyzTvP9zfHoFMNsIkcf6VeLzkwuVf9LJ5ifQc X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(6041248)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(2016111802025)(20161123555025)(6072148)(6043046);SRVR:AM4PR0701MB2163;BCL:0;PCL:0;RULEID:;SRVR:AM4PR0701MB2163; X-Microsoft-Exchange-Diagnostics: 1;AM4PR0701MB2163;4:/K9cIhyRZeEfNfbgdDHoceZKK6XMqKSvZZEsYW7xJK72P3cJAkN8jaC/83x4SvGsiz6O0r3LGjw1sE6o2j535FMWgI7yLTZoenO/V1A70blZtvn2RiRdg1daGUXHOfLFqIEVbm/TDmv2r23zCEup7Fd4qyBhuA4U1zLIxeyBYA6uE61mzAC79sDmwpqupXVFglyWi6qGzP8W5OfsIqGXBS2TRL17caf6wSCt6moDT1n1B11QLZxP+ZeiXKqTbAKw4tNdbXbXURTelGUSdAQZMgqztCmKUfyvFcDSJ7Q6CFnEWKRRzIyQqQxcxHw6Kr7F8Y5k9hgITOWjhy/HXlLvIOMahvEyF1wNWPIB9vACAr3+eA+SQk+7GHukAqJ1LnqtHKwYk2pmvSCCSrvYMjnYKvX1D9WKdTHO8y/uF6/H9e/SnSizWTrmV7EdRaFd9pDiHt7tMhF4HvHV5hR3YVDzgBA9D3xu6PBsIGly+rW+U0PhEQGDOf2epdMHboFc5qwaVrvNfJ39TbqrnXyjh2lq272XBOVHETxQcwh/Pylzt0ZCLoYOCpRGzp7IuFApLf9CmapQgDmI7FIJ1PpbMr0hoBG7pJVjdBmyUs2VAz55yN9UfmXDslUbpaN1/OWfG2sc15MG1bJafxat5zKI27PxZE+xe1C5WbUMznPCOx1QjuMNbZr6CebLGt6v2pkcM2WXVo3jD81XbkiujRXwHroZV3Lxeb39cj5QWteaaQONMv3s6oMZ0OzedKGRKRjvjHyv25GF67WeFcOeHZLqtY/M1Hpespl1a/APvt9r/AeyZuX1tcyIXmhcgOZBRPMsOA1boqgjCOTkShRlw3brGR4CLQ== X-Forefront-PRVS: 029174C036 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(39450400003)(39830400002)(39410400002)(39400400002)(86362001)(5660300001)(7736002)(36756003)(305945005)(189998001)(83506001)(53936002)(3846002)(2906002)(25786009)(50466002)(31696002)(6116002)(81166006)(3480700004)(77096006)(4001350100001)(6486002)(42186005)(50986999)(54356999)(31686004)(38730400002)(6666003)(65826007)(23676002)(5890100001)(33646002)(65806001)(8676002)(230700001)(66066001)(65956001)(47776003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR0701MB2163;H:[10.10.10.110];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTRQUjA3MDFNQjIxNjM7MjM6Z3BVbkNqb2Y5Um9sRzlML090UFI4Ly9a?= =?utf-8?B?NXBuQ3hrMFVMWGk2Q3pEbXlodDZWNjhzMnpQVzlySFh3bUZDaVBXbGc1K2hF?= =?utf-8?B?YVRlcllUT0JGMjhCMDhtRkdqUFdUek9HaHVPbDBxaGFYN1RDcFRwOHZyZ2VX?= =?utf-8?B?dWtKSTduYWF1Z2tKOHNFZ3dmM294RWt0U28xKzNmOWZjcWtyVWsxTWpJblFw?= =?utf-8?B?MzRWZ3hIUThNN25SYjVyWDdiOWRhYnJ5RGlsNTV6ZzZ0bWs2TVNmL2FtUzZX?= =?utf-8?B?UjloaWxMTEdZWEVDRnJHOUpQNDRwbWVqbWNRL2JGL2Rlelp1cWcyMjFhYWxL?= =?utf-8?B?WmNYeU1jZm1DMDFQQUQ5SERXRnRIVE9mTStpZEhUdlVQemY0K204S2VKWmUz?= =?utf-8?B?MlJuQnBBWTNjcm13bFhjSldPSWpGM3o1bW1xWVFmRzYwNHZPbnZ2bXg4UnBH?= =?utf-8?B?VU4xeVpKK2NkaDQ4bzdHaHMwOU52R2JyUHpKMHVqNlZML3ltNmx3NmpuZ0Mw?= =?utf-8?B?VDlabVdJN2J6WU9sRktqQVk1cWUvcmdkUkxvRnJ6S24wUlIzVEdEcUJwL0Z0?= =?utf-8?B?RWc2azhqSFd6NVEzRzNjTW9rbHFYQ1lIQUJaUUZtM1M4NlZZbzB4dUVzSkRM?= =?utf-8?B?Mk4zb1FMaFh0MnAvaVo0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2TkjTAK40urQ0xyfhpm5vnyF67sMg6JB/0yZk+tOV0ungD52bZh3cMx8jURsTie+j85nVoSMPHf6OSVo/mclbw== X-OriginatorOrg: nextfour.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2017 04:38:01.3311 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0701MB2163 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 480 Lines: 20 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? --Mika