From owner-svn-src-all@FreeBSD.ORG Thu Mar 27 15:28:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6528CFA; Thu, 27 Mar 2014 15:28:02 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (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 AD1B7DCF; Thu, 27 Mar 2014 15:28:02 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9C508B918; Thu, 27 Mar 2014 11:28:00 -0400 (EDT) From: John Baldwin To: Takanori Watanabe Subject: Re: svn commit: r263795 - head/sys/x86/acpica Date: Thu, 27 Mar 2014 10:39:26 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201403270636.s2R6adgZ024745@svn.freebsd.org> In-Reply-To: <201403270636.s2R6adgZ024745@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201403271039.26897.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 27 Mar 2014 11:28:00 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 15:28:02 -0000 On Thursday, March 27, 2014 2:36:39 am Takanori Watanabe wrote: > Author: takawata > Date: Thu Mar 27 06:36:38 2014 > New Revision: 263795 > URL: http://svnweb.freebsd.org/changeset/base/263795 > > Log: > Strict value checking will cause problem. > Bay trail DN2820FYKH is supported on Linux but does not work on FreeBSD. > This behaviour is bug-compatible with Linux-3.13.5. > > References: > http://d.hatena.ne.jp/syuu1228/20140326 > http://lxr.linux.no/linux+v3.13.5/arch/x86/kernel/acpi/boot.c#L1094 > > Submitted by: syuu I think the problem with changing it at this level is that you don't know what the default should be. These are used both for local NMI but also for interrupt override entries for ISA interrupts in the local APIC, so hardcoding I think you should instead treat invalid values as "conforms". You can do this by mostly reverting your change and moving default to the top of the case and have it print a warning but fall through to the conforms cases. > Modified: > head/sys/x86/acpica/madt.c > > Modified: head/sys/x86/acpica/madt.c > ============================================================================== > --- head/sys/x86/acpica/madt.c Thu Mar 27 06:08:07 2014 (r263794) > +++ head/sys/x86/acpica/madt.c Thu Mar 27 06:36:38 2014 (r263795) > @@ -306,10 +306,11 @@ interrupt_polarity(UINT16 IntiFlags, UIN > case ACPI_MADT_POLARITY_ACTIVE_HIGH: > return (INTR_POLARITY_HIGH); > case ACPI_MADT_POLARITY_ACTIVE_LOW: > - return (INTR_POLARITY_LOW); > + break; I am not a fan of this at all. If we fixed default's logic to be different (e.g. as I suggested above), then falling through could result in the wrong thing. POLARITY_LOW should always explicitly return POLARITY_LOW. > default: > - panic("Bogus Interrupt Polarity"); > + printf("WARNING: Bogus Interrupt Polarity. Assume POLALITY LOW"); > } > + return (INTR_POLARITY_LOW); > } > > static enum intr_trigger -- John Baldwin