From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,T_DKIMWL_WL_HIGH, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E79EC004C9 for ; Tue, 7 May 2019 12:21:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D2EE9205ED for ; Tue, 7 May 2019 12:21:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tTA6slVQ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="tojakutQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2EE9205ED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zhSVngV4GVF8Sg/VTsbA/od4oBa5YJ9vdKvfVh5T2o8=; b=tTA6slVQC6TY5e paiusij3XKGY4ksFDHCKNJm0SJfNmjPdzYnnJ7sXtajXnorPR9HRCKv67AiE0+HOzRQN9t/6cPpeE pDl1WMayO90WI2qx0WlgJcCM/mxhO/QDSWrEnx4UVPk3HVcbe2XJwzTfJ+/uWPF80BICLOqtkVuaM 1kLM92C4i21jwdftJwmiJKzIsEiugymULtiIO9fRrrg/PLmJIHdTpJClIs7bUZalKG26lGeQ2IJ4N IdJAdhFWZC+S9tWplwKIRcLyDHjlq/m0Fw1e2PsD4/oPjpEOUdObsHWxOTvL7mo2VtlxGGLiQMaV6 aTfT0fKlmRhvaaQdxyWA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hNz5w-0005J2-1S; Tue, 07 May 2019 12:21:16 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hNz5s-00057w-86 for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2019 12:21:13 +0000 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 326C1205ED; Tue, 7 May 2019 12:21:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557231669; bh=AGYkrEj2uxk4UWcYj5hJT4ocZ0MX1hx3P87PhI15ZXM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tojakutQbyKkgVrhxp/DED5mzzPfcAHNxVtUCrrvxOHZiVyr/rUMEKYCy/SGEEOkL ENhJIHzuORYDeGzGqGSPCid/tbPKEmYheiTe7W6hRJ8MiaVeEQkQRiiEvyxAiFZjUg lPPHP6wFfjD4w8kFE5TIkK33w4GgUYw3wMIMrPc8= Date: Tue, 7 May 2019 14:21:06 +0200 From: Greg KH To: Dragan Cvetic Subject: Re: [PATCH V3 02/12] misc: xilinx-sdfec: add core driver Message-ID: <20190507122106.GA7873@kroah.com> References: <1556402706-176271-1-git-send-email-dragan.cvetic@xilinx.com> <1556402706-176271-3-git-send-email-dragan.cvetic@xilinx.com> <20190502172007.GA1874@kroah.com> <20190504075502.GA11133@kroah.com> <20190506123425.GA26360@kroah.com> <20190507093941.GC20355@kroah.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190507_052112_327383_2CB9F27C X-CRM114-Status: GOOD ( 25.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "mark.rutland@arm.com" , "devicetree@vger.kernel.org" , "arnd@arndb.de" , "linux-kernel@vger.kernel.org" , "robh+dt@kernel.org" , Michal Simek , Derek Kiernan , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 07, 2019 at 11:55:42AM +0000, Dragan Cvetic wrote: > > > > -----Original Message----- > > From: Greg KH [mailto:gregkh@linuxfoundation.org] > > Sent: Tuesday 7 May 2019 10:40 > > To: Dragan Cvetic > > Cc: arnd@arndb.de; Michal Simek ; linux-arm-kernel@lists.infradead.org; robh+dt@kernel.org; > > mark.rutland@arm.com; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; Derek Kiernan > > Subject: Re: [PATCH V3 02/12] misc: xilinx-sdfec: add core driver > > > > On Tue, May 07, 2019 at 08:48:41AM +0000, Dragan Cvetic wrote: > > > > > > > > > > -----Original Message----- > > > > From: Greg KH [mailto:gregkh@linuxfoundation.org] > > > > Sent: Monday 6 May 2019 13:34 > > > > To: Dragan Cvetic > > > > Cc: arnd@arndb.de; Michal Simek ; linux-arm-kernel@lists.infradead.org; robh+dt@kernel.org; > > > > mark.rutland@arm.com; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; Derek Kiernan > > > > Subject: Re: [PATCH V3 02/12] misc: xilinx-sdfec: add core driver > > > > > > > > On Mon, May 06, 2019 at 12:23:56PM +0000, Dragan Cvetic wrote: > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > From: Greg KH [mailto:gregkh@linuxfoundation.org] > > > > > > Sent: Saturday 4 May 2019 08:55 > > > > > > To: Dragan Cvetic > > > > > > Cc: arnd@arndb.de; Michal Simek ; linux-arm-kernel@lists.infradead.org; robh+dt@kernel.org; > > > > > > mark.rutland@arm.com; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; Derek Kiernan > > > > > > Subject: Re: [PATCH V3 02/12] misc: xilinx-sdfec: add core driver > > > > > > > > > > > > On Fri, May 03, 2019 at 04:41:21PM +0000, Dragan Cvetic wrote: > > > > > > > Hi Greg, > > > > > > > > > > > > > > Please find my inline comments below, > > > > > > > > > > > > > > Regards > > > > > > > Dragan > > > > > > > > > > > > > > > -----Original Message----- > > > > > > > > From: Greg KH [mailto:gregkh@linuxfoundation.org] > > > > > > > > Sent: Thursday 2 May 2019 18:20 > > > > > > > > To: Dragan Cvetic > > > > > > > > Cc: arnd@arndb.de; Michal Simek ; linux-arm-kernel@lists.infradead.org; robh+dt@kernel.org; > > > > > > > > mark.rutland@arm.com; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; Derek Kiernan > > > > > > > > Subject: Re: [PATCH V3 02/12] misc: xilinx-sdfec: add core driver > > > > > > > > > > > > > > > > On Sat, Apr 27, 2019 at 11:04:56PM +0100, Dragan Cvetic wrote: > > > > > > > > > +#define DRIVER_NAME "xilinx_sdfec" > > > > > > > > > +#define DRIVER_VERSION "0.3" > > > > > > > > > > > > > > > > Version means nothing with the driver in the kernel tree, please remove > > > > > > > > it. > > > > > > > > > > > > > > Will be removed. Thank you. > > > > > > > > > > > > > > > > > > > > > > > > +#define DRIVER_MAX_DEV BIT(MINORBITS) > > > > > > > > > > > > > > > > Why this number? Why limit yourself to any number? > > > > > > > > > > > > > > > > > > > > > > There can be max 8 devices for this driver. I'll change to 8. > > > > > > > > > > > > > > > > + > > > > > > > > > +static struct class *xsdfec_class; > > > > > > > > > > > > > > > > Do you really need your own class? > > > > > > > > > > > > > > When writing a character device driver, my goal is to create and register an instance > > > > > > > of that structure associated with a struct file_operations, exposing a set of operations > > > > > > > to the user-space. One of the steps to make this goal is Create a class for a devices, > > > > > > > visible in /sys/class/. > > > > > > > > > > > > Why do you need a class? Again, why not just use the misc_device api, > > > > > > that seems much more relevant here and will make the code a lot simpler. > > > > > > > > > > > > > > > > The driver can have 8 devices in SoC plus more in Programming Logic. > > > > > It looked logical to group them under the same MAJOR, although they > > > > > are independent of each other. Is this argument strong enough to use > > > > > class? > > > > > > > > Not really :) > > > > > > > > 8 devices is pretty small. What tool will be trying to talk to all of > > > > these devices and how was it going to find out what devices were in the > > > > system? > > > > > > > > > > These devices are Forward Error Correction encoder/decoder > > > and will be part of the RF communication chain. They will be included > > > in the system through DT. Also, described in DT. > > > > Userspace doesn't mess with DT. > > > > I am asking what userspace tool/program is going to be interacting with > > these devices through your now-custom api you are creating. Do you have > > a link to that software, and how is that code doing the "determine what > > device nodes are associated with what devices" logic? > > > > Example code is not public yet, sorry. Ok, then I think we need to wait for that to get this merged at the minimum, don't you agree? Otherwise how do we even know that any of these codepaths are tested? > The index number in the device name > is a link to device, see snippet from the example code: > > #define FEC_DEC "/dev/xsdfec0" > dec_fd = open_xsdfec(FEC_DEC); > > The index number corresponds to the device order in DT. So that implies you don't need a class at all, right? thanks, greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel