Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4896269pxv; Tue, 29 Jun 2021 19:26:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5k0VfWqPYuTaWmLl8Nsn2/IL2RiqPGYrbMHQc9a7Wmkke9pz+kxH6TnTSMfpllDEwrPqM X-Received: by 2002:a92:7510:: with SMTP id q16mr23986339ilc.291.1625019960288; Tue, 29 Jun 2021 19:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625019960; cv=none; d=google.com; s=arc-20160816; b=g6OOnZ0fqN+hniqVDhtXNdN3xEx4py/AmpFlwtnqXktQb29jpIuVn5XAz77Qlp0Gn7 Zm64S+TrsWO1Mv4MjpYuK08Jacqp+2fJQYgA8B3yg5N0FXVthllVkAMbulH09BxNOk/v /c34BfR5QDKnpZz+l1xJJteePteTUBvTjQq7Rr6fs8Su/88IjG4fB+ahgC89iVYERafC Icyyaq5Sn48VW7TI0Ijj+uul5BcVAegvILIZdsZPWBHpuqpKSwy2JR/XvBxtUVg036fY fM3MfYUdIif7aGvZsl1yZBeUXK/zFRAZlNsXvk7MZIm4QG6zYshhRh4M0UsbtPzJ3LQ/ kyQg== 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=3XEmE3tBGvyuKAhQyT6Z2Ge4lC3BY97Gtc5iIn4CjGA=; b=noeJqzKWk+z0nAyvnRGM8BEwOObQLmtStgw3UOWb265ZKXoIkSVWbsJKQl+McV6Boi Kqb79vA48CXLM63eVouksi/bmOf1ftxT8uFvz7wB+fJxmZCzHhSKtB2gW+sMlVw2Zq3A 1CaiPqZAM8ByYyrI+cSvTYCO+TxD8mD126rgfyORx1ToDmYEK4NOl+g9RIum7lpHlqCZ F1TF+Z7wqzSpcsujwCWgWwZsWBsr0YNv9tJw0WKsbjVr3MDsYhmkVUIY7teYRdfVSTPm V+ZFc8lR2DBl4IDZERUg+g4KIqKDadn+Ig6yDhhIFp4dY3lG3YvsSAeKgVzLT+tvI4ax 05cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KkAQGChq; 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 q2si17108948jat.108.2021.06.29.19.25.23; Tue, 29 Jun 2021 19:26:00 -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=KkAQGChq; 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 S231986AbhF3B60 (ORCPT + 99 others); Tue, 29 Jun 2021 21:58:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231879AbhF3B60 (ORCPT ); Tue, 29 Jun 2021 21:58:26 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C5CEC061760; Tue, 29 Jun 2021 18:55:57 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id p17-20020a17090b0111b02901723ab8d11fso325777pjz.1; Tue, 29 Jun 2021 18:55:57 -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=3XEmE3tBGvyuKAhQyT6Z2Ge4lC3BY97Gtc5iIn4CjGA=; b=KkAQGChq+8NzbfFmR1tyl6K0QlHezai+O4ffrI1vf7v6lauxKfb1Fc7VUR0Hrw+m/O eLkkgepe9fr73zl4t2xSr+PQGXGwOp5M8VNVyba0VYVX5BFIiS4TKzcrsv8kEG3+spRQ Efns8xzIx0ljwtQhXSdOVRfJP7BdRDFWE6ZO2c3mY89xN6Qu7uV7K6kIrxUetDaRMIa5 C1C/xoSxwu6+d8KilP1P5JSyOy0tN0xjDziAHvrr8fx4raNHqaoXPKl6Pn/91SjI8Yxz FpdD4vA3C8MfnDThfHOoe9miXKRtGuZDX02Xv1JKmlyT8OPUkFBE2pk9YbpSeNP8TzEe HwYQ== 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=3XEmE3tBGvyuKAhQyT6Z2Ge4lC3BY97Gtc5iIn4CjGA=; b=X9g1WhOapj0KQkacZJtUw+82fZQGEoW9aKmZvrZlrJ+qNqcscsUeNLOHctRGoSFuKT BbulwmEf8tzsm712+RgG9UIPIvnSjU6u9gSf7XDgPTDXIj75RfgADBzEx6Ez2zj/KV9w QxeRhmrHG8vBwOvTzoDalrzGydth50kpcbD+FljqLhZ63QU3ERKmWfEPcxLd3I8C6mPi HzkyabVXMLsA0CXTNhlvYnaf9SdNQDAxxOuNmuXYFIxSBq1+dNRqJ0SYjAFmdgQCbOq4 vCy5pnrliLPi415Rur1QWwBFi7mGTUOM8Mv1+bFaX6IYOHKEuuXLaY6yChF6ZPIBToXT b0XQ== X-Gm-Message-State: AOAM530tZZo7uwfdzm2MkclnD46cFP5vkMFsTLLbtBlvM8qJx+/J92uy fdtjI44fSKVV4hg+F2mHFWNvu9ZOFqiAK5X3 X-Received: by 2002:a17:902:b08c:b029:128:4b85:b6f7 with SMTP id p12-20020a170902b08cb02901284b85b6f7mr24966157plr.39.1625018157087; Tue, 29 Jun 2021 18:55:57 -0700 (PDT) Received: from localhost.localdomain ([150.109.127.35]) by smtp.gmail.com with ESMTPSA id j12sm19412048pjw.52.2021.06.29.18.55.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jun 2021 18:55:56 -0700 (PDT) From: Bing Fan To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] arm pl011 serial: support multi-irq request Date: Wed, 30 Jun 2021 09:55:53 +0800 Message-Id: <1625018153-14672-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 | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 78682c12156a..8b471de0e31c 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -1703,9 +1703,26 @@ 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 = 0; + int i; + unsigned int virq; + struct amba_device *amba_dev = container_of(uap->port.dev, struct amba_device, dev); + 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) { + dev_err(uap->port.dev, "request %u interrupt failed\n", virq); + break; + } + } + + return ret; } /* -- 2.17.1