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 X-Spam-Level: X-Spam-Status: No, score=-0.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26DE9C432C3 for ; Sat, 30 Nov 2019 08:40:55 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 9D39720732 for ; Sat, 30 Nov 2019 08:40:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pSSxZmFx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D39720732 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 37F261DBD; Sat, 30 Nov 2019 09:40:53 +0100 (CET) Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) by dpdk.org (Postfix) with ESMTP id 573B4235 for ; Sat, 30 Nov 2019 09:40:51 +0100 (CET) Received: by mail-qk1-f195.google.com with SMTP id v23so19901532qkg.2 for ; Sat, 30 Nov 2019 00:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=TNDJIesyC5SmmmFSfvLaLO4ZXs7yoYNlnhtBTyGyakw=; b=pSSxZmFxYOtjeKhg1fszKUGw2b67YrB2E/ndt6X3SRyts+puHlF4msyOeXj6ga79GY mUdSmSy1iYgGoU5OpUyf1HVapYKNmygVjLjwCExT/Wb3maCJIYqm37mWFWEHdZJEb738 ZFPubdm+hx+nbTQ9QCzTjjUAeuElW1NEb26RJahaG+wo7RXqkkEe8ee2ROq+2s7VErdX k/SyV8oS+UfrHLuVze1uy58ecyLCoy5DIvMnXbu2LKDLJKuXUQd8cfSIx9IPY8BMJ3yt vp/3k8sFnFb+YtdG2iJg3mcb4K5xXhiUTJJU1HVdLuZh8fw3yKtN+7NeEiqFQQWdOaSU Tugw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=TNDJIesyC5SmmmFSfvLaLO4ZXs7yoYNlnhtBTyGyakw=; b=ab4d689a5Z7VKbS1LjtwXig9PyLtQilHBLwldVUMG8BFJ1dqtjxwMozJoKOzq8xXGb DFkvNzcdSasy8tofMZAAK5XukTeTAmhGfgbYD8XIqb2Bbm+HgYmtsZ1I+UuEjvE5a2LF 4p++RGvqVLk7Op9BOJG31IqB6XFr4e58GTWC5Iq7havMTK7T+j2q1wGDaGF22k42cTqq uybfjj5CJFSyjckYc0CH63EMvbytRPnmwBU3bYWDnyhUODko02jaOaEFSM2tiCQ/4eDr 7YJF0jJbJUVTMnpTTDA4SvGMFPalAs/+ZWtGzXSgy18oRrdQV2jNOniBZcaJCF4RZgK9 paJg== X-Gm-Message-State: APjAAAX9jwGTWpLYlF7RkSQtWCkES3mDZM1aam+K9O7r2AGxrWlTimjT APnBX7mso0XlxkQr3zNDI4pGtziq41gEPC+V7F1N8dNR X-Google-Smtp-Source: APXvYqw9nY7rxXcOtOujOWfCxRBIzgI2PhsqgPmxXH/7l0pe+ElJnrClAKWl3rUXGl4vqglgEAlvo9dmt/aa8fRNufs= X-Received: by 2002:a37:6551:: with SMTP id z78mr19033589qkb.144.1575103250218; Sat, 30 Nov 2019 00:40:50 -0800 (PST) MIME-Version: 1.0 From: Ranran Date: Sat, 30 Nov 2019 10:40:38 +0200 Message-ID: To: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Subject: [dpdk-dev] Interrupt is catched in kernel, but not handled X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hello, This is not a specific dpdk question, but more related to using of uio_pci_generic. Unfortunately, I don't find any examples of using the generic driver from userspace, so this is my last hope to reach a suggestion. I installed centos8 , and I use uio_pci_generic, in order to communicate with FPGA (Xilinx) through PCIe in userspace. The cpu is ATOM cpu. I first install the driver: echo "10ee 0007" > /sys/bus/pci/drivers/uio_pci_generic/new_id Reading from BAR works perfectly but there is an issue with interrupts. I use userspace application which wait for interrupt, exactly as described in code example here: https://www.kernel.org/doc/html/v4.1...uio-howto.html I than trigger an interrupt from FPGA, but no print from the userspace application is given and there is an exception: irq 23: nobody cared (try booting with the "irqpoll" option) [ 91.030760] CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.18.16 #6 [ 91.037037] Hardware name: /conga-MA5, BIOS MA50R000 10/30/2019 [ 91.043302] Call Trace: [ 91.045881] [ 91.048002] dump_stack+0x5c/0x80 [ 91.051464] __report_bad_irq+0x35/0xaf [ 91.055465] note_interrupt.cold.9+0xa/0x63 [ 91.059823] handle_irq_event_percpu+0x68/0x70 [ 91.064470] handle_irq_event+0x37/0x57 [ 91.068481] handle_fasteoi_irq+0x97/0x150 [ 91.072758] handle_irq+0x1a/0x30 [ 91.076230] do_IRQ+0x44/0xd0 [ 91.079333] common_interrupt+0xf/0xf [ 91.083154] [ 91.085360] RIP: 0010:cpuidle_enter_state+0x7d/0x220 [ 91.090563] Code: e8 18 1a 45 00 41 89 c4 e8 d0 50 b1 ff 65 8b 3d d9 db e5 5f e8 44 4f b1 ff 31 ff 48 89 c3 e8 ea 61 b1 ff fb 66 0f 1f 44 00 00 <48> b8 ff ff ff ff f3 01 00 00 4c 29 eb ba ff ff ff 7f 48 89 d9 48 [ 91.110283] RSP: 0018:ffffb20e806b7ea8 EFLAGS: 00000286 ORIG_RAX: ffffffffffffffda [ 91.118203] RAX: ffff90133fd214c0 RBX: 00000015316faa09 RCX: 000000000000001f [ 91.125662] RDX: 00000015316faa09 RSI: 0000000000000000 RDI: 0000000000000000 [ 91.133133] RBP: ffff90133fd2b300 R08: 0000011741eb842c R09: 0000000000000006 [ 91.140605] R10: 00000000ffffffff R11: ffff90133fd205a8 R12: 0000000000000001 [ 91.148068] R13: 00000015316f98b9 R14: 0000000000000001 R15: 0000000000000000 [ 91.155523] ? cpuidle_enter_state+0x76/0x220 [ 91.160088] do_idle+0x221/0x260 [ 91.163470] cpu_startup_entry+0x6a/0x70 [ 91.167588] start_secondary+0x1a4/0x1f0 [ 91.171676] secondary_startup_64+0xb7/0xc0 [ 91.176043] handlers: [ 91.178419] [<00000000ec05b056>] uio_interrupt [ 91.183054] Disabling IRQ #23 So, I started debugging this issue in kernel uio_pci_generic.c code, and according to the prints below, it seems that irq is catched but not delivered to userspace: static irqreturn_t irqhandler(int irq, struct uio_info *info) { struct uio_pci_generic_dev *gdev = to_uio_pci_generic_dev(info); printk("i'm here 1\n"); <<--- this is printed if (!pci_check_and_mask_intx(gdev->pdev)) return IRQ_NONE; printk("i'm here 2\n"); <<--- but this is NOT printed /* UIO core will signal the user process. */ return IRQ_HANDLED; } Reading documentation, I see that pci_check_and_mask_intx is actually checking if interrupt bit is set in configuration space. Since it seems to return 0 ,it should mean that it finds that this bit is not enabled. But how can it be that irq is triggered and status bit is not enabled in configuration space ? The device appear as following with lspci -vv: 02:00.0 RAM memory: Xilinx Corporation Default PCIe endpoint ID Subsystem: Xilinx Corporation Default PCIe endpoint ID Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR-