Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4138257pxv; Mon, 28 Jun 2021 23:20:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytsuGX6PUjJDiDfpCsTTAW7DVGyosdfuAzRgdHAV/NB8L40r+7cQYtJKeVfGore0NQd2Ve X-Received: by 2002:a92:c24f:: with SMTP id k15mr1082288ilo.155.1624947647508; Mon, 28 Jun 2021 23:20:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624947647; cv=none; d=google.com; s=arc-20160816; b=po31oco8zUh417//1Dt9P8Mrn8exDQBsR6UuNLbQqGbgRx8IKHPSuzLRmz+RhqOLmp kazhJKcIl8mapiD6Lr5mF0TPWRKIwZNdT/fus19wv29IqQiOIHTiZk+i0dO0Q0Yxd10l IqgcjpXXP3YfrMS+c2ZZ4f39INdiXwPIyEurZ15X/N9inXDP74r/8e+rs+whIA+45S/b R0U6Zk3ld4hbTtLext+dyA5o0cP+qjp/cphpmjtdJT2HaYloqgf2ef1udulzMoD+sCXa U+cwuIrstInSsg3IGWFS6CbvRrLpNzshcVVsmOGGOMFWXPEQ+N7iPZbuME4b3XkPrZ6w m5kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3+zU/FIA9ahJWZCl3kn+feHKAWPjs65T+9mW5/cq1ek=; b=gX6Dgl7xfkpnbDuAsYDC0E1Eefki9ZyH2Wu8NEfKc5zsolcSHzV8M8fqwxV/sGpP43 sLKBLx5ItQRYrA7TtvxR9TQgYBfxdprozpcqQ/AOioc3tek6fDyBuG4Vdl+bKwDGHwek 8WFaDU8bwbhPBp57n0eCDtKpErA4D1Ye+AxczPc56tmplF64xsl6QLcjQFHtUSPp4cx1 5hTaoZYTWiv3obRivghQlZP1yqeOpDQw7PNHDp6HuYccMypga/W9ImgpEKgNQvAgaaNy dod1BvCBSWgiiIpSAIDr+e1CEsvaTziDuiK1t8JAFvUlJF+9OOqzTt7GAMbfDWc17yQD 78mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ePZcphum; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z16si19443597ilo.50.2021.06.28.23.20.35; Mon, 28 Jun 2021 23:20:47 -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=@linuxfoundation.org header.s=korg header.b=ePZcphum; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232110AbhF2GV3 (ORCPT + 99 others); Tue, 29 Jun 2021 02:21:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:35642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232029AbhF2GV2 (ORCPT ); Tue, 29 Jun 2021 02:21:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C9A1B61DC1; Tue, 29 Jun 2021 06:19:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624947541; bh=j/QptbEon823E8WlB8x1s+cyTfvYWt/sjkL6rYuUcHw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ePZcphumiKcimv6vrOnb5OBSEFKNGf24hs+NN1mYQUxyDUw1dhIFWi2u2VP7H73Sf 3xczPj1sk7+hXvCCw+hHpiI0UaORO6A9D3J/SoHxdzWSs9MFaFrTnuMesBW90J3iyK JRz6QasoLlzTkViC5iWkwmaepdMViA+O7r/boRfs= Date: Tue, 29 Jun 2021 08:18:59 +0200 From: Greg KH To: Bing Fan Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm pl011 serial: support multi-irq request Message-ID: References: <1624930164-18411-1-git-send-email-hptsfb@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1624930164-18411-1-git-send-email-hptsfb@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 29, 2021 at 09:29:24AM +0800, Bing Fan wrote: > 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; Pick a real error value. > + int i = 0; Why is this initialized? > + unsigned int virq = 0; Why is this initialized? > + struct amba_device *amba_dev = (struct amba_device *)uap->port.dev; Are you sure you can just cast this like this? Did you test this? > + > + if (!amba_dev) > + return -1; Do not make up error numbers, return a specific -ERR* value. And how can this happen? > + > 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); dev_err() is for errors, not dev_info(). And no need for __func__ and __LINE__ for the dev_* calls. > + break; > + } > + } > + > + return ret; > } > > /* > -- > 2.17.1 >