Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp522568pxj; Thu, 13 May 2021 10:17:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwekgrJhes+PZadCIjpqArPkb+0XTxqFDD1JQHFdAbkaDIggK41UQJUL7MlO/IJb2i6umqH X-Received: by 2002:a17:907:dab:: with SMTP id go43mr2128641ejc.164.1620926277222; Thu, 13 May 2021 10:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620926277; cv=none; d=google.com; s=arc-20160816; b=OwxXoaTwQIcCYK9G6X/VF0MbXEPd29xbynsub53xjBrldq7LYismlAPuJwtmbtyBO9 C+gGLnHkLzZAJ/HWXPj9VkFr36uJ5xpZ8/YAksCTiEmgF++1h5Ywvuh0m0RPtV8Fjo0A vI0JyCf/9HS/HUCVU+sCQtvEd/hLkw8YawyIP1MD3rjS/7E0qMQZmbIyQoYcvSmpZDIA gUUhod5VczlLt1OmO3+zIMWJn5zsXipX1G3xOp3rPWKqlupGdqhn36FxW1N7IajQony4 3Xs2ILeB9MqLb/peIVtg83nOUyHFtpQDuViVhlDfC+Y50lKnUFbUPnTm1fuufBNc8P3X zH/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tfc1Zzsx0xsKmHbucizWbngUTzNZ1m8bZqhyGG1VDOY=; b=JbnpuZR0jBAZvw1qht1VcWkjWHWXcF/ehaT6O1pH3LsOKmG+s1PBOaUF29f6O1NL/+ HJEjBT7jrDPuqAu35PEuyj8MMAZMISzK79shGkF4tnIeR6KKeN+GMU4Duoy99SVuSXlU ps/Du7mtRXGoPxA9nN98x2rO6Tqcf3dus6wXceg1mImOfL91ZYbOmTV1rgMt7RKf67K3 RPeDlKo9NxKgHjjL5nb+8/ClnSMB0HEm8NEtw/xWbVXBfkkGH8I5CWsXxkxF0b7DyCnQ DaYKe18oAPEq3KD0rGsQ5fHOYbrYQay6ezHg290PA9eXYtXiXwvZyrAcwR3DHuhwnnQd R0RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fdoHk8b6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t16si3473350ejo.378.2021.05.13.10.17.32; Thu, 13 May 2021 10:17:57 -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=@linuxfoundation.org header.s=korg header.b=fdoHk8b6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230352AbhEMRQg (ORCPT + 99 others); Thu, 13 May 2021 13:16:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:52890 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbhEMRQd (ORCPT ); Thu, 13 May 2021 13:16:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 76EFC61408; Thu, 13 May 2021 17:15:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620926122; bh=gkYB58Zv652AxS7gt1nDSfOQyePra0vUUbzM/X8tEug=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fdoHk8b6QwTf/XAGUBVdAoVqYCVrg+tehep+CwO/MNYMWXqkClSJNsCIDIkkcebKp ak2mZjWsvy/QhLUpf/z3iBK97C3F9yXq4HEGKMV8V/rJPsdW5RoIB6adhWVE9rDtfx LD+Gi+vklm44RMENce+DFEMpsS5EUSSTIkk98lm0= Date: Thu, 13 May 2021 19:15:19 +0200 From: Greg Kroah-Hartman To: Maciej Kwapulinski Cc: Arnd Bergmann , Jonathan Corbet , Derek Kiernan , Dragan Cvetic , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Savo Novakovic Subject: Re: [PATCH v3 12/14] intel_gna: add a 'misc' device Message-ID: References: <20210513110040.2268-1-maciej.kwapulinski@linux.intel.com> <20210513110040.2268-13-maciej.kwapulinski@linux.intel.com> <85r1iaimwl.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <85r1iaimwl.fsf@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 13, 2021 at 07:06:18PM +0200, Maciej Kwapulinski wrote: > > Greg Kroah-Hartman writes: > > > On Thu, May 13, 2021 at 01:00:38PM +0200, Maciej Kwapulinski wrote: > >> The new 'misc' device is the node for applications in user space to > >> interact with the driver. > >> > >> Signed-off-by: Maciej Kwapulinski > >> Tested-by: Savo Novakovic > >> --- > >> drivers/misc/intel/gna/device.c | 52 +++++++++++++++++++++++++++++++-- > >> drivers/misc/intel/gna/device.h | 11 +++---- > >> 2 files changed, 55 insertions(+), 8 deletions(-) > >> > >> diff --git a/drivers/misc/intel/gna/device.c b/drivers/misc/intel/gna/device.c > >> index 0e31b8c6bb70..1e6345a8325b 100644 > >> --- a/drivers/misc/intel/gna/device.c > >> +++ b/drivers/misc/intel/gna/device.c > >> @@ -20,6 +20,18 @@ module_param(recovery_timeout, int, 0644); > >> MODULE_PARM_DESC(recovery_timeout, "Recovery timeout in seconds"); > >> #endif > >> > >> +struct file; > >> + > >> +static int gna_open(struct inode *inode, struct file *f) > >> +{ > >> + return -EPERM; > >> +} > > > > That sucks, why have an open that does nothing but fail? > > next patch provides complete implementation of gna_open(), here it's > just a protection if someone would incidentally run gna in the middle of patch series Then don't provide an open at all, and it will be fine :) > > > > >> + > >> +static const struct file_operations gna_file_ops = { > >> + .owner = THIS_MODULE, > >> + .open = gna_open, > >> +}; > >> + > >> static void gna_devm_idr_destroy(void *data) > >> { > >> struct idr *idr = data; > >> @@ -27,6 +39,36 @@ static void gna_devm_idr_destroy(void *data) > >> idr_destroy(idr); > >> } > >> > >> +static void gna_devm_deregister_misc_dev(void *data) > > > > Why is this a void *? > > it goes to devm_add_action() api. Ah. That's not obvious :(