Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jul 2016 13:13:33 +0200
From:      Michal Meloun <mmel@FreeBSD.org>
To:        Nathan Whitehorn <nwhitehorn@freebsd.org>, Svatopluk Kraus <skra@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys
Message-ID:  <578E0B5D.3070105@FreeBSD.org>
In-Reply-To: <b9606755-69cb-2cb0-04d7-6be32e4cb89e@freebsd.org>
References:  <201606051620.u55GKD5S066398@repo.freebsd.org> <b9606755-69cb-2cb0-04d7-6be32e4cb89e@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Dne 19.07.2016 v 2:11 Nathan Whitehorn napsal(a):
Hi Nathan,
I’m afraid that skra is on vacation, for next 2 weeks (at minimum), so
please don’t expect quick response.

> Could you please describe what this change is in more detail?
Short description is appended.

> 
> It breaks a lot of encapsulations we have worked very hard to maintain,
> moves ARM code into MI parts of the kernel, and the OFW parts violate
> IEEE 1275 (the Open Firmware standard). In particular, there is no
> guarantee that the interrupts for a newbus (or OF) device are encoded in
> a property called "interrupts" (or, indeed, in any property at all) on
> that node and there are many, many device trees where that is not the
> case (e.g. ones with interrupt maps, as well as Apple hardware). By
> putting that knowledge into the OF root bus device, which we have tried
> to keep it out of, this enforces a standard that doesn't actually exist.
Imho, this patch doesn’t change anything in this area. Only handling of
“interrupts” property is changed, all other cases are unchanged (I
hope).  Also, INTRNG code is currently shared by ARM, ARM64 and MIPS.

> 
> I'm hesitant to ask for reversion on something that landed 6 weeks ago
> without me noticing, but this needs a lot more architectural work before
> any parts of the kernel should use it.
> -Nathan
I think that it’s too late.  This patch series consist of r301451
(https://reviews.freebsd.org/D6632),
r301453, r301539 and 301543.  And new GPIO interrupts are currently used
(by in tree drivers or in development trees).



The root of problem is that standard way of delivering interrupt
resource to consumer driver doesn’t works in OFW world.

So we have some fact:
- the format of interrupt property is dependent of interrupt
  controller and only interrupt controller can parse it.
- the interrupt property can have more data than just interrupt
  number.
- single interrupt controller must be able to handle multiple
  format of interrupt description.

In pre-patchset era, simplebus enumerates children and attempts to set
memory and interrupts to resource list for them. But the interrupt
controllers are not yet populated so nobody can parse interrupt
property. Moreover, in all cases (parsed or not), we cannot store
complete interrupt description into resource list.

The patch simply postpones reading of interrupt property to
bus_alloc_resource() (called by consumer driver) time.

Due to this, we can:
- parse  interrupt property. The interrupt driver must exist
  at this time.
- bus_alloc_resource() returns resource, so we can attach parsed
  interrupt data to it. By this, the resource itself can be used
  for delivering configuration data to subsequent call to
  bus_setup_intr() (or to all related  bus_<foo>() calls).


The patched code still accepts delivering of interrupts in resource list.

Michal




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?578E0B5D.3070105>