Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4042030pxf; Mon, 29 Mar 2021 19:49:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8QPYXVhMb/V6b++NHOUC8xmfSnU6w9VpRv1KOGuQvteKjZge37zjwOTdCawN5GyjTjKw9 X-Received: by 2002:a05:6402:c11:: with SMTP id co17mr32361795edb.246.1617072551341; Mon, 29 Mar 2021 19:49:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617072551; cv=none; d=google.com; s=arc-20160816; b=DHvInmc+4ct3P8y+2/tfh6pu/hhn7vRTK61+TP5xsunIpya++gEqh9Cyj8yFYboryP ahtDwTAmflj+Bl4Va8bkQ/xihk3l5SKV+ohBCc42DVItneTX1rJeZjOMWMCzH8jb13zc n+Ymwy5U484ecIU8CVZIEGncKjJ/bx65mivg8gEx59dr0ML7yNKamslKaFYi+bGsYn9X CvsYHCqmR4JMUVEOa+4AV9B7hqIjwE8CjpNhj9rQ9ua+1wPJLaEUwmeBQupzPl/TG7xj /MnG3DKLOZpyOnSJJb+cXk60mvKU3TUH0fXp33BQsGXimeXcNQM+J1nBDGRb39Fdqqv0 U5uA== 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=O5ZzWf/3XszfF0CVRO7l/TR2qY1KIR5OHDcSsPBUfmM=; b=JBd7LG+JMJI2cPS8jNEvx3UjlDIoDJXul08JXWLM8TfGy6uCWKo6iGXMsNYsJEMNm3 7eoIi5YOft8XLZICbJUILz8IuckXLtbQCYWLUKdrT2wn2sfHj0BLXYU/cDRyJuRESWz2 F3khckowxMO3xHlL3UyOx7Uv85YcHYi/adV9MWSdrOkb/yo68GHXr4lHSNNpZIVfKihJ UuyNrQV0g3cdZsZJdzTv9owU0rjbt0OaxfrFlh6reAZgIAma+yuMBEZQ+YBwRNwm+Juj 2UBR1xVs7IiHuJi2rh50nkDJREDIoTpq0u6uS0j/CMGprU/62jbtDhvc4uZUnrzCn3do xUww== 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 de11si13969715edb.15.2021.03.29.19.48.49; Mon, 29 Mar 2021 19:49:11 -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 S230452AbhC3Cru (ORCPT + 99 others); Mon, 29 Mar 2021 22:47:50 -0400 Received: from mga09.intel.com ([134.134.136.24]:41689 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231521AbhC3Crj (ORCPT ); Mon, 29 Mar 2021 22:47:39 -0400 IronPort-SDR: 8hBEo6b+Zcz+xXuPKc2DI4ISRA+MsPb7UnXosF8vH2wcjyCrvHRFo2uzO6bwcv2A7sLN23QvGx UGBppmrCSZNg== X-IronPort-AV: E=McAfee;i="6000,8403,9938"; a="191770652" X-IronPort-AV: E=Sophos;i="5.81,289,1610438400"; d="scan'208";a="191770652" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2021 19:47:39 -0700 IronPort-SDR: DduD5BZUtkv21jBQQcudDENB+7aWmeiOLi716lG1mCshvRKTFRluoUe8kJJo6qiaYysV52ykz1 hMyOuRESbHQw== X-IronPort-AV: E=Sophos;i="5.81,289,1610438400"; d="scan'208";a="454817611" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.25]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2021 19:47:39 -0700 Subject: [PATCH v2 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: Mon, 29 Mar 2021 19:47:39 -0700 Message-ID: <161707245893.2072157.6743322596719518693.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 v1: [1] - switch percpu_ref to srcu (Jason) - introduce cxl_memdev_alloc() (Jason) [1]: http://lore.kernel.org/r/161661970558.1721612.10441826898835759137.stgit@dwillia2-desk3.amr.corp.intel.com --- A small collection of fixes mostly inspired by Jason's recognition of dev_set_name() error handling mistakes on other driver review. dev_set_name() can fail and although device_add() might catch it that's not a reliable assumption. While fixing that I noticed that the unwind handling for cdev_device_add() failures leaked the device name. The sysfs_emit() fixup and unpublishing of device power management files are just 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 | 127 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 75 insertions(+), 52 deletions(-) base-commit: a38fd8748464831584a19438cbb3082b5a2dab15