Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp790055pxb; Tue, 14 Sep 2021 08:47:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaj1vieoHuGqkii708C3AIpJ47pgaVpoYlMnZUFTZZKY63Zo04vViSuFlz24OaEgWcv87r X-Received: by 2002:a05:651c:1504:: with SMTP id e4mr7185632ljf.475.1631634443392; Tue, 14 Sep 2021 08:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631634443; cv=none; d=google.com; s=arc-20160816; b=QcdGIsjqcHwdBPCFZd/iBLUWW6iHECSeAWE/bRgO+PkApHbDCgBAeJGNp1twMYgiiz WUt9PitZ30Rvfc+fIenTAULvnW10VpffdDlFXCjpidbNDuKplvI4EmUGzMxL4WiWI3+q ycULvEtylU+3igA1ib88j3cM/BlT+kPM6D2oN7udq/k4F1ObVFF7Lk3BlBSaBODiTJkP 64ctzTCez5P36CexlliP3OFAC3Djv9ZZQv84rOY+VtbkmB3XnwCunGDqzURhhN9hi/Cr iZNbR4n1T2J8roe6eXWIHLODUbwhE2EeqU3rXEmRDKvqGJ5fuYYoezm1eZguioHFQ1Qk a6Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=uqrZf2RpvTXlUmbRyI2QxPTRCT62GWMUqprCb4O9iv0=; b=pnDmRw8I6pX+szoFGD1LtH7ugRkkLVMflyhYe0J5GoIWFknlplh0L0IZhKGTLNbME2 blNHAU3SugGItohdiqwbysny2QSaBiNrjhy0HVABF6D/LqtfaZmxX7gKSGxyBzIdsWTU 7GPQrV8n/JPGK3PVvd15oc+LnMoX5Wfw5cnMg7SazqB5r4GPrBvu5IqWq9Kp0YEDGG2e U7in6ircf8FST+wdpe0leQ4k8ZtCoV9/VYMBimldMdKYZ7oijBLNbcj1OjHvLsORCJcg qWcjXnG8+/+G5nXpztMYPOuI1pHcqwIMrt2hJzvJzLIxJonM1DpagDwrcSxkqSgRjlzo rn9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=R68nkCIB; 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 j1si14251437ljo.286.2021.09.14.08.46.56; Tue, 14 Sep 2021 08:47:23 -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; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=R68nkCIB; 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 S234803AbhINPng (ORCPT + 99 others); Tue, 14 Sep 2021 11:43:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234826AbhINPnd (ORCPT ); Tue, 14 Sep 2021 11:43:33 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 020CEC061762 for ; Tue, 14 Sep 2021 08:42:16 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id t20so9160528pju.5 for ; Tue, 14 Sep 2021 08:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uqrZf2RpvTXlUmbRyI2QxPTRCT62GWMUqprCb4O9iv0=; b=R68nkCIBgi4tzTf2MsQxydUGK5qmIiOepWBVPDzhpnm4nX8LXu58vXbtjzmF+E8byt 8XTqcGe917Vrbpjr71mFbX1tJFns3YkzB9/rGD3J7a5+FdTugj8ONEIiiO6qXJqoBHX9 lMoFuKn75vZN3Txje64yeqHoFnlU9Ukbjn3YJ0nvUIaMymTN1Hntmmw4vXFkudk/3fkl lOSrmvIwupDazVsHuXC7BSP/kradpQEU3rS2If8rC/6nrKUQTBunjN3/mwe1kRBUhr+4 U9p7my/NY7OVuJXjqhH1E0g+jrvxwSqrNUUTAUKeqD29Tq0n8/de8TeKkBYA+i3hzDwD 16yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uqrZf2RpvTXlUmbRyI2QxPTRCT62GWMUqprCb4O9iv0=; b=sETs97dJL2guP19utavQZIWV7UhNJ2Mm8sb8x1QMQ/ryPRvBsXdHHtMIfVKgCI741A ZmzAcRXxsH8sVW+6iaHrRbfMYNm4AAlYnZX2ZI3bJm3gz4SQgDXSvRtK/njYQpubgOyk zl8YXk1w/C0xbYGdCM+kODHGcT3vg9oO85DtsQPTd0jZiLmrp3z3GqMdluw/E+nUb9+D 8ZxDvnyGftCD/WnwbOE/859j7HmLkZIGbWQ/bIw8CSxfrEgcGzcwShDi/PkC8eiqRXvW GprnDY/JiCB9RTVLQp3JuZn4gifRChDx3XeCqk7pEhBK02qfmBsdKwbYkkJY5yu9nq9q 6/UA== X-Gm-Message-State: AOAM533SUoqiIgPmmYTcHse/6kZCz2neuBuD6XI2D1CcbJtCsXvoMlId 9GhnWFA0EwhGr9mCB/UlpLN87Jwc6Bmthlgs85CkXQ== X-Received: by 2002:a17:902:e80f:b0:13b:721d:f750 with SMTP id u15-20020a170902e80f00b0013b721df750mr15580149plg.18.1631634135572; Tue, 14 Sep 2021 08:42:15 -0700 (PDT) MIME-Version: 1.0 References: <20210913223339.435347-1-sashal@kernel.org> <20210913223339.435347-4-sashal@kernel.org> In-Reply-To: <20210913223339.435347-4-sashal@kernel.org> From: Dan Williams Date: Tue, 14 Sep 2021 08:42:04 -0700 Message-ID: Subject: Re: [PATCH AUTOSEL 5.14 04/25] cxl/pci: Introduce cdevm_file_operations To: Sasha Levin Cc: Linux Kernel Mailing List , stable , Ben Widawsky , Jonathan Cameron , linux-cxl@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 13, 2021 at 3:33 PM Sasha Levin wrote: > > From: Dan Williams > > [ Upstream commit 9cc238c7a526dba9ee8c210fa2828886fc65db66 ] > > In preparation for moving cxl_memdev allocation to the core, introduce > cdevm_file_operations to coordinate file operations shutdown relative to > driver data release. > > The motivation for moving cxl_memdev allocation to the core (beyond > better file organization of sysfs attributes in core/ and drivers in > cxl/), is that device lifetime is longer than module lifetime. The cxl_pci > module should be free to come and go without needing to coordinate with > devices that need the text associated with cxl_memdev_release() to stay > resident. The move will fix a use after free bug when looping driver > load / unload with CONFIG_DEBUG_KOBJECT_RELEASE=y. > > Another motivation for passing in file_operations to the core cxl_memdev > creation flow is to allow for alternate drivers, like unit test code, to > define their own ioctl backends. Hi Sasha, Please drop this. It's not a fix, it's just a reorganization for easing the addition of new features and capabilities.