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 55F11C433EF for ; Tue, 12 Apr 2022 04:50:48 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94.2) (envelope-from ) id 1ne8U1-0004f1-96; Tue, 12 Apr 2022 00:50:29 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ne8Tz-0004eJ-4e for kernelnewbies@kernelnewbies.org; Tue, 12 Apr 2022 00:50:27 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id EAF8A5C0308; Tue, 12 Apr 2022 00:50:23 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 12 Apr 2022 00:50:23 -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=1649739023; x=1649825423; bh=eerJd8IEDQ LFpY0qzhbtguvhL8pulE8F4ft4rsFdTvo=; b=OraWsr9mpcKvAwQynL8Md9Q1Tc ArB/Zs9yaq2jh8XMGsB9TewIxwfSQxRXhPKZJ6pufjwM7eAFysyJ6ywf6nBp+P1d N6EFhmELCdfsP4PK0GmaLFt+M/uB2c8XiQrn+WmjSpIjH1f43P4eaHkBj7xU7x2h YUliEvMnjHHYddWtl4ofPPeZOaCzZaodti9KS5aMQ3ejUuZX0SbiecGT7l73RwG8 B899YMMnS2AnY+6MW8KJmwI9py/cHxrteYxM8moBwTl459Sw7yyZZmF9rFHb1AYK vMpbEHOy1+C1LtMh0uDJJB1N71jfTdMojJFAuxbz8NOwdfDeyam2jxloajLg== 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=1649739023; x= 1649825423; bh=eerJd8IEDQLFpY0qzhbtguvhL8pulE8F4ft4rsFdTvo=; b=e 6cf+ZhBueTS0ZbjKPaZndusrCNjAjIY41uvcKFIaVxT+d4+AeHiKx9CRd5O3vAhS 3jctlbSdxXU6wkkfTaDVR5CxcUSAaYrNcqCzf3Z/fhQnoLK5AT4+7McemDxSGSof Q+Pu9C5Iw2Q4A2OOWtlBltSAbucmWH3yNfUHuk/LCPvsbybLYnh+wBSKfD5e2+FW lOV+TPk6UNAp10ndWJn2NSak5Wb1V4YoeRBrz72Jh7rR/UhVIwzmGSbpDDrj+ETr L2L99Kqkm2+/EdUwFK6dQH8q+WGaJ9/k9AOEK/yeGz9j7pSBywffB1LSTmr2X/Ju BWtZ5Z4qauu/Mc9WPyGFA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudekjedgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpedkifhrvghg ucfmjfdkuceoghhrvghgsehkrhhorghhrdgtohhmqeenucggtffrrghtthgvrhhnpeeihf eghefghfevveekueeiieeghedvhfeludevgfeujedvleeufeegtdduleeufeenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhroh grhhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Apr 2022 00:50:22 -0400 (EDT) Date: Tue, 12 Apr 2022 06:50:20 +0200 From: 'Greg KH' To: Chan Kim Subject: Re: Can't understand /proc/interrupts output for GICv3 case Message-ID: References: <049201d84b04$951cbab0$bf563010$@etri.re.kr> <06c401d84da0$bc1a5ca0$344f15e0$@etri.re.kr> <06cf01d84da5$f7a1fa80$e6e5ef80$@etri.re.kr> <06fc01d84dae$a9e4ebf0$fdaec3d0$@etri.re.kr> <07d001d84e13$8aa98420$9ffc8c60$@etri.re.kr> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <07d001d84e13$8aa98420$9ffc8c60$@etri.re.kr> Cc: kernelnewbies@kernelnewbies.org, 'qemu-discuss' 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 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 = ioremap(AXPU_BASE, 0x80000); > > > > Wait, where are you picking those random values from? > > Yes, it now looks weird to me. I have passed the register address > information in the device tree and the kernel already knows my device's > address range. Then, how should I get this virtual io address in this > driver? I need it to access some registers. How can I ask the system bus? Use a platform driver and bind your driver to that device based on that api. > And my driver is a kernel module because I want to use it in ubuntu-20.04 on > a virtual machine, I want it to be a kernel module that I can insmod or > rmmod.(actually my job is to provide this virtual machine to some folks). > And I cannot build the ubuntu image even if I change it to a platform device > driver and add it in the kernel tree. This all does not matter, just write a proper platform driver and all will be fine. > > > ret = request_irq(6, axpu_irq_handler, IRQF_SHARED, "axpu_irq", > > > &axpu_cdev); > > > > Same for that, just picking 6 will not work, sorry. > > > > Yes, that was my original question. How can I get my irq number (I know it's > hwirq 47) and I peeked into kernel that irq 6 was assigned for the irq_desc. > So I changed my driver to request irq 6 for my device and I found at least > it works for now, all the register access and interrupts. I know this is not > the solution and I'm curious how I should get the irq number of io virtual > address in this situation. Again, the platform driver interface will provide you with the needed information. We have thousands of working examples in the kernel tree. > > > Perhaps take a look at the book, Linux Device Drivers, 3rd edition. > > It's free online and should help you out a lot. > > > > > printk("request_irq returned %d\n", ret); // -EINVAL > > > printk(KERN_INFO "Device driver inserted ..done properly..\n"); > > > return 0; > > > > > > r_device : > > > class_destroy(dev_class); > > > > > > r_class : > > > unregister_chrdev_region(dev,1); > > > return -1; > > > > One final comment, don't make up error values like this, use real ERROR > > codes. > > > > thanks, > > > > greg k-h > > Yes, I've read the book sometimes (not the whole part) but if I read it now, > I'll be able to more understand it. It's a bit outdated though. Why don't > you update your book? :) Because the publisher does not want to publish a new version. thanks, greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies