Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4752199pxf; Tue, 30 Mar 2021 16:39:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxihkIPFXBidUZrAe4dTi+SOoPZi3vYmz1gtnmR6KZlCXkLHz5oqyuPW476L+46BEtBh73J X-Received: by 2002:a17:907:788e:: with SMTP id ku14mr636786ejc.17.1617147599365; Tue, 30 Mar 2021 16:39:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617147599; cv=none; d=google.com; s=arc-20160816; b=FvDohPc2bX7KPwkQ0J/fIkh6ViVd5lmCNEaaF86b6sBOkNzHdSjlb9Mqe2h3ihAquN 9VNopvk5VxyPoUL2WV8FK5vZgLuxkFryDv8FgWBXMWzMOpA0jlEgM5sce4bMwmpYdvHs M2BhtiikK6yd2ZfnQuL5mrUi8KQRGODsg4u+Gxo0zWqRqt5TE26jxCH5AB5FaRxKW5bC vDavcNfjjWZFwik99uPhGprFO14AQQ2nGI+IbvooJ7QU2RBnye+R1IP4XC7VliIlqLTe 4JwQG+va0kZ0LEq3VGsnee8qiD0QkYxIXIdNGzHB9AE8B7Ekl2Ohn9aykLwugA+SQgTE I/0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:ironport-sdr :ironport-sdr; bh=YVePfwusm1u3tO/OWzu2bReeL6E7R29ILhxm8S48ud4=; b=XBDdlqusv4TpaEkfFuLrIRpLuFx7lHa1AMRIq9z+bLV6vxwKiFYBe31vITd2kzzlP/ xrI7Mmgw4UeOUxsH7vQu79QQU+tkd2L2TD1Oh9FozuGl4NQ9QMEUFpQAOcnZBhCg8tOU OHFrSkSrCIICUJ0f43JodSFdwyQGVyRMdvKVdIKQUpQ6KU/RWXIyojHaSRadqaSoQd8m JLk0tVTWk/KLpMT20Sj5iaoSWf3emuL5TWJaJZd+JmZSOwyJmGrfX0iawrRK0FnFOBtZ GYISgftV1ZQMuAjREEH1CrEubiSfSKMVG3uw1Gbh+fZ3feyU3QpaMTecP4/989EEQewT VIJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si288745ejf.52.2021.03.30.16.39.36; Tue, 30 Mar 2021 16:39:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232533AbhC3Xgi (ORCPT + 99 others); Tue, 30 Mar 2021 19:36:38 -0400 Received: from mga12.intel.com ([192.55.52.136]:49369 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232661AbhC3Xg2 (ORCPT ); Tue, 30 Mar 2021 19:36:28 -0400 IronPort-SDR: GsmzRcuoSHbJUYzipTdp6EAnzrcMC2o9x5yMfuR82am5WUyjI+glUHAShXGx/oZObeWIaMs2De /JCWv1y0O3oA== X-IronPort-AV: E=McAfee;i="6000,8403,9939"; a="171286790" X-IronPort-AV: E=Sophos;i="5.81,291,1610438400"; d="scan'208";a="171286790" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2021 16:36:27 -0700 IronPort-SDR: 9sURb8rnRSfqIsDe1ZXqOrV8SWzIX862QS0Qtpi/IATdWcOMB9aJemJFNyCjT8D8mfbbWnHuWu WgSoRXPpCEYw== X-IronPort-AV: E=Sophos;i="5.81,291,1610438400"; d="scan'208";a="393800825" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.25]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2021 16:36:26 -0700 Subject: [PATCH v3 0/4] cxl/mem: Fix memdev device setup From: Dan Williams To: linux-cxl@vger.kernel.org Cc: Ben Widawsky , Jason Gunthorpe , linux-kernel@vger.kernel.org, vishal.l.verma@intel.com, ira.weiny@intel.com, alison.schofield@intel.com Date: Tue, 30 Mar 2021 16:36:26 -0700 Message-ID: <161714738634.2168142.10860201861152789544.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-3-g996c MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes since v2: [1] - switch from non-idiomatic srcu synchronization of the device registration state to rwsem protection of the cxlmd->cxlm pointer. (Jason) [1]: http://lore.kernel.org/r/161707245893.2072157.6743322596719518693.stgit@dwillia2-desk3.amr.corp.intel.com --- A collection of fixes initially inspired by Jason's recognition of dev_set_name() error handling mistakes on other driver review, but also from a deeper discussion of idiomatic device operation shutdown flows. The end result is easier to reason about and validate. Thank you, Jason. The sysfs_emit() fixup and unpublishing of device power management files are independent sanity cleanups. --- Dan Williams (4): cxl/mem: Use sysfs_emit() for attribute show routines cxl/mem: Fix synchronization mechanism for device removal vs ioctl operations cxl/mem: Do not rely on device_add() side effects for dev_set_name() failures cxl/mem: Disable cxl device power management drivers/cxl/mem.c | 141 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 83 insertions(+), 58 deletions(-) base-commit: a38fd8748464831584a19438cbb3082b5a2dab15