From owner-freebsd-arm@freebsd.org Fri Nov 27 17:17:00 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6BD84ACB6C for ; Fri, 27 Nov 2020 17:17:00 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5a.ore.mailhop.org (outbound5a.ore.mailhop.org [44.233.67.66]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjLs82tY0z3mg1 for ; Fri, 27 Nov 2020 17:17:00 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1606497419; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=YdMCFDm2uqpOrZ0g9VLAX9WyxSgRPVnsS02pV7yFhmsmoXuKwmLwuTFPm1pAhm0nyiYuljA5ljRoS XD4DOvtET4xrX4/gyo8B4RBDrYMrMJ33wg/6YuxSaJGW8y67glF/giLuEnh6uPjZ/aKXKQSic3q03g 7T7F10Me0Cq1z0JbzrrBe/B6kPsq3Fvwq/ybUCMW/OquLQUOO/AnYvnpl9adKLgT9vWgVc4S0J2Vh7 pUpLXSsxYrv/i9tdId9amDGU1+oPm/Cu4nU+Ml3FOJR5CrneAFET98VXZHvpB3fyUo46r1o3E4khd9 cwhKiW0e8mMDhPjjDwiu43CP5aEzw2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=bsBNMxN2gbjmVl5U4Pdkg32AiWSSfqGorhNoC36ljhE=; b=G+i65tmzojYE8CQJrpVAlAPK2q1YN6xGmmTgIWEA6k/OxDPUAmZSeO0+RX4EI7iCoRcNCUK1Dfymw hfAkfLfi6nHUTJDHzbdkO2ypYJnUU/mdRK/TVCrvjau3L1U7Zd2m9HsgV+ZYJbLPu9KmY3dBbF0TcE YAadOYxJTIZA72uWnyiuc3P2gSGyi77M8n0m0EVa0FyY7S03cZAzXOQyUC4V2EFx7Xs1+yWdv79I8K Wizn+6NQxb1mCkqv3d9fy2E/KG+/RWjMyzQw1aNcAFo7Y2UvGWgRiEB+ejG9X8YfOiH+AVwIdz9TYM 5iP3tfml0hMeEO6RyBvDO5olfT50HWA== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=bsBNMxN2gbjmVl5U4Pdkg32AiWSSfqGorhNoC36ljhE=; b=barVRNFnQbNeAs1dAlupHoufWMO5OR0nH7/r7waLLm3J5bN70QGbKyV3CmQ+VBJVh+8BtridN3z8i IZ7bvZ4snGb2RVdoxuqlr9LbbtJ7JIoi060Rvh8kRW1zmMcZFSOz6Rcawkvi2Rojj57t6q/IY8CovN LQUH1UIwoV3taBENs5W7Ij8QlPqEWWsXpt5gP7jp6djJjWlfYaKBcP3zw6HD+cNgGjA15lBYeds6ha snqoJqziPAvRJsa0UgMw66+AfhOFbQsKSJGuxWRVTRGICm60qslz/Z+RiHWp2gC5S7ar1Jl2zJYn4b pafdFJGGCegwZrdjG9/UmIcBAtoIF+Q== X-MHO-RoutePath: aGlwcGll X-MHO-User: 589980e0-30d4-11eb-8b39-614106969e8d X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 589980e0-30d4-11eb-8b39-614106969e8d; Fri, 27 Nov 2020 17:16:58 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 0ARHGrR1080432; Fri, 27 Nov 2020 10:16:54 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <08649892ca2ab434c261d36e0e13ba051086de6f.camel@freebsd.org> Subject: Re: User Space GPIO Interrupt programming - GSoC-2018 From: Ian Lepore To: Vladimir Goncharov , freebsd-arm@freebsd.org Date: Fri, 27 Nov 2020 10:16:53 -0700 In-Reply-To: <54ffe2d2-01a2-8b43-94fa-aee4a3f89861@viruzzz.org> References: <2B01780F-D367-48A3-A827-B479030A496D@obsigna.com> <8d806302-479c-ca34-3fdb-96d27f40e212@viruzzz.org> <8655AF30-273B-48E7-98CD-007AA1D265F5@obsigna.com> <54ffe2d2-01a2-8b43-94fa-aee4a3f89861@viruzzz.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CjLs82tY0z3mg1 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:16509, ipnet:44.224.0.0/11, country:US] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 17:17:00 -0000 On Fri, 2020-11-27 at 14:28 +0300, Vladimir Goncharov wrote: > Here it is. > There is struct gpioc_event with pin number and bintime which is send > to userspace. > > Also I'm thinking about to implementation notofication without extra > reading from socket via struct kevent's extra fields (fflags/ext[4]), > looks like it is possible. > Please don't top-post on freebsd mailing lists. I think we need a way for the app to choose whether it wants simple reporting of pin number (like the original code) perhaps along with a count, versus requesting detailed per-event data. I'm going to propose something more detailed about this as soon as I get my thoughts all organized. I also want to get the original code and the locking fixes I've done to it into a phab review for people to start looking at before starting to do new major changes to it. Allocating memory in the interrupt handler isn't a good idea, it will just increase latency on processing other pin interrupts and lead to inaccurate timestamps. IMO, it would be better to allocate a fixed array of events; when the app requests detailed event reporting it can request the number of stored events it wants handled and we could allocate all at once based on that. -- Ian