Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp860805yba; Fri, 3 May 2019 11:40:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNnd0cYCXUbe12/s3AsSaxR6OplYJ5xipmwxhG58oiy5WmtYtabdHDV/H1u0WFd/VFLx6N X-Received: by 2002:a63:d10:: with SMTP id c16mr12169201pgl.156.1556908806067; Fri, 03 May 2019 11:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556908806; cv=none; d=google.com; s=arc-20160816; b=ZJlVotbFOKVUCS+HnafKSh2mmxxYTtaJlEAOZsZs4VSop780f/S8J468Asq28BazI7 xQFjABf4q9FZWC2sbNjDwOrIrHBTkdoPiiLlUl8ycoHJ2fcX1Wu+tKjQpFCRqW7lHUu1 5Qo/ZkgQh6oltTDDFdf+UtHnVihwWwBP1/jWGr+FcQQupGtECm4Dk13s/Z2NzsjcAs2c rS9QlJ4eHqPSB6F9a2Wfr3xZ4YNaYsrRXZy8ywYeTw/WNvLHRCADzt9ztTqaG7jxAFsd flj29HDw9WIgciGhq/ybS4Hw3WCrbUtxBbD0byfj6v9z8FOUGkt5uSwXcF7vt4sWC8rt mplg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=/FFXXP1GaK1ON9h27xOe8RrwNYt8sjfSvo1Mwn/29ME=; b=xuy42R83GRk7clyw0mtkJQyTWYWg58B5qapPoP/75OI8b3S4Kf++UdAfCSeBVIzI7w /hvBteikpbBu0fFd+pItgJsS8UgHkMkv5o6TZED2YqPzpbUv04HWmEb/BulbKV7BHbmR kkdrAodEBHAB92bG6S17XFzi7dtVHA8Ct/evFFW3i0V8K9FgydHtwnDwlBZ/B5yeQYZj VUnvUyx7X31AXUpv52GPMT4yjiaUKkywnCKXnjnB2pQfuyV1ciXOXsWrpsQfZ/xzsQc9 B8vL3A2VfCwdV8kfw1bAyf+4Hj635qSR6mFzmP8/DaYCEKCB3CxbkhjOg/Fy3yxmLoJD xIjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=4oGpEXFe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a15si3483079pgd.166.2019.05.03.11.39.49; Fri, 03 May 2019 11:40:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=4oGpEXFe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728509AbfECQl0 (ORCPT + 99 others); Fri, 3 May 2019 12:41:26 -0400 Received: from mail-eopbgr730048.outbound.protection.outlook.com ([40.107.73.48]:59104 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726719AbfECQl0 (ORCPT ); Fri, 3 May 2019 12:41:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/FFXXP1GaK1ON9h27xOe8RrwNYt8sjfSvo1Mwn/29ME=; b=4oGpEXFef2G8MaR36iL4WPPuM3Q3AudgFfsfCkfL7cx+rP8Pm02AKAtwJg4EWvWDExv3K1/ZXNiHLdGSmG4FHImR215EgQvd2tRRnduPdP6vo4VdI1XFBvC+CExJ07mq+CQplTb2XTH5Kjs9tniNXAsW1FS47XKN8ixbZdb+xIQ= Received: from BL0PR02MB5681.namprd02.prod.outlook.com (20.177.241.92) by BL0PR02MB3764.namprd02.prod.outlook.com (52.132.8.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Fri, 3 May 2019 16:41:22 +0000 Received: from BL0PR02MB5681.namprd02.prod.outlook.com ([fe80::6cde:f726:b36e:752d]) by BL0PR02MB5681.namprd02.prod.outlook.com ([fe80::6cde:f726:b36e:752d%5]) with mapi id 15.20.1856.012; Fri, 3 May 2019 16:41:22 +0000 From: Dragan Cvetic To: Greg KH 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 Thread-Topic: [PATCH V3 02/12] misc: xilinx-sdfec: add core driver Thread-Index: AQHU/UVOyBvhwX5Hf0mi9G9IHzQgRKZYHAiAgAGBAEA= Date: Fri, 3 May 2019 16:41:21 +0000 Message-ID: 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> In-Reply-To: <20190502172007.GA1874@kroah.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=draganc@xilinx.com; x-originating-ip: [149.199.80.133] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 20ecc15a-232a-480b-d330-08d6cfe62cc5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:BL0PR02MB3764; x-ms-traffictypediagnostic: BL0PR02MB3764: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 0026334A56 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(39860400002)(136003)(376002)(366004)(346002)(199004)(189003)(13464003)(54906003)(107886003)(4326008)(25786009)(66556008)(66446008)(316002)(7736002)(52536014)(76116006)(73956011)(6246003)(66946007)(186003)(6436002)(9686003)(71200400001)(71190400001)(26005)(3846002)(6116002)(55016002)(53936002)(14454004)(68736007)(478600001)(14444005)(256004)(229853002)(5660300002)(11346002)(2906002)(305945005)(66476007)(86362001)(6506007)(53546011)(64756008)(446003)(486006)(99286004)(74316002)(102836004)(6916009)(8936002)(8676002)(476003)(33656002)(7696005)(76176011)(81166006)(81156014)(66066001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR02MB3764;H:BL0PR02MB5681.namprd02.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: xilinx.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: V4esCaVumuYM+hZPb1IuVRCBY7Ao+W9KKk+9xuXJnw4KnbNgaBYLF3IzdthqP0VOTgjtaY0LKQsxZihVasBlbn3oOSVhnXUVAY1rlZONgskikrlhgMdr5cucfJ042g0T/8rGSfFLCFgv7bl163T7gpMArgAP23YILwCjc6WuOUYGATXXfUdRXK9xZuZu3tZ1jSAqwmvcOowxXk62LJfyW0pWXfn7whihitZgYkhMrCah/OJ9GcjVz6qQ991w4JsfDISW2K/30dd03k/Q9kwkum37M/sd2xuY7vXmoGoWUYOXBjt8HQqNz7ezGu6jQlIY4EAWyJNYM1l+MpGeb77QXFhhhfV6JCpQA1tKMRCfy/KqsM5Dow3JLZTPuG6FM/jgnAm7fcNUYgL1DDubjXVrfbQ3w1427ffKestg055HitU= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20ecc15a-232a-480b-d330-08d6cfe62cc5 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 May 2019 16:41:21.8774 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB3764 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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@li= sts.infradead.org; robh+dt@kernel.org; > mark.rutland@arm.com; devicetree@vger.kernel.org; linux-kernel@vger.kerne= l.org; Derek Kiernan > Subject: Re: [PATCH V3 02/12] misc: xilinx-sdfec: add core driver >=20 > On Sat, Apr 27, 2019 at 11:04:56PM +0100, Dragan Cvetic wrote: > > +#define DRIVER_NAME "xilinx_sdfec" > > +#define DRIVER_VERSION "0.3" >=20 > Version means nothing with the driver in the kernel tree, please remove > it. Will be removed. Thank you. >=20 > > +#define DRIVER_MAX_DEV BIT(MINORBITS) >=20 > Why this number? Why limit yourself to any number? >=20 There can be max 8 devices for this driver. I'll change to 8. > > + > > +static struct class *xsdfec_class; >=20 > Do you really need your own class? When writing a character device driver, my goal is to create and register a= n 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/. >=20 > > +static atomic_t xsdfec_ndevs =3D ATOMIC_INIT(0); >=20 > Why? At the end this become a minor number.=20 It is not needed, will be removed. Thanks. >=20 > > +static dev_t xsdfec_devt; >=20 > Why? >=20 > Why not use misc_device for this? Why do you need your own major with a > bunch of minor devices reserved ahead of time? Why not just create a > new misc device for every individual device that happens to be found in > the system? That will make the code a lot simpler and smaller and > easier. > >=20 >=20 > > + > > +/** > > + * struct xsdfec_dev - Driver data for SDFEC > > + * @regs: device physical base address > > + * @dev: pointer to device struct > > + * @config: Configuration of the SDFEC device > > + * @open_count: Count of char device being opened > > + * @xsdfec_cdev: Character device handle > > + * @irq_lock: Driver spinlock > > + * > > + * This structure contains necessary state for SDFEC driver to operate > > + */ > > +struct xsdfec_dev { > > + void __iomem *regs; > > + struct device *dev; > > + struct xsdfec_config config; > > + atomic_t open_count; > > + struct cdev xsdfec_cdev; > > + /* Spinlock to protect state_updated and stats_updated */ > > + spinlock_t irq_lock; > > +}; > > + > > +static const struct file_operations xsdfec_fops =3D { > > + .owner =3D THIS_MODULE, > > +}; >=20 > No operations at all? That's an easy driver :) The operations are implemented in the later patches. >=20 > thanks, >=20 > greg k-h