From owner-freebsd-current@FreeBSD.ORG Thu Dec 4 18:10:53 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 441891065672 for ; Thu, 4 Dec 2008 18:10:53 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.29]) by mx1.freebsd.org (Postfix) with ESMTP id E8AF18FC1A for ; Thu, 4 Dec 2008 18:10:52 +0000 (UTC) (envelope-from onemda@gmail.com) Received: by yx-out-2324.google.com with SMTP id 8so1790335yxb.13 for ; Thu, 04 Dec 2008 10:10:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=ZFNe71EF3UwxKxxx64DXgnc2XD6JmKJaozSw0RSRIj8=; b=nB8V8LoGapLzEAFZ4COcf65wLF5tmaXlxQYm0dnscoVJ2U6zk0VFHYTPgH891t1+/H I2zQBxjkGvySZSY4zn6GDU5Ap8Lse6Utsva5Vp1UmA+VZsFgX972Wge4xV47pxDAwOSN QKvyuX1YQJ+BB4HYLEgYU/MYHtlviYxSbrD7o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=EPa/1bwf1CFvuHEQXr752raexcVbcUfbpQAEAXdyq8cZkD9OK91xA9Hc4UaUXl515u mTK97kS40w0Un5XRrjcHP6+cH0Ic+IiBSKtVi8L+chnd33qxyNP+tQi7U4jR71moQ7Mm 31JuekQkNjNbujffZgIuUymlFqQYGCVmWMTKQ= Received: by 10.231.30.198 with SMTP id v6mr148924ibc.26.1228414251598; Thu, 04 Dec 2008 10:10:51 -0800 (PST) Received: by 10.231.19.11 with HTTP; Thu, 4 Dec 2008 10:10:51 -0800 (PST) Message-ID: <3a142e750812041010n34fbb9bdm9032299d1ab734ab@mail.gmail.com> Date: Thu, 4 Dec 2008 19:10:51 +0100 From: "Paul B. Mahol" To: "Maksim Yevmenkin" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7d6fde3d0812040324y3bf0901cy1f4a6d961362c314@mail.gmail.com> <3a142e750812040734g26ecda23pfe646c27521cdc82@mail.gmail.com> <3a142e750812040800h5bfa55fcsf52675c425183f8a@mail.gmail.com> Cc: current@freebsd.org Subject: Re: RFC: small syscons and kbd patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2008 18:10:53 -0000 On 12/4/08, Maksim Yevmenkin wrote: > On Thu, Dec 4, 2008 at 8:00 AM, Paul B. Mahol wrote: >> On 12/4/08, Paul B. Mahol wrote: >>> On 12/4/08, Maksim Yevmenkin wrote: >>>> On Thu, Dec 4, 2008 at 3:24 AM, Garrett Cooper >>>> wrote: >>>>> On Tue, Dec 2, 2008 at 5:01 PM, Maksim Yevmenkin >>>>> wrote: >>>>>> Dear Hackers, >>>>>> >>>>>> can someone please review the attached small patch for syscons and >>>>>> kbd? it should be a no-op mostly. the patch basically does >>>>>> >>>>>> 1) removes bogus layering in syscons, i.e. basically removes >>>>>> sccngetch(); >>>>>> 2) implements advisory lock for kbd (based on atomic(9)); >>>>>> 3) implements new POLLED flag for kbd; >>>>>> >>>>>> this is a part of a plan to fix keyboard access races in syscons. >>>>>> >>>>>> thanks, >>>>>> max >>>>> >>>>> Max, >>>>> Why are you double and triple negating on this line? >>>>> >>>>> + return (atomic_cmpset_acq_int(&kbd->kb_locked, !!!on, !!on)); >>>> >>>> the idea was to ensure that kbd->kb_locked variable only takes values >>>> 0 (zero) and 1 (one). >>>> >>>> thanks, >>>> max >>>> _______________________________________________ >>>> freebsd-current@freebsd.org mailing list >>>> http://lists.freebsd.org/mailman/listinfo/freebsd-current >>>> To unsubscribe, send any mail to >>>> "freebsd-current-unsubscribe@freebsd.org" >>>> >>> >>> Maybe it is usefull to report, maybe not. >>> >>> I'm experiencing keyboard (atkbd) death now and then when inside Xorg >>> once >>> Xorg is started in following (racey) way: >>> >>> alias onlyx "/usr/local/bin/xinit -- -nolisten tcp -br & && >>> exit" >>> >>> and /etc/csh.logout: >>> >>> echo $TERM | grep cons25 >> /dev/null && clear && vidcontrol -C >>> >>> I will test it and report if it fix my "problem". >> >> No luck. > > sorry, but the patch was not really intended to fix anything yet. it > was just a small bit. > >> Typing blindly I managed to panic from kdb, and I got only this: >> >> KDB: enter: manual escape to debugger Manul ecape to debugger. >> panic: from debugger >> cpuid = 1 >> KDB: stack backtrace: >> panic: bufwrite: buffer is not busy??? > > this looks like it came from ffs_bufwrite() in ufs/ffs/ffs_vfsops.c > >> cpuid = 1 >> KDB: enter: panic >> exclusive sleep mutex Giant (Giant) r = 1 (0xc0725a70) locked @ >> /usr/src/sys/dev >> /syscons/syscons.c:618 >> > > can you please setup a serial console and reproduce the panic? > > thanks > max > No, it is not panic, I manualy paniced it because display was blank and keyboard did not worked inside Xorg (ctr+alt+backpace didn't work), but ctrl+alt+esc worked after some time and I blindly typed panic, followed with enter. -- Paul