Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Qais Yousef <qais.yousef@imgtec.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Marc Zyngier <marc.zyngier@arm.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>,
	<linux-mips@linux-mips.org>, Alex Smith <alex.smith@imgtec.com>,
	Jason Cooper <jason@lakedaemon.net>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] irqchip: irq-mips-gic: Provide function to map GIC user section
Date: Thu, 15 Oct 2015 10:37:26 +0100	[thread overview]
Message-ID: <561F73D6.8040300@imgtec.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1510121155490.6097@nanos>

On 10/12/2015 11:16 AM, Thomas Gleixner wrote:
> On Mon, 12 Oct 2015, Marc Zyngier wrote:
>> On 12/10/15 10:40, Markos Chandras wrote:
>>> From: Alex Smith <alex.smith@imgtec.com>
>>>
>>> The GIC provides a "user-mode visible" section containing a mirror of
>>> the counter registers which can be mapped into user memory. This will
>>> be used by the VDSO time function implementations, so provide a
>>> function to map it in.
> <SNIP>
>   
>> This looks much better than the previous version (though I cannot find
>> the two other patches on LKML just yet).
> Yes, it looks better. But I really have to ask the question why we are
> trying to pack the world and somemore into an irq chip driver. We
> already have the completely misplaced gic_read_count() there.

This code has a bad history. It was scattered all over the place in arch 
code. Andrew Bresticker did a good job cleaning it up and moved it to 
this irqchip driver.

     https://lkml.org/lkml/2014/9/18/487
     https://lkml.org/lkml/2014/10/20/481

>
> While I understand that all of this is in the GIC block at least
> according to the documentation, technically it's different hardware
> blocks. And logically its different as well.

Yes but they're exposed through the same register interface.

>
> So why not describe the various blocks (interrupt controller, timer,
> shadow timer) as separate entities in the device tree and let each
> subsystem look them up on their own. This cross subsystem hackery is
> just horrible and does not buy anything except merge dependencies and
> other avoidable hassle.

There's a mips-gic-timer driver in drivers/clocksource. But in device 
tree it's a subnode of the irqchip driver.

http://lxr.free-electrons.com/source/drivers/clocksource/mips-gic-timer.c
http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/interrupt-controller/mips-gic.txt

>
> Thoughts?
>

It could be refactored but the DT binding already specifies the GIC 
timer as a subnode of GIC. Exposing this usermode register is the only 
thing left in the register set that GIC driver wasn't dealing with.

Little gain in changing all of this now I think?

Thanks,
Qais

WARNING: multiple messages have this Message-ID (diff)
From: Qais Yousef <qais.yousef@imgtec.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Marc Zyngier <marc.zyngier@arm.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>,
	linux-mips@linux-mips.org, Alex Smith <alex.smith@imgtec.com>,
	Jason Cooper <jason@lakedaemon.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] irqchip: irq-mips-gic: Provide function to map GIC user section
Date: Thu, 15 Oct 2015 10:37:26 +0100	[thread overview]
Message-ID: <561F73D6.8040300@imgtec.com> (raw)
Message-ID: <20151015093726.VMfgdqDscS4cb2P88M_j-dM5CFd263icRFVqn4OE3vA@z> (raw)
In-Reply-To: <alpine.DEB.2.11.1510121155490.6097@nanos>

On 10/12/2015 11:16 AM, Thomas Gleixner wrote:
> On Mon, 12 Oct 2015, Marc Zyngier wrote:
>> On 12/10/15 10:40, Markos Chandras wrote:
>>> From: Alex Smith <alex.smith@imgtec.com>
>>>
>>> The GIC provides a "user-mode visible" section containing a mirror of
>>> the counter registers which can be mapped into user memory. This will
>>> be used by the VDSO time function implementations, so provide a
>>> function to map it in.
> <SNIP>
>   
>> This looks much better than the previous version (though I cannot find
>> the two other patches on LKML just yet).
> Yes, it looks better. But I really have to ask the question why we are
> trying to pack the world and somemore into an irq chip driver. We
> already have the completely misplaced gic_read_count() there.

This code has a bad history. It was scattered all over the place in arch 
code. Andrew Bresticker did a good job cleaning it up and moved it to 
this irqchip driver.

     https://lkml.org/lkml/2014/9/18/487
     https://lkml.org/lkml/2014/10/20/481

>
> While I understand that all of this is in the GIC block at least
> according to the documentation, technically it's different hardware
> blocks. And logically its different as well.

Yes but they're exposed through the same register interface.

>
> So why not describe the various blocks (interrupt controller, timer,
> shadow timer) as separate entities in the device tree and let each
> subsystem look them up on their own. This cross subsystem hackery is
> just horrible and does not buy anything except merge dependencies and
> other avoidable hassle.

There's a mips-gic-timer driver in drivers/clocksource. But in device 
tree it's a subnode of the irqchip driver.

http://lxr.free-electrons.com/source/drivers/clocksource/mips-gic-timer.c
http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/interrupt-controller/mips-gic.txt

>
> Thoughts?
>

It could be refactored but the DT binding already specifies the GIC 
timer as a subnode of GIC. Exposing this usermode register is the only 
thing left in the register set that GIC driver wasn't dealing with.

Little gain in changing all of this now I think?

Thanks,
Qais

  reply	other threads:[~2015-10-15  9:37 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-28 10:03 [PATCH 0/3] MIPS VDSO support Markos Chandras
2015-09-28 10:03 ` Markos Chandras
2015-09-28 10:10 ` [PATCH 1/3] MIPS: Initial implementation of a VDSO Markos Chandras
2015-09-28 10:10   ` Markos Chandras
2015-09-28 10:54   ` Alex Smith
2015-09-28 13:07     ` Matthew Fortune
2015-11-20 18:15       ` Maciej W. Rozycki
2015-10-09  8:05   ` [PATCH v2 " Markos Chandras
2015-10-09  8:05     ` Markos Chandras
2015-10-21  8:54     ` [PATCH v3 " Markos Chandras
2015-10-21  8:54       ` Markos Chandras
2015-09-28 10:11 ` [PATCH 2/3] irqchip: irq-mips-gic: Provide function to map GIC user section Markos Chandras
2015-09-28 10:11   ` Markos Chandras
2015-09-28 10:55   ` Marc Zyngier
2015-09-28 14:16     ` Qais Yousef
2015-09-28 14:16       ` Qais Yousef
2015-09-28 15:03       ` Marc Zyngier
2015-10-05  8:22     ` Markos Chandras
2015-10-05  8:22       ` Markos Chandras
2015-10-12  9:40   ` [PATCH v2 " Markos Chandras
2015-10-12  9:40     ` Markos Chandras
2015-10-12  9:51     ` Marc Zyngier
2015-10-12 10:16       ` Thomas Gleixner
2015-10-15  9:37         ` Qais Yousef [this message]
2015-10-15  9:37           ` Qais Yousef
2015-10-15 10:18           ` Thomas Gleixner
2015-09-28 10:12 ` [PATCH 3/3] MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime() Markos Chandras
2015-09-28 10:12   ` Markos Chandras
2015-09-28 13:15   ` kbuild test robot
2015-09-28 13:15     ` kbuild test robot
2015-10-12 10:24   ` [PATCH v2 " Markos Chandras
2015-10-12 10:24     ` Markos Chandras
2015-10-21  8:57     ` [PATCH v3 " Markos Chandras
2015-10-21  8:57       ` Markos Chandras
2015-10-23  1:41       ` [v3, " Leonid Yegoshin
2015-10-23  1:41         ` Leonid Yegoshin
2015-10-27 14:47         ` Ralf Baechle
2015-10-27 20:46           ` Leonid Yegoshin
2015-10-27 20:46             ` Leonid Yegoshin
2015-10-27 21:02             ` David Daney
2015-10-27 21:15               ` Leonid Yegoshin
2015-10-27 21:15                 ` Leonid Yegoshin
2015-10-27 21:44                 ` David Daney
2015-10-27 21:49                   ` Leonid Yegoshin
2015-10-27 21:49                     ` Leonid Yegoshin
2015-10-28 10:20                     ` Alex Smith
2015-10-28 18:21                       ` Leonid Yegoshin
2015-10-28 18:21                         ` Leonid Yegoshin
2015-10-28 18:30                         ` Alex Smith
2015-10-28 18:57                           ` Leonid Yegoshin
2015-10-28 18:57                             ` Leonid Yegoshin
2015-10-28 19:04                             ` Alex Smith
2015-10-28 19:28                               ` Leonid Yegoshin
2015-10-28 19:28                                 ` Leonid Yegoshin
2015-10-28 19:55                                 ` Alex Smith
2015-10-28 20:15                                   ` Leonid Yegoshin
2015-10-28 20:15                                     ` Leonid Yegoshin
2016-01-25 22:36       ` [PATCH v3 " Hauke Mehrtens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=561F73D6.8040300@imgtec.com \
    --to=qais.yousef@imgtec.com \
    --cc=alex.smith@imgtec.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=marc.zyngier@arm.com \
    --cc=markos.chandras@imgtec.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox