Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1658751ybt; Mon, 15 Jun 2020 06:18:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrDS/iu2mVsSkECaeacbaytXjgIBcQl0p3uvZMZrbvjcI4tbYEmU4ULl9lqMsMNtZx9gDn X-Received: by 2002:a50:ee18:: with SMTP id g24mr24157734eds.370.1592227105396; Mon, 15 Jun 2020 06:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592227105; cv=none; d=google.com; s=arc-20160816; b=zfIo9chl944+DLSzO3nMr90rIqyhxc2xeRpWCB0Z2uMw1yj1FJQW2Z5nutDu9pKTsS BnfEu50+xGCrpBPw/9Ix0UbQfWd9fWobPOTaAe3kg2lR8PdKkRTLVKavPlLirc61KibV /F7Q2RR5vJhAPvsYhPeKHlrJYkSd48onQ4GhVBvw2xrMW5302gSYdo2S8OhU7DqL7rmw Weu/duCFIvVFJKw2jnnfQpRnnCgWJXbntD4ELaCELnL3F1V7K2pI46ZhZKZ3dcQ2Iea0 /VmPklvx4HVt+QsHPrZi1Lo9aIuhMYSf2a5USS1ppO/tBZTxRBVoDQCXyrSlsuD1hmIU wGnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=za8kBS25uQLzoG7Vb2z1LM/U3pBVRnouRu2RfFjt3Ig=; b=OjvgrJkxzbEv2Hs24uC0oVl6DmB8HKzcuMxpIZm9I3x6fUJBcdYGGrQRffW2b0tpln RG+5PWHB8htwqUCoLFV3pvniR0Q/+UdeB5ugKWNg0rYYQdSTY8iBXYDtJgF/HELHG6T/ 6Q2PRLZVQ4y+cChuNlx3ec/hVevUabMvOeln3LqNt40NuSlTvSDC8R/yhhi+AltFa2VY aZ9PgoGfertQY9r83SWtKEhCl3QVGojy4FRuQjavMh57FV1h/SJXvatTM2ahZP8zagAe 1XGuJ9q2QMoIcz2EmOE8bf7Xr1p+y89LWqfLs568f7JjvkJ+wrkkDF/JGxYQdouJVeNY Jwmw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si9048801edz.508.2020.06.15.06.18.01; Mon, 15 Jun 2020 06:18:25 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730263AbgFONNT (ORCPT + 99 others); Mon, 15 Jun 2020 09:13:19 -0400 Received: from foss.arm.com ([217.140.110.172]:47528 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730213AbgFONNS (ORCPT ); Mon, 15 Jun 2020 09:13:18 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 844A731B; Mon, 15 Jun 2020 06:13:17 -0700 (PDT) Received: from [10.57.9.128] (unknown [10.57.9.128]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E73B93F6CF; Mon, 15 Jun 2020 06:13:15 -0700 (PDT) Subject: Re: [RFC PATCH] serial: samsung: Re-factors UART IRQ resource for various Samsung SoC To: Tamseel Shams , kgene@kernel.org, krzk@kernel.org, gregkh@linuxfoundation.org, jslaby@suse.com Cc: linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, alim.akhtar@samsung.com, linux-arm-kernel@lists.infradead.org References: <20200615122609.71884-1-m.shams@samsung.com> From: Robin Murphy Message-ID: <027c0955-3246-8c1e-4d0d-053a2a177dc6@arm.com> Date: Mon, 15 Jun 2020 14:13:09 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200615122609.71884-1-m.shams@samsung.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-06-15 13:26, Tamseel Shams wrote: > In few older Samsung SoCs like s3c2410, s3c2412 > and s3c2440, UART IP is having 2 interrupt lines. > However, in other SoCs like s3c6400, s5pv210, > exynos5433, and exynos4210 UART is having only 1 > interrupt line. Due to this, "platform_get_irq(platdev, 1)" > call in the driver gives the following warning: > "IRQ index 1 not found" on recent platforms. > > This patch re-factors the IRQ resources handling for > each platform and hence fixing the above warnings seen > on some platforms. > > Signed-off-by: Tamseel Shams > --- > drivers/tty/serial/samsung_tty.c | 20 ++++++++++++++++---- > 1 file changed, 16 insertions(+), 4 deletions(-) > > diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c > index 6ef614d8648c..078dcb3e316f 100644 > --- a/drivers/tty/serial/samsung_tty.c > +++ b/drivers/tty/serial/samsung_tty.c > @@ -60,6 +60,7 @@ struct s3c24xx_uart_info { > char *name; > unsigned int type; > unsigned int fifosize; > + unsigned int irq_cnt; > unsigned long rx_fifomask; > unsigned long rx_fifoshift; > unsigned long rx_fifofull; > @@ -1908,12 +1909,17 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, > else { > port->irq = ret; > ourport->rx_irq = ret; > - ourport->tx_irq = ret + 1; > + if (ourport->info->irq_cnt == 1) > + ourport->tx_irq = ret; > + else > + ourport->tx_irq = ret + 1; > } > > - ret = platform_get_irq(platdev, 1); > - if (ret > 0) > - ourport->tx_irq = ret; > + if (ourport->info->irq_cnt != 1) { > + ret = platform_get_irq(platdev, 1); > + if (ret > 0) > + ourport->tx_irq = ret; FWIW, if you're not going to do anything in the error case then you may as well just call platform_get_irq_optional() unconditionally. Robin. > + } > /* > * DMA is currently supported only on DT platforms, if DMA properties > * are specified. > @@ -2387,6 +2393,7 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { > .name = "Samsung S3C2410 UART", > .type = PORT_S3C2410, > .fifosize = 16, > + .irq_cnt = 2, > .rx_fifomask = S3C2410_UFSTAT_RXMASK, > .rx_fifoshift = S3C2410_UFSTAT_RXSHIFT, > .rx_fifofull = S3C2410_UFSTAT_RXFULL, > @@ -2414,6 +2421,7 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { > .name = "Samsung S3C2412 UART", > .type = PORT_S3C2412, > .fifosize = 64, > + .irq_cnt = 2, > .has_divslot = 1, > .rx_fifomask = S3C2440_UFSTAT_RXMASK, > .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, > @@ -2443,6 +2451,7 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { > .name = "Samsung S3C2440 UART", > .type = PORT_S3C2440, > .fifosize = 64, > + .irq_cnt = 2, > .has_divslot = 1, > .rx_fifomask = S3C2440_UFSTAT_RXMASK, > .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, > @@ -2471,6 +2480,7 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { > .name = "Samsung S3C6400 UART", > .type = PORT_S3C6400, > .fifosize = 64, > + .irq_cnt = 1, > .has_divslot = 1, > .rx_fifomask = S3C2440_UFSTAT_RXMASK, > .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, > @@ -2498,6 +2508,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { > .info = &(struct s3c24xx_uart_info) { > .name = "Samsung S5PV210 UART", > .type = PORT_S3C6400, > + .irq_cnt = 1, > .has_divslot = 1, > .rx_fifomask = S5PV210_UFSTAT_RXMASK, > .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, > @@ -2526,6 +2537,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { > .info = &(struct s3c24xx_uart_info) { \ > .name = "Samsung Exynos UART", \ > .type = PORT_S3C6400, \ > + .irq_cnt = 1, \ > .has_divslot = 1, \ > .rx_fifomask = S5PV210_UFSTAT_RXMASK, \ > .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, \ >