简体   繁体   中英

Linux interrupt is not handled by the wrapper driver

I am writing a device specific DMA driver for Zynq AXI DMA. The driver is actually a wrapper driver and uses Xilinx DMA driver under the DMA engine driver framework like this:

+------------------+
  |   Wrapper driver |
  +------------------+
  |   DMA framework  |
  +------------------+
  | Xilinx DMA Driver|
  +------------------+
  +      Kernel      +
  +------------------+

I use interrupt 61 for transfer complete and 62 for receive complete. The interrupt handler for Xilinx DMA driver is properly installed (I checked /proc/interrupts). However, I the driver seems not to handle the interrupt properly by showing me this:

在此处输入图片说明

I checked /proc/interrupts. IRQ62 is not handled. Here is the code where the interrupt is registered:

0986     /* find the IRQ line, if it exists in the device tree */
0987     chan->irq = irq_of_parse_and_map(node, 0);
0988     err = devm_request_irq(xdev->dev, chan->irq, dma_intr_handler,
0989                    IRQF_SHARED,
0990                    "xilinx-dma-controller", chan);

And here is the output of cat /proc/interrupt:

在此处输入图片说明

I have two questions:

1) If I only install interrupt handler for Xilinx DMA driver but not the wrapper driver, while I use the wrapper driver as the char device, interrupt will not be handled by the Xilinx DMA driver?

2) If so, how do I let Xilinx DMA driver to handle the interrupt in this case? Is 'irqpoll' the only solution? Is there any performance issue compared to direct interrupt handling rather than polling?

Your devicetree isn't good, more precisely, your pl.dtsi file. My pl file looks like this:

amba_pl: amba_pl {
    #address-cells = <1>;
    #size-cells = <1>;
    compatible = "simple-bus";
    ranges ;
    axi_dma_0: dma@40400000 {
        compatible = "xlnx,axi-dma";
        interrupt-parent = <&intc>;
        interrupts = <0 29 4 0 30 4>;
        reg = <0x40400000 0x10000>;
        xlnx,include-sg ;
        dma-channel@40400000 {
            compatible = "xlnx,axi-dma-mm2s-channel";
            interrupts = <0 29 4>;
            xlnx,datawidth = <0x20>;
            xlnx,device-id = <0x0>;
        };
        dma-channel@40400030 {
            compatible = "xlnx,axi-dma-s2mm-channel";
            interrupts = <0 30 4>;
            xlnx,datawidth = <0x20>;
            xlnx,device-id = <0x0>;
        };
    };

};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM