Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp552879pxb; Fri, 13 Aug 2021 00:38:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyH79nAW0tz7ILZV8qgeeGwydHVHtr4vm/eqPVeutXIa4EWtT7cG2//urR5+BY9KbUN9KDa X-Received: by 2002:a05:6e02:2149:: with SMTP id d9mr897496ilv.141.1628840333768; Fri, 13 Aug 2021 00:38:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628840333; cv=none; d=google.com; s=arc-20160816; b=po2SYBi09sPvsDK1zZYXJDy3h0Up1tWk6aCmP2Cu6ld6KCd3Zb7jozb3GzjbbG/dbZ rZKDLXdwl0hrt0WDmv5KcKkOxFQ4FfkovrFBL5tecYoumL7VmBvedMKdDX8iZxk0qULm f2wGlbqzSsCCekXvb2LPk4MLZv3REWU+c8Tmb+5mXjUttN7ewxiC4Cbl0tm/6q3p5Ult 1omS22Y1WgojQfudY1MBwDCL2cWY36lNakym1vSfyiT8CYjJ8EWqibRIAXwLFRllVPOz 2EXusBrn8eJsx08CqYJrZkl2n0J0dSimI7cWZTAcKlQGdEKPohydSwPy8n48qYOLKP7N k2Dg== 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=UyJn0nkz5EcW6joC77W0DVwzUY0zqgdoRCB954R21k4=; b=JulWlG1BY3KCwtY2CVu601tXFR4mobxRt6I6i26yo0HMVh2XHDMoBjmQjEPuOiXdU0 kizW3QseVOw8iz0hGKDVaGWlNp7Q12FFbRGCxkYe3fUQTOmoQwy0dq3rYxc1stM8CWSL stqozrgmZVCBx676QSXuAWrvxmfZBuuAzKrk/28hTCIsla1PRLL3uOXRq4F7qjnTVeE3 0aFokQCNtYnT9YqEoMJNzPexplZIkJ3zDRpZbvY4MyqNvG1zfRcaWNKhhhZOxIUGaVvS fu45wgD5gvubZAvm06f+ihZqraFy56kfBARLF5HSwiqJuZiWUr/QpSBpI2aR60690J6Z bA8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ND/Rg/bT"; 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 20si827802ioz.25.2021.08.13.00.38.42; Fri, 13 Aug 2021 00:38:53 -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="ND/Rg/bT"; 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 S239270AbhHMHTs (ORCPT + 99 others); Fri, 13 Aug 2021 03:19:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:42258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239248AbhHMHTr (ORCPT ); Fri, 13 Aug 2021 03:19:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 306F86103A; Fri, 13 Aug 2021 07:19:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628839160; bh=gdGgukaTpNdeTLbR8bjikQFUEVSQ0BaQIAOZfGs68jo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ND/Rg/bTL4d2NqRZenL/APCn/E3Jty+o4CGqb8+/OHOPO4elGa5Irf5Sg7FE0nkss r/XBF/dz+arpWigTWsJ1xtMwczdym3LDmJk+g692b/s5tsZWN5AYmOPTuCZ2vFyxkb V3m+rg9dGE5StSWQd5XsDhTOG8W0T+6zvh75MKzs= Date: Fri, 13 Aug 2021 09:19:18 +0200 From: Greg KH To: Bing Fan Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6] arm pl011 serial: support multi-irq request Message-ID: References: <1628825490-18937-1-git-send-email-hptsfb@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1628825490-18937-1-git-send-email-hptsfb@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 13, 2021 at 11:31:30AM +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 | 39 +++++++++++++++++++++++++++++++-- > 1 file changed, 37 insertions(+), 2 deletions(-) > > diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c > index e14f3378b8a0..eaac3431459c 100644 > --- a/drivers/tty/serial/amba-pl011.c > +++ b/drivers/tty/serial/amba-pl011.c > @@ -1701,6 +1701,41 @@ static void pl011_write_lcr_h(struct uart_amba_port *uap, unsigned int lcr_h) > } > } > > +static void pl011_release_multi_irqs(struct uart_amba_port *uap, unsigned int max_cnt) > +{ > + struct amba_device *amba_dev = container_of(uap->port.dev, struct amba_device, dev); > + int i; > + > + for (i = 0; i < max_cnt; i++) > + if (amba_dev->irq[i]) > + free_irq(amba_dev->irq[i], uap); > +} > + > +static int pl011_allocate_multi_irqs(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); > + > + 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, dev_name(&amba_dev->dev), uap); > + if (ret) { > + dev_err(uap->port.dev, "request %u interrupt failed\n", virq); > + pl011_release_multi_irqs(uap, i - 1); > + break; > + } > + } > + > + return ret; > +} This function looks identical to pl011_allocate_irq(), so what is the difference here? Why is this still needed at all? What does it do that is different from pl011_allocate_irq()? confused, greg k-h