Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3286589pxv; Mon, 28 Jun 2021 00:47:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzN8+I2GoJ5sDHQuvBPXOA5+xW9KYfvdI4+vZGL/e34b+wmN9FvUcU1syU/aoMmwXe19ZM X-Received: by 2002:aa7:c857:: with SMTP id g23mr30367571edt.100.1624866459274; Mon, 28 Jun 2021 00:47:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624866459; cv=none; d=google.com; s=arc-20160816; b=D6/ottzMwSeUQ1U60TWLc+ZkrcNu9sTSZpJ14Z7BAR/Zuql07cLR2wpgri3CGwvhdg a1mPJ7XXXFTqnFCSGtQEUy/YQF8uEKT+pL1VmCAE1mIDU0mIRvEiwX7frk7zgr6jm+yH BgE2NIWmLiOnMHjYqru0XzV3uJXfysZIdZdHJCfdDIpLvK+R6E3mRKrF6RH95rxE3mEm 8yppnn++agc5nLo1og7HSsC2kAvafMMt4r86/TvNld6vf14JZpG1I8wu55ACqeAuIIgg /vWiOiirZWplp+TETzd4rx+MABV6LrCv4/HhrfTkF1MwincDFMztoq27HYZdv+beLflj 8wfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=f7Ot5LmHXi7VpG2BSEj4RHIyzwV7fgDXK6MRtvKTViQ=; b=AthI3kmnNpaDcEtcBBm+ss1UQceuFyy11pvGSqSJ3Wgy5yKPDLvTihxeJ8BBjHWYX1 eIYcijw/6SX/aR6ATEr//FuNTEMy0BtPHXIQpxhCO/pA1EUfBzr6xeth/SVas6F0FAQL Ea8w+wQvXN1loziEs0eX4Rke+m5GOoKUX5ED0QWzjzTFsTD4gQIiYbtcKDiKnbjadPol 7/DoAHE+1Ge5IFzrjr5IdayFQV0CSGVUVXuu+aJe6k7SIJRHy0FnpteZ9PED+KWRE3NY RyYUxCC1PfgIz6S+8ZDDjhrDUtzly5oJ1OuYo5zuKLOWh3+I2KfV+21nFEdqorAb4HAw zUTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sfQIYYTx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 15si14419782edv.482.2021.06.28.00.47.16; Mon, 28 Jun 2021 00:47:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sfQIYYTx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232317AbhF1HVx (ORCPT + 99 others); Mon, 28 Jun 2021 03:21:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229998AbhF1HVw (ORCPT ); Mon, 28 Jun 2021 03:21:52 -0400 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BF10C061574; Mon, 28 Jun 2021 00:19:25 -0700 (PDT) Received: by mail-qk1-x72e.google.com with SMTP id q190so26510983qkd.2; Mon, 28 Jun 2021 00:19:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=f7Ot5LmHXi7VpG2BSEj4RHIyzwV7fgDXK6MRtvKTViQ=; b=sfQIYYTx2Yx5PlcLhW3Gy2088xDki7HijwwPxAcIs+NyQaTX2HWhK8pAHu2mxD+pca yx+NKPap00Q73rrZ+7km/K1mrraCLhLDabq6Bs9oj9X7C2XX4YwuoRm0VQEU2HyBorvQ e9lepaiSMqqGQMWqYkulVizLclWqtlA9a0Hxq+4FeIgMaqkYiIATEJ0ieFgbejugX7sJ QPHYyIoSDy38LVtSO7Vptd1Ezt1+gSc+5vkdmhYCm/6cuO7cbzf9ehIUvyXkdu+5kan4 QNT006ryk4HNyP56CRqKRIoAt+AKZgor6T0WShKu8UuzPQHSblupLjVD4PiqtSjcnmCl J9Ww== 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:cc; bh=f7Ot5LmHXi7VpG2BSEj4RHIyzwV7fgDXK6MRtvKTViQ=; b=LJhS8B+lgHPHEBcYWlqcRfy/jweh7iXc2QZUDB1ncWFCyB3wT9U3ZkYB9mY66PLY8N 7DA83ow2/4QCywZCOd1s5yQ4sPxZIAtKoJjCIprebZi/hNz1SdLbnO5ymUyXHd9NWBa5 kugDVXdONfMj4zF8zrMacchTcpq4q1mVtSTsRDiU8slalN2Lp39Bw3C0T/kOhmw911N8 +XGml+jlPqZeKz6C6CuHxXRfOoDZjrt8jqa4xs6Q08GE5uqvdFuf5IhWwznbkQk/Kqqt iYRiw/QuUoUzWYlV16Jj7eJcjSzk1pLhE7f0DDAOt8cGaqloehkxTy6hKwdsjPeD+gj4 +6zQ== X-Gm-Message-State: AOAM53013P1MW5+FBr4mTmt4lDlvdDJJj635EVD+06hFs6tEsqZPYLTP gDn+QGJF+oAoFxqdn+PbsPnKV8BpIjELwjDpAxQ= X-Received: by 2002:a37:4197:: with SMTP id o145mr24085085qka.75.1624864764584; Mon, 28 Jun 2021 00:19:24 -0700 (PDT) MIME-Version: 1.0 From: bing fan Date: Mon, 28 Jun 2021 15:19:13 +0800 Message-ID: Subject: [PATCH] arm pl011 serial: support multi-irq request To: Greg Kroah-Hartman Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bing Fan In order to make pl011 work better, multiple interrupts are required, such as TXIM, RXIM, RTIM, error interrupt(FE/PE/BE/OE); at the same time, pl011 to GIC does not merge the interrupt lines(each serial-interrupt corresponding to different GIC hardware interrupt), so need to enable and request multiple gic interrupt numbers in the driver. Signed-off-by: Bing Fan --- drivers/tty/serial/amba-pl011.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 78682c12156a..2b6f43c27dea 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -1703,9 +1703,30 @@ static void pl011_write_lcr_h(struct uart_amba_port *uap, unsigned int lcr_h) static int pl011_allocate_irq(struct uart_amba_port *uap) { + int ret = -1; + int i = 0; + unsigned int virq = 0; + struct amba_device *amba_dev = (struct amba_device *)uap->port.dev; + + if (!amba_dev) + return -1; + pl011_write(uap->im, uap, REG_IMSC); - return request_irq(uap->port.irq, pl011_int, IRQF_SHARED, "uart-pl011", uap); + for (i = 0; i < AMBA_NR_IRQS; i++) { + virq = amba_dev->irq[i]; + if (virq == 0) // request irq until virq is 0 + break; + + ret = request_irq(virq, pl011_int, IRQF_SHARED, "uart-pl011-*", uap); + if (ret < 0) { + dev_info(uap->port.dev, "%s %d request %u interrupt failed\n", + __func__, __LINE__, virq); + break; + } + } + + return ret; } /* -- 2.17.1