Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3983701pxv; Mon, 28 Jun 2021 18:30:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+y893yVfl3TywEnq9KFdO2Eg7J49yz/jmmvZY1b4cxUAAS3ypS+YLAhq9nvmiKDBKJIPW X-Received: by 2002:a17:906:2583:: with SMTP id m3mr26230409ejb.506.1624930257456; Mon, 28 Jun 2021 18:30:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624930257; cv=none; d=google.com; s=arc-20160816; b=cAzJs9fziI2YC8tcA6RMGtIQMkzh0lgy+8gJoPvw5VXyN9LF9XBO/HzAaiYidpfk4f bxME9dqrPrQUzHqb7/9S6HMU9KXOZJHl37mpAgTZzWmZ6YTEFmmnnLHrj1i0VAloDS4j 1BefPenEAXRoa+oVqSwd/JYqC1B7C3QD8vA0XgIEYbVsd6G0H8gqXiaDYTBeUXQs+B+W s9uaPgBAyKhDmurTwsc1OVIrJTCmbHlefkWl349TptmrDaLAzZsRJtHtoX9pKsfFMTC6 FPpIvk/BCVB4ImfIeyfOElgBQ3w1tOw706ovL6szmdLXj8or6wUyqfuQrJ9Sj9Ymeq6L 82Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=JRlGj/MQ8RE/ZATYAF6lewLI2xCcGnw8emgVF67u0j4=; b=aPa0iXsSJwExhjNNMeHMiDIz5uEzNrrndoAIWQPFep4/Pze/A4BpbvEvpzHfY9cj0n lfUFT5FQ0sRAbat5a9yKcTaNiBaLHECuR3dLw1z8Be1VyKNsC4ZLzMbGmijR2yg8tiBm HPCupUFR6HP4aSGTkImoB5mHdgknx6VUdINaS6ijCu7TSTWg/Qq/WE+jpePfaX5p2uuE SdmJvwZ8K1R+2kXsFKyUSDqLi3EfhqU5zjUu1/d2izxM/SCgifnL0HPzDoPUj1em957a wdtofxOzBtCwApmu+RiTlYckeld3+77CG52WYc0vAM/ZzTpyVz3x9BCytBouabF5bpfw SyUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="COr3/rdP"; 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 h14si2076304edq.364.2021.06.28.18.30.29; Mon, 28 Jun 2021 18:30:57 -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="COr3/rdP"; 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 S232059AbhF2Bbz (ORCPT + 99 others); Mon, 28 Jun 2021 21:31:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231947AbhF2Bby (ORCPT ); Mon, 28 Jun 2021 21:31:54 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 196BDC061574; Mon, 28 Jun 2021 18:29:27 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id bb10-20020a17090b008ab029016eef083425so771178pjb.5; Mon, 28 Jun 2021 18:29:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=JRlGj/MQ8RE/ZATYAF6lewLI2xCcGnw8emgVF67u0j4=; b=COr3/rdPwWZrvA57IqpNwQKkAkOdlgw9G3zxEDMklJgKvsOHPYj0u7v4JmWsSVTyxs doewSEpIm/nJq3/nDL+gWgjXlNMod6G8Lkkg9lWK2KTgcSSXVaf0tS6bHLONuymmcWwV BUeuQiipACrk6f4ypekuWX76xRXJJ9xbbI6gtpP0NlY0plOVn8ckYzpGVoAySpInIzer 4SdLUBqnv+FYnoiTGmTADxFAN3Fw1jKxi4PjEiQ3yKJz5GuTyyycqpTwulLBTGKDVXFA /l36zxcs1wp+shDW1rUqUcYwczveCW/z7+4XrmGCesmYVpd1ga5kBxmaHBgaaeKMLejG 1r7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JRlGj/MQ8RE/ZATYAF6lewLI2xCcGnw8emgVF67u0j4=; b=a9LlgtYCksG1LznUagm0XrvkeHOzdYAwomvZuDQ9XIcfTcrmIZzJIQMYXI3l9t41AW FHnHJiIiCw7geeI0dUaCYLARMDZXM43UZH3WCSTcyqlJuVYjoXtXZ1qxznlsTmuhvnUO FS6W3jJ/Sd+XXFod/ZXfiHJfet6ob8RBaAfBpd6nRZhzX6bhYAvOGfd6fIiPfeU32e4Z TxlCe+sa9hNCvYxLr0fMKfcv8UgDIEsgmaX56ZKuxGRR6ZsQa0bUbgyTWN3N6NqTmcQ6 VAXQVHwYBGOLOnGIc0PbwRD3rSrDgg5mb108b7YUCvm31fFlue1WqFv3OVDRN72ZJcZQ HjFg== X-Gm-Message-State: AOAM532Kx/+RE/jAi4Dr8WkUZFFnLYN0Enpj9vZD+h06DdVcZL3K6HNt zeNURAIKzg6iPxgpgRyEqfJNRtp3/xAc9J5cRTA= X-Received: by 2002:a17:90a:b284:: with SMTP id c4mr31418084pjr.213.1624930166649; Mon, 28 Jun 2021 18:29:26 -0700 (PDT) Received: from localhost.localdomain ([150.109.127.35]) by smtp.gmail.com with ESMTPSA id k13sm15183933pfu.57.2021.06.28.18.29.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jun 2021 18:29:26 -0700 (PDT) From: Bing Fan To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm pl011 serial: support multi-irq request Date: Tue, 29 Jun 2021 09:29:24 +0800 Message-Id: <1624930164-18411-1-git-send-email-hptsfb@gmail.com> X-Mailer: git-send-email 2.7.4 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..b63164e89903 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) + 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