From owner-svn-src-head@freebsd.org Tue Feb 7 11:48:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B82DECD427A; Tue, 7 Feb 2017 11:48:21 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 7E5CA3D1; Tue, 7 Feb 2017 11:48:21 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (global-5-144.nat-2.net.cam.ac.uk [131.111.5.144]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 61C5BD8561; Tue, 7 Feb 2017 11:33:14 +0000 (UTC) Date: Tue, 7 Feb 2017 11:38:44 +0000 From: Andrew Turner To: Svatopluk Kraus Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313339 - head/sys/kern Message-ID: <20170207113844.2cd08852@zapp> In-Reply-To: References: <201702061308.v16D8nGC071178@repo.freebsd.org> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2017 11:48:21 -0000 On Tue, 7 Feb 2017 11:35:48 +0100 Svatopluk Kraus wrote: > Does an xref refer only to one hardware? Or two hardwares may have > same xrefs? Why one hardware cannot be represented by one PIC in > INTRNG even if two drivers exist for it? The xref is an FDT thing, in INTRNG we use it as a handle to hardware. This changes it so each of these handles refers to hardware within one of two spaces, the PIC space and MSI space. It may be that for FDT these spaces are non overlapping, however with ACPI it will simplify the code to allow us to have the same handle refer to different controllers in different spaces. > On Mon, Feb 6, 2017 at 2:08 PM, Andrew Turner > wrote: > > Author: andrew > > Date: Mon Feb 6 13:08:48 2017 > > New Revision: 313339 > > URL: https://svnweb.freebsd.org/changeset/base/313339 > > > > Log: > > Only allow the pic type to be either a PIC or MSI type. All > > interrupt controller drivers handle either MSI/MSI-X interrupts, or > > regular interrupts, as such enforce this in the interrupt handling > > framework. If a later driver was to handle both it would need to > > create one of each. > > > > This will allow future changes to allow the xref space to > > overlap, but refer to different drivers. > > > > Obtained from: ABT Systems Ltd > > Sponsored by: The FreeBSD Foundation > > X-Differential Revision: https://reviews.freebsd.org/D8616 ... > > @@ -822,13 +827,13 @@ intr_pic_claim_root(device_t dev, intptr > > { > > struct intr_pic *pic; > > > > - pic = pic_lookup(dev, xref); > > + pic = pic_lookup(dev, xref, FLAG_PIC); > > if (pic == NULL) { > > device_printf(dev, "not registered\n"); > > return (EINVAL); > > } > > > > - KASSERT((pic->pic_flags & FLAG_PIC) != 0, > > + KASSERT((pic->pic_flags & FLAG_TYPE_MASK) == FLAG_PIC, > > ("%s: Found a non-PIC controller: %s", __func__, > > device_get_name(pic->pic_dev))); > > > > So, you would check that pic_lookup(dev, xref, FLAG_PIC) returns PIC > with FLAG_PIC set? > Really? This nonsense is in other places too. If you would like to be > this way, check it only in pic_lookup() then! It's there so if someone makes a change to pic_lookup that breaks this assumption they will be told about it. Andrew