From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DF110C433EF for ; Tue, 12 Apr 2022 10:15:17 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94.2) (envelope-from ) id 1neDY0-0002F8-74; Tue, 12 Apr 2022 06:14:56 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1neDXx-0002Ed-W8 for kernelnewbies@kernelnewbies.org; Tue, 12 Apr 2022 06:14:54 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 5CF2B5C0380; Tue, 12 Apr 2022 06:14:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 12 Apr 2022 06:14:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1649758491; x=1649844891; bh=iU9V3dOvRI tY5JbrVyPg/SCm8ROmRU7BvyomwIjeKyg=; b=dVZ530N0Bqpu3f1ACN+TwfAYsb Dk7M/3Wyvl0eR1Ir/Chys5lRlILrjaoKyrAve18kH23VVgBORroo7LH0t0x6UBWw OB2CiJySIeEg6ktxgFh5EyD8MgquXSQeAReAALkih4N+wQqCckBuSQcZ9Qe7C9NP Bzq13adctz9QtcuyppC/7D1BrsDlkML3jICjkAv6aLTpo5cNlYouf9vzcahuLU6G MOlHtVXT12p7nsdefHMhlsr7Z2+R/VrsXSbYUA4QbpZcWMpcSCQG6Tb2L8JJtFVQ DZrkRhfbmaf1Jev8Tvtl9ZRU50C6WidSEt2/im1KdRohT3SGZsDn61Xhr50A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1649758491; x= 1649844891; bh=iU9V3dOvRItY5JbrVyPg/SCm8ROmRU7BvyomwIjeKyg=; b=l TWovr1mO9K4V5oX6kb8Ouooic7/T/UskFX4eTQOFrEkTqn8IF8K/isbcTjNlYncz BGYkGHB6xB53xkGNQnYJ0RF0UYLjFGixyncDLulcENQn71dxDywoZVpORFlBpqSb AMkOXrRxMwnViE194KhgPFHAnePVVB43Id2nqQdiX8sdVXLwWqzefXc5BoAFEQ6C WVEZHt8ojsqK8tXgT1n6mJeig4nK0P6ZhmWt5GcOsjuONb1oOecPpMHAAUUgxjYH 3LtCKsUVXSvDYSO5Kyl+9djKlvitG4ja8LIzmssMJoEXvEQQIPmhpeBXhYN0zNH4 +OrZ68dtSyKRNN3hKp/gA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudekkedgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpedkifhrvghg ucfmjfdkuceoghhrvghgsehkrhhorghhrdgtohhmqeenucggtffrrghtthgvrhhnpeeihf eghefghfevveekueeiieeghedvhfeludevgfeujedvleeufeegtdduleeufeenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhroh grhhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Apr 2022 06:14:50 -0400 (EDT) Date: Tue, 12 Apr 2022 12:14:47 +0200 From: 'Greg KH' To: Chan Kim Subject: Re: Can't understand /proc/interrupts output for GICv3 case Message-ID: References: <06c401d84da0$bc1a5ca0$344f15e0$@etri.re.kr> <06cf01d84da5$f7a1fa80$e6e5ef80$@etri.re.kr> <06fc01d84dae$a9e4ebf0$fdaec3d0$@etri.re.kr> <07d001d84e13$8aa98420$9ffc8c60$@etri.re.kr> <07fa01d84e29$69837c40$3c8a74c0$@etri.re.kr> <080101d84e39$b9eed890$2dcc89b0$@etri.re.kr> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <080101d84e39$b9eed890$2dcc89b0$@etri.re.kr> Cc: 'qemu-discuss' , kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Tue, Apr 12, 2022 at 03:51:24PM +0900, Chan Kim wrote: > 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 function : > > // find my irq number > for(i=0;i desc = irq_to_desc(i); > if (desc) { > //printk("irq_desc(%d)->irq_data.hwirq = %ld\n", i, > desc->irq_data.hwirq); > if (desc->irq_data.hwirq == 47) break; // 47 is the hwirq > number, (SPI 15) > } > } No, please no. Do NOT do this, it will break and not work well over time, if it even works at all right now you are lucky. Odds are, when you reboot, it will not as irq numbers are never guaranteed to be the same across boots. Again, use the irq number given to you by your platform device bus. It should be much simpler than "iterate over all irqs and guess which one we want to take" like you did here. good luck! greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies