public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Does it need to implement irq_set_type method in the ioapic_chip?
@ 2014-02-18  7:18 carl peng
  0 siblings, 0 replies; 8+ messages in thread
From: carl peng @ 2014-02-18  7:18 UTC (permalink / raw)
  To: linux-kernel

Hi,

I'm sorry to bother you!
Does it need to implement irq_set_type method in the
ioapic_chip(arch/x86/kernel/apic/io_apic.c) structure?

Recently,  I developed a device driver based on x86. The device uses a
falling edge interrupt trigger mode, so I have to set the trigger mode
in the request_irq function, but found that it can not be set
successfully, it turn out to be that the irq_set_type method is not be
implemented in the ioapic_chip structure, that is to say, for APIC
interrupt controller, can not set the trigger mode.

So I would like to consult with you for two questions:
1. Does it need to implement irq_set_type method in the ioapic_chip structure?
2. if no need to implement it, how can device driver set the trigger
mode of APIC interrupt controller pin?

Thank you!
Carl

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Does it need to implement irq_set_type method in the ioapic_chip?
       [not found] <CAC5e1FoLrHWSa_7BnRt-u451ZJOVqKhSpbyp8O_ExDbgcXtU+g@mail.gmail.com>
@ 2014-02-18 20:13 ` Thomas Gleixner
  2014-02-19  2:32   ` carl peng
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Gleixner @ 2014-02-18 20:13 UTC (permalink / raw)
  To: carl peng; +Cc: mingo, hpa, x86, pingfank, yoshihiro.yunomae.ez, linux-kernel

On Tue, 18 Feb 2014, carl peng wrote:

Carl, sending the same mail twice within an hour does not speed up
things. It's quite likely that it gets ignored.

> 1. Does it need to implement irq_set_type method in the ioapic_chip
> structure?

No. The irq type is configured by the type of the interrupt or the
BIOS.

ISA  interrupts are always polarity zero edge triggered (historic)

PCI  interrupts are always polarity one level triggered

PCIE interrupts are either legacy PCI or with MSI[X] always edge
     triggered

> 2. if no need to implement it, how can device driver set the trigger mode
> of APIC interrupt controller pin?

Not at all.

The device which is connected to one of the busses must follow the
specification of the bus. There is no choice. Any additional
requirements of the device to deal with external signals must be
handled by the device itself and converted to the appropriate bus
requirement.

This all is configured by the kernel automatically through bus
detection and BIOS tables.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Does it need to implement irq_set_type method in the ioapic_chip?
  2014-02-18 20:13 ` Does it need to implement irq_set_type method in the ioapic_chip? Thomas Gleixner
@ 2014-02-19  2:32   ` carl peng
  2014-02-19  2:34     ` H. Peter Anvin
  2014-02-19 16:37     ` H. Peter Anvin
  0 siblings, 2 replies; 8+ messages in thread
From: carl peng @ 2014-02-19  2:32 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: mingo, hpa, x86, pingfank, yoshihiro.yunomae.ez, linux-kernel

Hi Thomas,

Thanks a lot for your help!

But I still have some confusion. Could you please help to give some
suggestions to me?

1) This device is a ACPI device, the hardware engineer designed it as
falling edge interrupt trigger
mode, does it need to re-work the hardware and modify it as rising
edge trigger mode to suit the
Linux APIC driver architecture?
2) Why does APIC driver not implement the irq_set_type method?  if
implement it, will supply more
free space for the device driver developer(they can set the interrupt
trigger mode by calling request_irq).

Thank you!
Carl


On Wed, Feb 19, 2014 at 4:13 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Tue, 18 Feb 2014, carl peng wrote:
>
> Carl, sending the same mail twice within an hour does not speed up
> things. It's quite likely that it gets ignored.
>
>> 1. Does it need to implement irq_set_type method in the ioapic_chip
>> structure?
>
> No. The irq type is configured by the type of the interrupt or the
> BIOS.
>
> ISA  interrupts are always polarity zero edge triggered (historic)
>
> PCI  interrupts are always polarity one level triggered
>
> PCIE interrupts are either legacy PCI or with MSI[X] always edge
>      triggered
>
>> 2. if no need to implement it, how can device driver set the trigger mode
>> of APIC interrupt controller pin?
>
> Not at all.
>
> The device which is connected to one of the busses must follow the
> specification of the bus. There is no choice. Any additional
> requirements of the device to deal with external signals must be
> handled by the device itself and converted to the appropriate bus
> requirement.
>
> This all is configured by the kernel automatically through bus
> detection and BIOS tables.
>
> Thanks,
>
>         tglx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Does it need to implement irq_set_type method in the ioapic_chip?
  2014-02-19  2:32   ` carl peng
@ 2014-02-19  2:34     ` H. Peter Anvin
  2014-02-19  3:13       ` carl peng
  2014-02-19 16:37     ` H. Peter Anvin
  1 sibling, 1 reply; 8+ messages in thread
From: H. Peter Anvin @ 2014-02-19  2:34 UTC (permalink / raw)
  To: carl peng, Thomas Gleixner
  Cc: mingo, x86, pingfank, yoshihiro.yunomae.ez, linux-kernel

This is an ACPI device connecting to an internal IOAPIC? If not, how is it connected?

On February 18, 2014 6:32:44 PM PST, carl peng <carlpeng008@gmail.com> wrote:
>Hi Thomas,
>
>Thanks a lot for your help!
>
>But I still have some confusion. Could you please help to give some
>suggestions to me?
>
>1) This device is a ACPI device, the hardware engineer designed it as
>falling edge interrupt trigger
>mode, does it need to re-work the hardware and modify it as rising
>edge trigger mode to suit the
>Linux APIC driver architecture?
>2) Why does APIC driver not implement the irq_set_type method?  if
>implement it, will supply more
>free space for the device driver developer(they can set the interrupt
>trigger mode by calling request_irq).
>
>Thank you!
>Carl
>
>
>On Wed, Feb 19, 2014 at 4:13 AM, Thomas Gleixner <tglx@linutronix.de>
>wrote:
>> On Tue, 18 Feb 2014, carl peng wrote:
>>
>> Carl, sending the same mail twice within an hour does not speed up
>> things. It's quite likely that it gets ignored.
>>
>>> 1. Does it need to implement irq_set_type method in the ioapic_chip
>>> structure?
>>
>> No. The irq type is configured by the type of the interrupt or the
>> BIOS.
>>
>> ISA  interrupts are always polarity zero edge triggered (historic)
>>
>> PCI  interrupts are always polarity one level triggered
>>
>> PCIE interrupts are either legacy PCI or with MSI[X] always edge
>>      triggered
>>
>>> 2. if no need to implement it, how can device driver set the trigger
>mode
>>> of APIC interrupt controller pin?
>>
>> Not at all.
>>
>> The device which is connected to one of the busses must follow the
>> specification of the bus. There is no choice. Any additional
>> requirements of the device to deal with external signals must be
>> handled by the device itself and converted to the appropriate bus
>> requirement.
>>
>> This all is configured by the kernel automatically through bus
>> detection and BIOS tables.
>>
>> Thanks,
>>
>>         tglx

-- 
Sent from my mobile phone.  Please pardon brevity and lack of formatting.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Does it need to implement irq_set_type method in the ioapic_chip?
  2014-02-19  2:34     ` H. Peter Anvin
@ 2014-02-19  3:13       ` carl peng
  2014-02-19 12:07         ` Thomas Gleixner
  0 siblings, 1 reply; 8+ messages in thread
From: carl peng @ 2014-02-19  3:13 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Thomas Gleixner, mingo, x86, pingfank, yoshihiro.yunomae.ez,
	linux-kernel

Hi Peter,

At last, the device will be connected to AMBA bus, so the interrupt
pin will be connected to IOAPIC through AMBA bus. The device now
is in the pre-silicon verification stage.

So my question is the same:
Why does APIC driver not implement the irq_set_type method?  if
implement it, will supply more free space for the device driver
developer(they can set the interrupttrigger mode by calling request_irq).

Thank you!
Carl

On Wed, Feb 19, 2014 at 10:34 AM, H. Peter Anvin <hpa@zytor.com> wrote:
> This is an ACPI device connecting to an internal IOAPIC? If not, how is it connected?
>
> On February 18, 2014 6:32:44 PM PST, carl peng <carlpeng008@gmail.com> wrote:
>>Hi Thomas,
>>
>>Thanks a lot for your help!
>>
>>But I still have some confusion. Could you please help to give some
>>suggestions to me?
>>
>>1) This device is a ACPI device, the hardware engineer designed it as
>>falling edge interrupt trigger
>>mode, does it need to re-work the hardware and modify it as rising
>>edge trigger mode to suit the
>>Linux APIC driver architecture?
>>2) Why does APIC driver not implement the irq_set_type method?  if
>>implement it, will supply more
>>free space for the device driver developer(they can set the interrupt
>>trigger mode by calling request_irq).
>>
>>Thank you!
>>Carl
>>
>>
>>On Wed, Feb 19, 2014 at 4:13 AM, Thomas Gleixner <tglx@linutronix.de>
>>wrote:
>>> On Tue, 18 Feb 2014, carl peng wrote:
>>>
>>> Carl, sending the same mail twice within an hour does not speed up
>>> things. It's quite likely that it gets ignored.
>>>
>>>> 1. Does it need to implement irq_set_type method in the ioapic_chip
>>>> structure?
>>>
>>> No. The irq type is configured by the type of the interrupt or the
>>> BIOS.
>>>
>>> ISA  interrupts are always polarity zero edge triggered (historic)
>>>
>>> PCI  interrupts are always polarity one level triggered
>>>
>>> PCIE interrupts are either legacy PCI or with MSI[X] always edge
>>>      triggered
>>>
>>>> 2. if no need to implement it, how can device driver set the trigger
>>mode
>>>> of APIC interrupt controller pin?
>>>
>>> Not at all.
>>>
>>> The device which is connected to one of the busses must follow the
>>> specification of the bus. There is no choice. Any additional
>>> requirements of the device to deal with external signals must be
>>> handled by the device itself and converted to the appropriate bus
>>> requirement.
>>>
>>> This all is configured by the kernel automatically through bus
>>> detection and BIOS tables.
>>>
>>> Thanks,
>>>
>>>         tglx
>
> --
> Sent from my mobile phone.  Please pardon brevity and lack of formatting.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Does it need to implement irq_set_type method in the ioapic_chip?
  2014-02-19  3:13       ` carl peng
@ 2014-02-19 12:07         ` Thomas Gleixner
  2014-02-19 13:28           ` H. Peter Anvin
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Gleixner @ 2014-02-19 12:07 UTC (permalink / raw)
  To: carl peng
  Cc: H. Peter Anvin, mingo, x86, pingfank, yoshihiro.yunomae.ez,
	linux-kernel

On Wed, 19 Feb 2014, carl peng wrote:
> At last, the device will be connected to AMBA bus, so the interrupt
> pin will be connected to IOAPIC through AMBA bus. The device now
> is in the pre-silicon verification stage.
> 
> So my question is the same:
> Why does APIC driver not implement the irq_set_type method?  if

Because we do not need it. All devices are properly connected and
configured by the BIOS and bus discovery.

> implement it, will supply more free space for the device driver
> developer(they can set the interrupttrigger mode by calling request_irq).

There are 3 different mechanisms already to tell the kernel to
configure a particular irq line: ACPI, MP Tables and SFI.

That's the way x86 does its interrupt configuration and there is no
need to provide another one.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Does it need to implement irq_set_type method in the ioapic_chip?
  2014-02-19 12:07         ` Thomas Gleixner
@ 2014-02-19 13:28           ` H. Peter Anvin
  0 siblings, 0 replies; 8+ messages in thread
From: H. Peter Anvin @ 2014-02-19 13:28 UTC (permalink / raw)
  To: Thomas Gleixner, carl peng
  Cc: mingo, x86, pingfank, yoshihiro.yunomae.ez, linux-kernel

In the casee of your ACPI-enabled AMBA device I believe the BIOS, which provides the ACPI tables, is expected to set the interrupt type.

On February 19, 2014 4:07:09 AM PST, Thomas Gleixner <tglx@linutronix.de> wrote:
>On Wed, 19 Feb 2014, carl peng wrote:
>> At last, the device will be connected to AMBA bus, so the interrupt
>> pin will be connected to IOAPIC through AMBA bus. The device now
>> is in the pre-silicon verification stage.
>> 
>> So my question is the same:
>> Why does APIC driver not implement the irq_set_type method?  if
>
>Because we do not need it. All devices are properly connected and
>configured by the BIOS and bus discovery.
>
>> implement it, will supply more free space for the device driver
>> developer(they can set the interrupttrigger mode by calling
>request_irq).
>
>There are 3 different mechanisms already to tell the kernel to
>configure a particular irq line: ACPI, MP Tables and SFI.
>
>That's the way x86 does its interrupt configuration and there is no
>need to provide another one.
>
>Thanks,
>
>	tglx

-- 
Sent from my mobile phone.  Please pardon brevity and lack of formatting.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Does it need to implement irq_set_type method in the ioapic_chip?
  2014-02-19  2:32   ` carl peng
  2014-02-19  2:34     ` H. Peter Anvin
@ 2014-02-19 16:37     ` H. Peter Anvin
  1 sibling, 0 replies; 8+ messages in thread
From: H. Peter Anvin @ 2014-02-19 16:37 UTC (permalink / raw)
  To: carl peng, Thomas Gleixner
  Cc: mingo, x86, pingfank, yoshihiro.yunomae.ez, linux-kernel

On 02/18/2014 06:32 PM, carl peng wrote:
> 1) This device is a ACPI device, the hardware engineer designed it as
> falling edge interrupt trigger
> mode, does it need to re-work the hardware and modify it as rising
> edge trigger mode to suit the
> Linux APIC driver architecture?

Could you share what the ACPI description of your device looks like?

	-hpa



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-02-19 16:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAC5e1FoLrHWSa_7BnRt-u451ZJOVqKhSpbyp8O_ExDbgcXtU+g@mail.gmail.com>
2014-02-18 20:13 ` Does it need to implement irq_set_type method in the ioapic_chip? Thomas Gleixner
2014-02-19  2:32   ` carl peng
2014-02-19  2:34     ` H. Peter Anvin
2014-02-19  3:13       ` carl peng
2014-02-19 12:07         ` Thomas Gleixner
2014-02-19 13:28           ` H. Peter Anvin
2014-02-19 16:37     ` H. Peter Anvin
2014-02-18  7:18 carl peng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox