{"id":4652,"date":"2021-06-18T01:31:20","date_gmt":"2021-06-17T16:31:20","guid":{"rendered":"https:\/\/now0930.pe.kr\/wordpress\/?p=4652"},"modified":"2021-06-19T18:27:15","modified_gmt":"2021-06-19T09:27:15","slug":"5%ec%9e%a5-%ec%9d%b8%ed%84%b0%eb%9f%bd%ed%8a%b8-%ec%8b%a4%ec%8a%b52","status":"publish","type":"post","link":"https:\/\/now0930.pe.kr\/wordpress\/5%ec%9e%a5-%ec%9d%b8%ed%84%b0%eb%9f%bd%ed%8a%b8-%ec%8b%a4%ec%8a%b52\/","title":{"rendered":"5\uc7a5 \uc778\ud130\ub7fd\ud2b8 \uc2e4\uc2b52"},"content":{"rendered":"\n<p><s>msi\uac00 xhci \ub4dc\ub77c\uc774\ubc84\ub97c \uc798\ubabb \ub9cc\ub4e4\uc5c8\ub294\uc9c0 \uc778\ud130\ub7fd\ud2b8\ub97c \ub108\ubb34 \ub9ce\uc774 \ubc1c\uc0dd\uc2dc\ud0a8\ub2e4.<\/s><\/p>\n\n\n\n<p>\uc67c\ucabd\ubd80\ud130 36: \uc778\ud130\ub7fd\ud2b8 \ubc88\ud638, 40080: cpu0 \ubc1c\uc0dd \ud69f\uc218, 0: cpu 1, 2, 3 \ubc1c\uc0dd\ud69f\uc218, mmc1, mmc0 \uc778\ud130\ub7fd\ud2b8 \uc774\ub984 \uc815\ub3c4? \ubaa8\ub4e0 \uc778\ud130\ub7fd\ud2b8\uac00 \ucda9\ubd84\ud558\uac8c \ub9ce\uc774 \uc77c\uc5b4\ub09c\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pi@raspberrypi:~ $ cat \/proc\/interrupts \n           CPU0       CPU1       CPU2       CPU3       \n ...\n 36:      40080          0          0          0     GICv2 158 Level     mmc1, mmc0\n 37:      11075          0          0          0     GICv2 144 Level     vc4 firmware kms\n...\n 51:        707          0          0          0     GICv2  66 Level     VCHIQ doorbell\n 52:          0          0          0          0     GICv2 175 Level     PCIe PME, aerdrv\n 53:       2927          0          0          0  Brcm_MSI 524288 Edge      xhci_hcd<\/pre>\n\n\n\n<p><s>\uc778\ud130\ub7fd\ud2b8 53\uc774 524,288\ubc88 \ubc1c\uc0dd\ud588\ub2e4. 53\ubc88 \uc778\ud130\ub7fd\ud2b8\uac00 \uc788\uc744 \ub54c printk\ub85c \uba54\uc138\uc9c0\ub97c \ucd9c\ub825\ud558\ub824 \ud588\uc73c\ub098, \ud69f\uc218\uac00 \ub9ce\uc544\uc11c\uc778\uc9c0 \ubd80\ud305\uc744 \ud560 \uc218 \uc5c6\ub2e4. \ud69f\uc218\uac00 \uc801\uc740 31\ubc88 \uc778\ud130\ub7fd\ud2b8\ub97c \ubcf4\uae30\ub85c \ud588\uace0, sd\uce74\ub4dc \uc77d\uace0 \uc4f0\ub294 \uc774\ubca4\ud2b8\ub85c \uc9d0\uc791\ub41c\ub2e4. dump_stack\uc744 \ubcf4\uba74 __sdhci_add_host\uac00 request_threaded_irq\ub85c \ub4f1\ub85d\ud55c\ub2e4.<\/s><\/p>\n\n\n\n<p>31\ubc88\uc73c\ub85c \ubc14\uafb8\uba74 \uc798 \ucd9c\ub825\uc774 \ub418\ub294\ub370, \uc544\ub9c8 msi\uac00 \ub4dc\ub77c\uc774\ubc84\ub97c \uc774\uc0c1\ud558\uac8c \ub9cc\ub4e4\uc5b4\uc11c \uadf8\ub7f0\uac00 \uc2f6\ub2e4. \uc778\ud130\ub7fd\ud2b8\ub97c \ud55c\ubc88 \ub4f1\ub85d\ud558\uace0 \ub9d0\uc544\uc57c \ud558\ub294\ub370, xhci_run\uc73c\ub85c \uacc4\uc18d \ub4f1\ub85d\ud558\ub294 \ub290\ub08c\uc774 \ub4e0\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[    0.824266] [+][irq_debug] irq_num: 36, func: request_threaded_irq, line: 1888, caller: __sdhci_add_host+0xcc\/0x354\n[    0.827401] CPU: 0 PID: 32 Comm: kworker\/0:1 Not tainted 4.19.127-v7l+ #91\n[    0.830475] Hardware name: BCM2835\n[    0.833547] Workqueue: events deferred_probe_work_func\n[    0.836652] [&lt;c0212dd8>] (unwind_backtrace) from [&lt;c020d3ec>] (show_stack+0x20\/0x24)\n[    0.839740] [&lt;c020d3ec>] (show_stack) from [&lt;c09c01dc>] (dump_stack+0xd8\/0x11c)\n[    0.842903] [&lt;c09c01dc>] (dump_stack) from [&lt;c0285ac8>] (request_threaded_irq+0x19c\/0x1a0)\n[    0.846078] [&lt;c0285ac8>] (request_threaded_irq) from [&lt;c0843ba0>] (__sdhci_add_host+0xcc\/0x354)\n[    0.849277] [&lt;c0843ba0>] (__sdhci_add_host) from [&lt;c0844a60>] (sdhci_add_host+0x34\/0x48)\n[    0.852508] [&lt;c0844a60>] (sdhci_add_host) from [&lt;c084e8e0>] (sdhci_iproc_probe+0x11c\/0x150)\n[    0.855711] [&lt;c084e8e0>] (sdhci_iproc_probe) from [&lt;c071ad64>] (platform_drv_probe+0x58\/0xa8)\n[    0.858963] [&lt;c071ad64>] (platform_drv_probe) from [&lt;c0718f24>] (really_probe+0x20c\/0x2cc)\n[    0.862234] [&lt;c0718f24>] (really_probe) from [&lt;c07191b8>] (driver_probe_device+0x70\/0x188)\n[    0.865503] [&lt;c07191b8>] (driver_probe_device) from [&lt;c071947c>] (__device_attach_driver+0xac\/0xd0)\n[    0.868788] [&lt;c071947c>] (__device_attach_driver) from [&lt;c0716f2c>] (bus_for_each_drv+0x90\/0xd4)\n[    0.872033] [&lt;c0716f2c>] (bus_for_each_drv) from [&lt;c0718c90>] (__device_attach+0xe0\/0x148)\n[    0.875327] [&lt;c0718c90>] (__device_attach) from [&lt;c07194fc>] (device_initial_probe+0x1c\/0x20)\n[    0.878644] [&lt;c07194fc>] (device_initial_probe) from [&lt;c0717f50>] (bus_probe_device+0x94\/0x9c)\n[    0.881988] [&lt;c0717f50>] (bus_probe_device) from [&lt;c07183e0>] (deferred_probe_work_func+0x70\/0x9c)\n[    0.885363] [&lt;c07183e0>] (deferred_probe_work_func) from [&lt;c023da28>] (process_one_work+0x23c\/0x518)\n[    0.888693] [&lt;c023da28>] (process_one_work) from [&lt;c023eb00>] (worker_thread+0x60\/0x5b8)\n[    0.892070] [&lt;c023eb00>] (worker_thread) from [&lt;c02445a4>] (kthread+0x16c\/0x174)\n[    0.895476] [&lt;c02445a4>] (kthread) from [&lt;c02010ac>] (ret_from_fork+0x14\/0x28)\n[    0.898876] Exception stack(0xef3e3fb0 to 0xef3e3ff8)<\/pre>\n\n\n\n<p>__sdhci_add_host \ud568\uc218\ub97c \ucc3e\uc544 \ucc45 \uc608\uc81c\ub97c \ucd94\uac00\ud588\ub2e4. linux\/drivers\/mmc\/host\/sdhci.c\uc5d0 \uc815\uc758\ub418\uc5b4 \uc788\ub2e4. \ud568\uc218\ub97c \ucd94\uac00\ud558\uba74, <a href=\"https:\/\/www.educative.io\/edpresso\/resolving-the-dereferencing-pointer-to-incomplete-type-error\">\uc5d0\ub7ec<\/a>\ub09c\ub2e4. \uc5b4\ub514\uc5d0 \uc815\uc758\ub418\uc5b4 \uc788\ub294\uc9c0 \ubaa8\ub974\ub294 \ub4ef \ud558\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/*210611, interrupt_debug_irq_desc \ucd94\uac00  *\/\nstatic void interrupt_debug_irq_desc(int irq_num)\n{\n    struct irqaction *action;\n    struct irq_desc *desc;\n\n    desc = irq_to_desc(irq_num);\n\n    if (!desc ) {\n        pr_err(\"invalid desc at %s line: %d\\n\", __func__, __LINE__);\n        return;\n    }    \n\n    action = desc->action;\n\n    if (!action ) {\n        pr_err(\"invalid action at %s line:%d \\n\", __func__, __LINE__);\n        return;\n    }    \n\n    printk(\"[+] irq_desc debug start \\n\");\n\n    printk(\"irq num: %d name: %8s \\n\", action->irq , action->name);\n    printk(\"dev_id:0x%x \\n\", (unsigned int)action->dev_id);\n\n    if (action->handler) {\n        printk(\"interrupt handler: %pF \\n\", action->handler);\n    }    \n\n    printk(\"[-] irq_desc debug end \\n\");\n}<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int __sdhci_add_host(struct sdhci_host *host)\n{\n    struct mmc_host *mmc = host->mmc;\n    int ret; \n\n    \/*   \n     * Init tasklets.\n     *\/\n    tasklet_init(&amp;host->finish_tasklet,\n        sdhci_tasklet_finish, (unsigned long)host);\n\n    timer_setup(&amp;host->timer, sdhci_timeout_timer, 0);\n    timer_setup(&amp;host->data_timer, sdhci_timeout_data_timer, 0);\n\n    init_waitqueue_head(&amp;host->buf_ready_int);\n\n    sdhci_init(host, 0);\n\n    ret = request_threaded_irq(host->irq, sdhci_irq, sdhci_thread_irq,\n                   IRQF_SHARED, mmc_hostname(mmc), host);\n    if (ret) {\n        pr_err(\"%s: Failed to request IRQ %d: %d\\n\",\n               mmc_hostname(mmc), host->irq, ret);\n        goto untasklet;\n    }\n    \/\/210611 irq \uc2e4\uc2b5\n    interrupt_debug_irq_desc(host->irq);\n...<\/pre>\n\n\n\n<p>usb \ub4dc\ub77c\uc774\ubc84\ub294 irq_to_desc\ub97c \uc798 \uc0ac\uc6a9\ud588\ub294\ub370, sdhci\uac00 \uc5d0\ub7ec\ub0b4\ub294\uac8c \uc774\uc0c1\ud558\ub2e4. \ud5e4\ub354\uc5d0 extern\uc73c\ub85c <a href=\"https:\/\/stackoverflow.com\/questions\/9820458\/how-to-define-a-function-in-one-linux-kernel-module-and-use-it-in-another\">\ub2e4\ub978 \ud30c\uc77c\uc5d0\uc11c \uc4f8 \uc218 \uc788\ub3c4\ub85d \ud588\uc74c\uc744 \uc54c\uc558\uace0<\/a>, \uc55e\ucabd\uc5d0 \ud1b5\uca30\ub85c \ubcf5\uc0ac\ud558\uc5ec \ubd99\uc600\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/*\n *  linux\/drivers\/mmc\/host\/sdhci.c - Secure Digital Host Controller Interface driver\n *\n *  Copyright (C) 2005-2008 Pierre Ossman, All Rights Reserved.\n *\n * This program is free software; you can redistribute it and\/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 2 of the License, or (at\n * your option) any later version.\n *\n * Thanks to the following companies for their support:\n *\n *     - JMicron (hardware and technical support)\n *\/\n...\n\/\/210618. irq_to_desc \uc2e4\uc2b5\n#include &lt;linux\/irq.h>\n#include &lt;linux\/slab.h>\n#include &lt;linux\/export.h>\n#include &lt;linux\/interrupt.h>\n#include &lt;linux\/kernel_stat.h>\n#include &lt;linux\/radix-tree.h>\n#include &lt;linux\/bitmap.h>\n#include &lt;linux\/irqdomain.h>\n#include &lt;linux\/sysfs.h>\n#include \"..\/kernel\/irq\/internals.h\"<\/pre>\n\n\n\n<p>\ubd80\ud305 \uba54\uc138\uc9c0\ub97c \ubcf4\uba74 \uc815\uc0c1\uc801\uc73c\ub85c \ucd9c\ub825\ub41c\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[    0.912941] [+] irq_desc debug start \n[    0.918446] irq num: 36 name:     mmc1 \n[    0.921869] dev_id:0xef827b40 \n[    0.925260] interrupt handler: bcm2835_mmc_irq+0x0\/0x6e8 \n[    0.928658] [-] irq_desc debug end <\/pre>\n","protected":false},"excerpt":{"rendered":"<p>msi\uac00 xhci \ub4dc\ub77c\uc774\ubc84\ub97c \uc798\ubabb \ub9cc\ub4e4\uc5c8\ub294\uc9c0 \uc778\ud130\ub7fd\ud2b8\ub97c \ub108\ubb34 \ub9ce\uc774 \ubc1c\uc0dd\uc2dc\ud0a8\ub2e4. \uc67c\ucabd\ubd80\ud130 36: \uc778\ud130\ub7fd\ud2b8 \ubc88\ud638, 40080: cpu0 \ubc1c\uc0dd \ud69f\uc218, 0: cpu 1, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12],"tags":[53,798,918,912],"class_list":["post-4652","post","type-post","status-publish","format-standard","hentry","category-12","tag-linux","tag-raspberry","tag-request_irq","tag-912"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/4652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/comments?post=4652"}],"version-history":[{"count":5,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/4652\/revisions"}],"predecessor-version":[{"id":4658,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/4652\/revisions\/4658"}],"wp:attachment":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/media?parent=4652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/categories?post=4652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/tags?post=4652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}