Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp504855pxb; Wed, 20 Jan 2021 12:25:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxoPmU37IySnMNJI99PnB8D+Gl+KTbnmSttUsW1qMwOgHgArG57IB+w0ZcJJWsS0fAX96Gx X-Received: by 2002:a17:907:7255:: with SMTP id ds21mr7249180ejc.258.1611174334741; Wed, 20 Jan 2021 12:25:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611174334; cv=none; d=google.com; s=arc-20160816; b=J7OuCnpZ5NgdMmaUbNbkx2xDm1JP9darl5TarqF7665eYS9ZCeNHYAPxUBiQZb/EGQ uQK0rBOLWygBg35ZEAOoblXBn5pWYebivibDNY/chzAk5lcylX+iE3ZeZTynTx9DjF14 aahz6YmdN5daLpy3zdeO0M6lSXQO3ih2aKVtXFWxEW/sbfVnSV14xwquLDWMj9zYXMnm IgDywV92S5ovDLL2Kw0Mg63/ZoBn7TUDuzAtRclwm5JLw+R4EeMB09+2nMlv6KDk+YR5 gML0vmWO5KrpCA+W08UUOafGF8OUtsuyHh54JcarHpRY4ASB8T1QLvo/oLk+a74w3ej0 ZXfQ== 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=FCzet5L0nxCVD8lCgMuy9Zk/SXca20QY9TXFaVfK/m0=; b=BGwjMeuPJJsVKb1CEAMPO+2thLc/9UEg5tBgx+c9PBrClSdcQxMXU3bM7LFxB6E5m6 c1c3cf+e5Ty6aer0rr0MPO8/Qnko4E4VZpjx2PXQZTOgiSXobZv8M4j3YB3caVeBICY/ 3Zdhn/OtMXK5Xs/9Z2Ep/HCDK8EACzygOyHkwt5xigmlLq+P/Tg5T+9Uf6PfAPbdBUQp Poe2G7/ftJIXsyPjGQBAOthRJSUiH3OpRS/v2HkrsXH7j5qZHXWXlBRXUNVRZSKhOQFv hRkoiAR5YkV22pB3ExDndIYnJrS+RsU/jxaW11jb8dkb5LsLxL3/NUxmzrrPGlrQ+v76 UiJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=z7ZgwC01; 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 o8si980172ejn.500.2021.01.20.12.25.10; Wed, 20 Jan 2021 12:25:34 -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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=z7ZgwC01; 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 S2388029AbhATUW3 (ORCPT + 99 others); Wed, 20 Jan 2021 15:22:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387806AbhATUVs (ORCPT ); Wed, 20 Jan 2021 15:21:48 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A02D4C061575 for ; Wed, 20 Jan 2021 12:21:07 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id hs11so33009920ejc.1 for ; Wed, 20 Jan 2021 12:21:07 -0800 (PST) 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=FCzet5L0nxCVD8lCgMuy9Zk/SXca20QY9TXFaVfK/m0=; b=z7ZgwC01LO6kgIolKQifAjUHfIK8S7ZunUxX5mw3TJaRwa5fSmFkN2Zb9ul9Yimez7 FVl4u9G/CbX7Z6bQlVHfAeFphktTJLhYp+YoI2ONOEyuj/ivvmuPreQDsWzCKEBdpZW9 3ioqFQZ3flqzB5RhaG7bfK6LLkY02hXNnYD0twiunfHczGXixZZiZorsav09qFpw7SwY a1mtJcWxN5sw8Krdc5ddQa5mVad+IKmUIil9HpJZZLOr29jhxFsP9HVPnOu6ZfN6e3tu as6Hw9D2MQkS1hidKgv03sNmslKNsHl823y6tACzbe416AwXjBVwEHF5jww90sT1RRFi SrzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FCzet5L0nxCVD8lCgMuy9Zk/SXca20QY9TXFaVfK/m0=; b=OP3mn3k3Rf1ah+/ntvG7slWMqYiRPsA+Dxe/3zwkw1aK8G3M1hrv30a3ftm431Ydna 4uURvYyLk2OHWXPlBKELPRA9dtfkv7R7IZtC/CYTTMkS17iOlOI5vN7ms97COcqe8sp0 z0GerQGE6FCpRcEa6yLd6NdUELkisq5S25WhjnB6am8ei0Zhy/19edoDA10oOt1d5OF6 /LeFzgHLo8X0tVlSrd4y2NYI2e1ZRYMuvysawyjn5gsHBYjB9HxFKY8KcLZtruPulF4V yb14PbxwI1jwydLJbKdJm9PoOJ26GI3tUgpGnd7+PE1opdIL1tkxds92pPq9H/WOCKju jgSg== X-Gm-Message-State: AOAM533xHVT1sGaWWXT5C09QirJM7M8ljDtWxEgx21fkR8PT11s71pvS VzafoSfR70E9AUUDEU/I+0zg8V/oHCEoukRjzmJfOM1TDLM= X-Received: by 2002:a17:907:d8e:: with SMTP id go14mr7317695ejc.472.1611174066233; Wed, 20 Jan 2021 12:21:06 -0800 (PST) MIME-Version: 1.0 References: <161117153248.2853729.2452425259045172318.stgit@dwillia2-desk3.amr.corp.intel.com> <161117153776.2853729.6944617921517514510.stgit@dwillia2-desk3.amr.corp.intel.com> <20210120194609.GA3843758@infradead.org> In-Reply-To: <20210120194609.GA3843758@infradead.org> From: Dan Williams Date: Wed, 20 Jan 2021 12:20:59 -0800 Message-ID: Subject: Re: [PATCH 1/3] cdev: Finish the cdev api with queued mode support To: Christoph Hellwig Cc: Greg KH , Logan Gunthorpe , Hans Verkuil , Alexandre Belloni , Alexander Viro , Linux Kernel Mailing List , linux-nvdimm Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 11:46 AM Christoph Hellwig wrote: > > The subject doesn't make any sense to me. > > But thn again queued sound really weird. You just have a managed > API with a refcount and synchronization, right? Correct. "queue" was in reference to the way q_usage_count behaves, but yes, just refcount + synchronization is all this is. > > procfs and debugfs already support these kind of managed ops, kinda sad > to duplicate this concept yet another time. Oh, I didn't realize there were managed ops there, I'll go take a look and see if cdev can adopt that scheme. > > +static long cdev_queued_ioctl(struct file *file, unsigned int cmd, unsigned long arg) > > Overly long line. > > > +__must_check int __cdev_register_queued(struct cdev *cdev, struct module *owner, > > + dev_t dev, unsigned count, > > + const struct cdev_operations *qops) > > +{ > > + int rc; > > + > > + if (!qops->ioctl || !owner) > > + return -EINVAL; > > Why is the ioctl method mandatory? Yeah, that can drop. It was there more to ask the question about whether cdev should be mandating ioctls with pointer arguments and taking the need to specify the compat fallback away from a driver responsibility.