From owner-freebsd-hackers@freebsd.org Mon Nov 4 11:35:20 2019 Return-Path: Delivered-To: freebsd-hackers@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 4DD9F17D055 for ; Mon, 4 Nov 2019 11:35:20 +0000 (UTC) (envelope-from freebsd-hackers@dino.sk) Received: from mailhost.netlabit.sk (mailhost.netlabit.sk [84.245.65.72]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4769hR092wz4KBK for ; Mon, 4 Nov 2019 11:35:18 +0000 (UTC) (envelope-from freebsd-hackers@dino.sk) Received: from zeta.dino.sk (fw3.dino.sk [84.245.95.254]) (AUTH: LOGIN milan) by mailhost.netlabit.sk with ESMTPA; Mon, 04 Nov 2019 12:28:17 +0100 id 00F407FC.5DC00B51.000051D8 Date: Mon, 4 Nov 2019 12:28:16 +0100 From: Milan Obuch To: freebsd-hackers@freebsd.org Cc: Oleksandr Tymoshenko , Oliver Pinter Subject: Re: UART driver as kld - how? Message-ID: <20191104122816.63647120@zeta.dino.sk> In-Reply-To: <20191103130118.36fa6eec@zeta.dino.sk> References: <20191027214209.712d62ca@zeta.dino.sk> <20191027232956.28b11772@zeta.dino.sk> <20191028191005.GA89835@bluezbox.com> <20191028201952.20a92307@zeta.dino.sk> <20191102214100.500ba493@zeta.dino.sk> <20191103042321.GA49790@bluezbox.com> <20191103130118.36fa6eec@zeta.dino.sk> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i386-portbld-freebsd11.3) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4769hR092wz4KBK X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-hackers@dino.sk designates 84.245.65.72 as permitted sender) smtp.mailfrom=freebsd-hackers@dino.sk X-Spamd-Result: default: False [-4.14 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dino.sk]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[72.65.245.84.list.dnswl.org : 127.0.10.0]; IP_SCORE(-2.84)[ip: (-7.98), ipnet: 84.245.64.0/18(-3.99), asn: 16160(-2.32), country: SK(0.08)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:16160, ipnet:84.245.64.0/18, country:SK]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 11:35:20 -0000 On Sun, 3 Nov 2019 13:01:18 +0100 Milan Obuch wrote: > On Sat, 2 Nov 2019 21:23:21 -0700 > Oleksandr Tymoshenko wrote: > > > Milan Obuch (freebsd-hackers@dino.sk) wrote: [ snip ] > > > I am sure I need docs/description for other functions as well, so > > > if anybody knows where good uart framework description could be > > > found, please advice. Or if somebody already has good > > > understanding of it and could help me with my issues, it wil be > > > greatly appreciated. > > > > if you follow uart_dev_snsps.c template, the sc_class is set in > > probe function: [ snip ] > I totally overlooked the obvious... yes, you are right. > > [ snip ] > > > In your case, my guess would be: you either do not set the sc_class > > member var in probe function or your base var is not the first in > > the struct. > > > > Back to testing... probe function now does work, so I am going to > analyze what should be done in attach... and why I am getting now > panic... I'll write again when I find another obstacle I do not > understand or I have working driver, whatever comes first :) > Now I am getting further... attach works now, device nodes expected are being created, but there are some warnings mentioning locks on detach. Also, my hardware design currently does not use interrupts. Do we have any example of uart device being polled? Regards, Milan