Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp497328pxb; Wed, 20 Jan 2021 12:11:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxjnMB6w1V6b34AC+C5M32aoTpgR8Ke3CvD7f4oHhqO3wsSGKBrg0Ss+sk1IRZlv8ktnS5n X-Received: by 2002:a50:bc06:: with SMTP id j6mr9033969edh.235.1611173503324; Wed, 20 Jan 2021 12:11:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611173503; cv=none; d=google.com; s=arc-20160816; b=cjtZbylifU2pD00z93PYVa0Ctm0SDCjTdhtikveh3oHvJiXtlmQPJJgugWOsvIK3PA mlSYsDRLn2ALEz9rV5VdsxVHnV6yp3N0d9iIKUXQAWKK15BYoiPRxdhbG2j55FoMvBZz 1vPIc3ExVUluB437RRxGCEEeZRoW3NxmNwmX+XQdM0aALKRAvknZKVqkkz19OPCr6CMu S2w7swmX+luWWQ+i7vUgrbr8gOSjuPz43o5Xtro7DwoXApis0MfI4ujZ5rQ9Qt+NhkH2 rxwDYCjjEwTJXwkOMHWi6iEwiDu7fWzjkflTlJIkXGrD+KRmOf2XXALVAoZnXVkbllcY HJbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:dkim-signature; bh=FpuctqQYr7HiImXDtxO/Xmx4gM6wv9pGDhDLLlURPOs=; b=FRt+bdzMdfHIs+52ebwT89ALv65rUzHzmMUAHC06jC5W+ekmdH5fbLh9iAzegqkPRa xf95r5Z2IOKkFD7FO/kYjwlyWJuSAlhQTFZotxm+YaJoAHKYwWp0gnrnYFBxleDBXiLO l0FdSyfdR6VCvST/jqooFqHnY3Nv/1mOUzqkcHxY3M+Kkm14oi4tV25XeCtoS7sVnNAb rCaAWcCxGKSWk3VTiEvvbrMeBq9dGcHiv0l3C4C0TiXrMPUEIJ9OiBbbKXRZ/Yy9tHV+ OZgsE8F1NQ51q1F5m5wgKsh1JyZjI2uODUbTKrh9IQ7sOmt8sTOBgznq1tFQsdUkgoCA Vidg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=YDfes3u6; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id br22si1010156ejb.431.2021.01.20.12.11.19; Wed, 20 Jan 2021 12:11:43 -0800 (PST) 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=@deltatee.com header.s=20200525 header.b=YDfes3u6; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728635AbhATUIE (ORCPT + 99 others); Wed, 20 Jan 2021 15:08:04 -0500 Received: from ale.deltatee.com ([204.191.154.188]:49766 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392827AbhATUHp (ORCPT ); Wed, 20 Jan 2021 15:07:45 -0500 X-Greylist: delayed 969 seconds by postgrey-1.27 at vger.kernel.org; Wed, 20 Jan 2021 15:07:45 EST DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:content-disposition; bh=FpuctqQYr7HiImXDtxO/Xmx4gM6wv9pGDhDLLlURPOs=; b=YDfes3u6g94InF+L7Eb1SDp49B ABL/A4XSKrcHSzyKASffzB6ePsnECaDDQkvIXypGmmkXftC2h9QOeEPd42wGc3VIBWG55Zgz2v5Df 92MzwVRCGqnIYMMyfsb8l5DbMmpQSN0X1kl8GYC6Bd5L0IqmrfYz87adODZr6Wp+Il8JjCbq2Be2A ypbRzyHyYlvm5HZSFt63QRRO/vONle105KzlgMr4uFBap7rhEYZTJTxfP/UmufThWd3xw0vGuUAdQ CRFeQVWe9gdVx+CPwXnmJMIZ+wClHsD0b2DKd1ZndyJKZ53Byq9DQduJ97FWphbVtrWP8/Ni3lL+p h2pFyAfQ==; Received: from s01060023bee90a7d.cg.shawcable.net ([24.64.145.4] helo=[192.168.0.10]) by ale.deltatee.com with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l2JV8-00022C-Hh; Wed, 20 Jan 2021 12:50:47 -0700 To: Dan Williams , gregkh@linuxfoundation.org Cc: Hans Verkuil , Alexandre Belloni , Alexander Viro , Dave Jiang , vishal.l.verma@intel.com, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org References: <161117153248.2853729.2452425259045172318.stgit@dwillia2-desk3.amr.corp.intel.com> <161117153776.2853729.6944617921517514510.stgit@dwillia2-desk3.amr.corp.intel.com> From: Logan Gunthorpe Message-ID: <809823fb-6eb6-8ce9-c49a-d85b03897fc7@deltatee.com> Date: Wed, 20 Jan 2021 12:50:43 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <161117153776.2853729.6944617921517514510.stgit@dwillia2-desk3.amr.corp.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 24.64.145.4 X-SA-Exim-Rcpt-To: linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, vishal.l.verma@intel.com, dave.jiang@intel.com, viro@zeniv.linux.org.uk, alexandre.belloni@free-electrons.com, hans.verkuil@cisco.com, gregkh@linuxfoundation.org, dan.j.williams@intel.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-9.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH 1/3] cdev: Finish the cdev api with queued mode support X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-01-20 12:38 p.m., Dan Williams wrote: > ...common reference count handling scenarios were addressed, but the > shutdown-synchronization problem was only mentioned as something driver > developers need to be aware in the following note: > > NOTE: This guarantees that associated sysfs callbacks are not running > or runnable, however any cdevs already open will remain and their fops > will still be callable even after this function returns. > > Remove that responsibility from driver developers with the concept of a > 'queued' mode for cdevs. I find the queued name confusing. What's being queued? > +static const struct file_operations cdev_queued_fops = { > + .owner = THIS_MODULE, > + .open = cdev_queued_open, > + .unlocked_ioctl = cdev_queued_ioctl, > + .compat_ioctl = compat_ptr_ioctl, > + .llseek = noop_llseek, > +}; Why do we only protect these fops? I'd find it a bit confusing to have ioctl protected from use after del, but not write/read/etc. Logan