Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp149005pxv; Wed, 30 Jun 2021 02:11:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLXdgxQfoOKN2d9CqhDT1iZmAaIHD3dl5khbr4l5ajzuS3WH6ld9zNbUrJpi9tIbIFLkYM X-Received: by 2002:a92:dd89:: with SMTP id g9mr13956116iln.200.1625044262133; Wed, 30 Jun 2021 02:11:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625044262; cv=none; d=google.com; s=arc-20160816; b=iK+2mmXU+/ClWT7+5G4dRz6ugDY+L9spEQcBK/nUmTESLb9VqlFMpn98l+2asnovie 6yc/jvmU1BP0xjStof0c0fSjsc9llr+YACgtE8M4zVCkHTqprTdv24FJ/X20u/0/K29m hx1MrDaf6sb1uPaAjRQGglFX4u7P1gMnaZA6X+JYQ2REH5RDa4UkAQ9iNMTNzA7EjRkK FP7+RmxIcD37lC3l1zifyLPBCG55sD2LXfEFoMDXo6aTNtgg2TSKkY+ox1jt/gtUva0h Sxo0jEjya534tnDMTjKSmxHerABV+/kHQ6+W5LID1YhcbwhTJLFB93+t8ibsjemGrwNs mxiQ== 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=77sZFHxG4IGoGSAsZnBjKAxe8dnFgLVesmlP8D6MwP4=; b=Tv77HnBWft0vu+uL/iMWJ3zkEt/1TZmOE7xcHc9ru0WgpgpBgGQSXVP3pzTlvdO20m UuN7dVfnvgh+ZGCcZ5TiU1QwnGkutj3WZa8XDmWUP0MYnQ2AnLzz2QbMvp1kp8N7PrmL AT8yRObt2Ad+vElJfgKF8T9F8lpfOWqqyAOYu7yNyU+7/CpTHuuNpYiSu0AgzMCm1gDf BDBHZ4xQKBoY8rML3HC8xaMdYzsmWgb3Z4lch8qseZoFlIhJ1m61JkGIQzzapOTZ7Faz 7/p0U2kzkHU3IF1RTy6PkSStvpZO3o6CXlCn0GhvmMVYexc7ScnJHZU8mLg3oWz2GhsK wyuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uU7HMRHm; 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 n14si4441799ili.18.2021.06.30.02.10.50; Wed, 30 Jun 2021 02:11:02 -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=uU7HMRHm; 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 S233698AbhF3JMp (ORCPT + 99 others); Wed, 30 Jun 2021 05:12:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:53858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233561AbhF3JMo (ORCPT ); Wed, 30 Jun 2021 05:12:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D11C561375; Wed, 30 Jun 2021 09:10:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1625044215; bh=BwIdTxuROLQE7JivcAvbimKNyDHnZq4N/RWe1m3hc/I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uU7HMRHmwRgQ7OFo/R4xFNBGsqbaoA8jQbPYJykVGXpReVfPl94fjTFqZDiIdOKxT NrY6cs69/QH3qllrjLfhrj40CHsAqRJajbSYIZ+njY6b+vgZxf10ZFQMvLqQC+G875 usXYHoGcwDFyz9jk6u+/FHY3HV/0tOBwNcVzsLsA= Date: Wed, 30 Jun 2021 11:10:13 +0200 From: Greg KH To: Bing Fan Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] arm pl011 serial: support multi-irq request Message-ID: References: <1625018153-14672-1-git-send-email-hptsfb@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1625018153-14672-1-git-send-email-hptsfb@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 30, 2021 at 09:55:53AM +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 | 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; No error handling to put back the irq you requested if an error happens? That feels like a memory leak... thanks, greg k-h