mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miao Wang <shankerwangmiao@gmail.com>
To: Bartosz Golaszewski <brgl@kernel.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Miao Wang via B4 Relay
	<devnull+shankerwangmiao.gmail.com@kernel.org>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Yinbo Zhu <zhuyinbo@loongson.cn>,
	Linus Walleij <linusw@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH RFC v2 0/4] gpio: loongson-64bit: add interrupt support for more models
Date: Thu, 15 Oct 2026 21:58:08 +0800	[thread overview]
Message-ID: <F0F05A76-F67E-438F-BACF-F5B118A491AA@gmail.com> (raw)
In-Reply-To: <CAMRc=Mf0c8mqU46xqNVZRF+GSy=uZnHq_o90UsQXi+tUwgzEDw@mail.gmail.com>

Hi,

> 2026年10月15日 21:24,Bartosz Golaszewski <brgl@kernel.org> 写道:
> 
> On Wed, 14 Oct 2026 18:20:49 +0200, Miao Wang <shankerwangmiao@gmail.com> said:
>> Hi,
>> 
>>> 2026年10月14日 23:33,Bartosz Golaszewski <brgl@kernel.org> 写道:
>>> 
>>> On Thu, 8 Oct 2026 12:21:43 +0200, Miao Wang <shankerwangmiao@gmail.com> said:
>>>> Hi,
>>>> 
>>>>> 2026年10月8日 18:04,Bartosz Golaszewski <brgl@kernel.org> 写道:
>>>>> 
>>>>> On Thu, 1 Oct 2026 20:13:18 +0200, Miao Wang via B4 Relay
>>>>> <devnull+shankerwangmiao.gmail.com@kernel.org> said:
>>>>>> This patch series aims to correctly add interrupt support for GPIO
>>>>>> controllers found on more Loongson CPUs. The GPIO controllers in such
>>>>>> models do not have a complete intgrated interrupt controller, but choose
>>>>>> to delegate interrupt handling to their parent interrupt controller.
>>>>>> This sounds like a heirarchical interrupt setup, but what makes it
>>>>>> more complex is that multiple GPIO lines in these controllers may share
>>>>>> one interrupt line on the parent interrupt controller. The details is
>>>>>> described in the third patch.
>>>>>> 
>>>>>> Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
>>>>>> ---
>>>>> 
>>>>> The series looks pretty good. Who is the RFC addressed at in this case? I can't
>>>>> really answer the questions from patch 3/4 as I don't know this platform nor am
>>>>> I well versed in ACPI. Maybe Cc the GPIO ACPI maintainers for review?
>>>> 
>>>> Thanks for your review. The RFC contains two questions, the first is about
>>>> the firmware interface, including FDT and ACPI; the second is about the
>>>> way handling the delegated IRQs.
>>>> 
>>>> Regarding the firmware interface, it is to be decided how to declare
>>>> platform irq numbers for the GPIO controller. Such a GPIO controller
>>>> may have N gpio lines with M parent interrupt lines (M < N). The
>>>> firmware should a) list M irq numbers corresponding to the M parent
>>>> interrupt lines or b) list N irq numbers (which might be duplicated)
>>>> orresponding to the N gpio lines. Previously b) was chosen by the
>>>> kernel driver. However actual ACPI tables found in the published
>>>> firmware chose a). The discussion about it happened in [1].
>>>> 
>>> 
>>> Unless it impacts DT systems, I'll let Andy handle the ACPI part. Please Cc him
>>> next time as I pointed out under the RFC.
>> 
>> Will add him on the Cc list in further revisions.
>> 
>>>> Regarding to the interrupt handling delegation, since there is no
>>>> complete interrupt controller integrated with the GPIO controller,
>>>> the interrupt handling, including detecting edge triggered interrupts
>>>> and masking/unmasking, should be delegated to the parent IRQ controller.
>>>> I want to check if my implementation approach is acceptable and not
>>>> violating any implicit rules on the interrupt subsystem side.
>>>> 
>>> 
>>> I'd suggest to run your implementation by Thomas Gleixner because directly
>>> accessing the internals of the parent's irq data looks fishy. For instance:
>>> you call irq_set_type() directly without going through __setup_irq() ->
>>> __irq_set_trigger() which does some additional bookkeeping.
>> 
>> I would originally tend to avoid directly calling into ->irq_set_type() and
>> other handlers like this. However, the IRQ subsystem does not seem to provide
>> APIs to mask, unmask or set type of a given IRQ. Furthermore, __setup_irq()
>> is for registering irq_handler for an irq, while in chained irq chip, however,
>> irq_flow_handler is needed and should be registered via __irq_do_set_handler().
>> 
> 
> As I said: I'd involve Thomas in this discussion as it's his territory. I'm
> afraid I lack the deep knowledge of the interrupt subsystem internals to be
> able to help here and I'd also prefer to avoid adding any new abusers of the
> IRQ API to the kernel.

+Cc-ed Thomas

Cheers,

Miao Wang


      reply	other threads:[~2026-10-15 13:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 18:13 Miao Wang via B4 Relay
2026-10-01 18:13 ` [PATCH RFC v2 1/4] gpio: loongson-64bit: Support for irq controller on 2k2000 and 7a2000 Miao Wang via B4 Relay
2026-10-01 18:13 ` [PATCH RFC v2 2/4] gpio: loongson-64bit: Generalize interrupt controller initialization Miao Wang via B4 Relay
2026-10-01 18:13 ` [PATCH RFC v2 3/4] gpio: loongson-64bit: Add shared interrupt support Miao Wang via B4 Relay
2026-10-01 18:13 ` [PATCH RFC v2 4/4] gpio: loongson-64bit: remove gpio_to_irq() handler Miao Wang via B4 Relay
2026-10-08 10:04 ` [PATCH RFC v2 0/4] gpio: loongson-64bit: add interrupt support for more models Bartosz Golaszewski
2026-10-08 10:21   ` Miao Wang
2026-10-14 15:33     ` Bartosz Golaszewski
2026-10-14 16:20       ` Miao Wang
2026-10-15 13:24         ` Bartosz Golaszewski
2026-10-15 13:58           ` Miao Wang [this message]

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=F0F05A76-F67E-438F-BACF-F5B118A491AA@gmail.com \
    --to=shankerwangmiao@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=brgl@kernel.org \
    --cc=devnull+shankerwangmiao.gmail.com@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=zhuyinbo@loongson.cn \
    /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

all inboxes | Powered by JetHome®