RE: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Chan Kim
Hi Greg KH and all, I found how to find the irq number in my case! (char driver kernel module) I want to share it for reference to others. add these two header files for this. #include #include extern struct irq_desc *irq_to_desc(unsigned int irq); struct irq_desc *desc; in the module _init f

RE: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Chan Kim
Hi Greg KH, I see, I understand what the proper method should be for this. I'll take it as an almost official answer from the linux people :) Thank you. Chan Kim > -Original Message- > From: 'Greg KH' > Sent: Tuesday, April 12, 2022 1:50 PM > To: Chan Kim > Cc: 'qemu-discuss' ; > kerneln

Re: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread 'Greg KH'
On Tue, Apr 12, 2022 at 11:18:03AM +0900, Chan Kim wrote: > > You can replace all of the above code by just using the miscdevice > > interface instead. Please use that, it ensures that you do everything > > properly and simplifies it all. Again, use the misc device api please. > > > vaddr = io

RE: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Chan Kim
Hi Ozgur, My replies in-line. Thanks! From: Ozgur Karatas Sent: Monday, April 11, 2022 11:53 PM To: Chan Kim Cc: Greg KH ; kernelnewbies@kernelnewbies.org; qemu-discuss Subject: Re: Can't understand /proc/interrupts output for GICv3 case Re-hi, On Mon, Apr 11, 2022 at 6:16 PM

RE: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Chan Kim
Hi, Greg KH, Thanks for the advices. Some questions inline. > -Original Message- > From: 'Greg KH' > Sent: Monday, April 11, 2022 11:26 PM > To: Chan Kim > Cc: 'qemu-discuss' ; > kernelnewbies@kernelnewbies.org > Subject: Re: Can't understand /proc/interrupts output for GICv3 case > > O

Re: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Ozgur Karatas
On Mon, Apr 11, 2022 at 6:49 PM Greg KH wrote: > On Mon, Apr 11, 2022 at 03:32:23PM +0100, Peter Maydell wrote: > > On Mon, 11 Apr 2022 at 15:22, Chan Kim wrote: > > > > > > > > > > > > What bus type is your driver written for? > > > > > > > > > > > That sounds very logical. In my case I added i

Re: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Peter Maydell
On Mon, 11 Apr 2022 at 15:49, Greg KH wrote: > > On Mon, Apr 11, 2022 at 03:32:23PM +0100, Peter Maydell wrote: > > On Mon, 11 Apr 2022 at 15:22, Chan Kim wrote: > > > > > > > > > > > > What bus type is your driver written for? > > > > > > > > > > > That sounds very logical. In my case I added it

Re: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Ozgur Karatas
Re-hi, On Mon, Apr 11, 2022 at 6:16 PM Chan Kim wrote: > > > > > What bus type is your driver written for? > > > > > > > That sounds very logical. In my case I added it to system bus. > > > > What exactly do you mean by "system bus"? > > > I meant 'sysbus' in qemu code that I showed in the qemu

Re: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Greg KH
On Mon, Apr 11, 2022 at 03:32:23PM +0100, Peter Maydell wrote: > On Mon, 11 Apr 2022 at 15:22, Chan Kim wrote: > > > > > > > > > What bus type is your driver written for? > > > > > > > > > That sounds very logical. In my case I added it to system bus. > > > > > > What exactly do you mean by "syste

Re: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Peter Maydell
On Mon, 11 Apr 2022 at 15:22, Chan Kim wrote: > > > > > > What bus type is your driver written for? > > > > > > > That sounds very logical. In my case I added it to system bus. > > > > What exactly do you mean by "system bus"? > > > I meant 'sysbus' in qemu code that I showed in the qemu code. > A

Re: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread 'Greg KH'
On Mon, Apr 11, 2022 at 11:15:57PM +0900, Chan Kim wrote: > > > > > What bus type is your driver written for? > > > > > > > That sounds very logical. In my case I added it to system bus. > > > > What exactly do you mean by "system bus"? > > > I meant 'sysbus' in qemu code that I showed in the qe

RE: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Chan Kim
> > > What bus type is your driver written for? > > > > > That sounds very logical. In my case I added it to system bus. > > What exactly do you mean by "system bus"? > I meant 'sysbus' in qemu code that I showed in the qemu code. And I think it's the CPU bus. > > Where is your kernel code? >

Re: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread 'Greg KH'
On Mon, Apr 11, 2022 at 10:13:42PM +0900, Chan Kim wrote: > Hi, Greg K-H, > Thanks for replyaing. > > > > You ask the system for it. It depends on the bus type your driver is > > written for for how to do this. > > > > For example, if you have a platform driver, you would call > > platform_get_i

Re: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Ozgur Kara
 Hello Chan, of course i would but kernelnewbies is always a good way to mentoring first step kernel development and i think official LKML developers (linux-kernel) have time issues but on other hand, Greg-KH usually takes time and is responsive everytime :) Now i also pay attention to your code, a

RE: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Chan Kim
Hi Ozgur, The SPI I meant was ‘shared peripheral interrupt’ of armv8 architecture. (the interrupt is shared among cores. The interrupt controller distributes it) I’ll look into your link when I’ll be working with SPI (serial peripheral interface) later :). Thank you. Chan From: Ozgur Kar

RE: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Chan Kim
Hi, Greg K-H, Thanks for replyaing. > > You ask the system for it. It depends on the bus type your driver is > written for for how to do this. > > For example, if you have a platform driver, you would call > platform_get_irq(). If you are a pci driver, the irq for your device is > already store

Re: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Ozgur Kara
Hello, firstly when you say SPI so can you give some more information about your hardware?I think you are doing an embedded development in that case you should do some research on howto understand SPI interface under the kernel. I think for example, source code of a previously written hardware usin

Re: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Greg KH
On Mon, Apr 11, 2022 at 09:36:14PM +0900, Chan Kim wrote: > Hi, > nobody's replying to my question.. so sad.. > I found the kernel makes an array (actually a radix tree) of 'irq_desc's. > And my hwirq (SPI 15) is assigned to one of these irq_descs while processing > device tree. > In my case it w

RE: Can't understand /proc/interrupts output for GICv3 case

2022-04-11 Thread Chan Kim
Hi, nobody's replying to my question.. so sad.. I found the kernel makes an array (actually a radix tree) of 'irq_desc's. And my hwirq (SPI 15) is assigned to one of these irq_descs while processing device tree. In my case it was assigned irq 6 (this irq is what is called virtual irq). So I regis