* [PATCH v3] serial: samsung: Re-factors UART IRQ resource for various Samsung SoC [not found] <CGME20200704142658epcas5p254ae909fedb07dda58cece5d6d5252b4@epcas5p2.samsung.com> @ 2020-07-04 14:06 ` Tamseel Shams 2020-07-06 8:13 ` Krzysztof Kozlowski 0 siblings, 1 reply; 3+ messages in thread From: Tamseel Shams @ 2020-07-04 14:06 UTC (permalink / raw) To: kgene, krzk, gregkh, jslaby Cc: linux-arm-kernel, linux-samsung-soc, linux-serial, linux-kernel, alim.akhtar, Tamseel Shams 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 <m.shams@samsung.com> --- Removed the logic of irq_cnt and directly using s3c24xx_serial_has_interrupt_mask() to check for number of interrupt lines. drivers/tty/serial/samsung_tty.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 6ef614d8648c..8a955f3d8975 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -1908,10 +1908,13 @@ 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 (s3c24xx_serial_has_interrupt_mask(port)) + ourport->tx_irq = ret; + else + ourport->tx_irq = ret + 1; } - ret = platform_get_irq(platdev, 1); + ret = platform_get_irq_optional(platdev, 1); if (ret > 0) ourport->tx_irq = ret; /* -- 2.17.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] serial: samsung: Re-factors UART IRQ resource for various Samsung SoC 2020-07-04 14:06 ` [PATCH v3] serial: samsung: Re-factors UART IRQ resource for various Samsung SoC Tamseel Shams @ 2020-07-06 8:13 ` Krzysztof Kozlowski 2020-07-13 14:03 ` M Tamseel Shams 0 siblings, 1 reply; 3+ messages in thread From: Krzysztof Kozlowski @ 2020-07-06 8:13 UTC (permalink / raw) To: Tamseel Shams Cc: kgene, gregkh, jslaby, linux-arm-kernel, linux-samsung-soc, linux-serial, linux-kernel, alim.akhtar On Sat, Jul 04, 2020 at 07:36:46PM +0530, 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 <m.shams@samsung.com> > --- > Removed the logic of irq_cnt and directly using > s3c24xx_serial_has_interrupt_mask() to check for > number of interrupt lines. > > drivers/tty/serial/samsung_tty.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c > index 6ef614d8648c..8a955f3d8975 100644 > --- a/drivers/tty/serial/samsung_tty.c > +++ b/drivers/tty/serial/samsung_tty.c > @@ -1908,10 +1908,13 @@ 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 (s3c24xx_serial_has_interrupt_mask(port)) > + ourport->tx_irq = ret; Hi, I don't understand: Why do you assign here the same interrupt as RX? Best regards, Krzysztof > + else > + ourport->tx_irq = ret + 1; > } > > - ret = platform_get_irq(platdev, 1); > + ret = platform_get_irq_optional(platdev, 1); > if (ret > 0) > ourport->tx_irq = ret; > /* > -- > 2.17.1 > ^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH v3] serial: samsung: Re-factors UART IRQ resource for various Samsung SoC 2020-07-06 8:13 ` Krzysztof Kozlowski @ 2020-07-13 14:03 ` M Tamseel Shams 0 siblings, 0 replies; 3+ messages in thread From: M Tamseel Shams @ 2020-07-13 14:03 UTC (permalink / raw) To: 'Krzysztof Kozlowski' Cc: kgene, gregkh, jslaby, linux-arm-kernel, linux-samsung-soc, linux-serial, linux-kernel, alim.akhtar > > 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 <m.shams@samsung.com> > > --- > > Removed the logic of irq_cnt and directly using > > s3c24xx_serial_has_interrupt_mask() to check for number of interrupt > > lines. > > > > drivers/tty/serial/samsung_tty.c | 7 +++++-- > > 1 file changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/tty/serial/samsung_tty.c > > b/drivers/tty/serial/samsung_tty.c > > index 6ef614d8648c..8a955f3d8975 100644 > > --- a/drivers/tty/serial/samsung_tty.c > > +++ b/drivers/tty/serial/samsung_tty.c > > @@ -1908,10 +1908,13 @@ 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 (s3c24xx_serial_has_interrupt_mask(port)) > > + ourport->tx_irq = ret; > > Hi, > > I don't understand: Why do you assign here the same interrupt as RX? > > Best regards, > Krzysztof > Hi Krzysztof, I was assigning the same interrupt to Tx and Rx for UART, which have one interrupt line, but ourport->tx_irq is never used for those UART's. So, leaving it as it was. The change now is using platform_get_irq_optional () instead of platform_get_irq () to avoid false-positive error. Thanks & Regards, Tamseel ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-07-14 0:57 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <CGME20200704142658epcas5p254ae909fedb07dda58cece5d6d5252b4@epcas5p2.samsung.com> 2020-07-04 14:06 ` [PATCH v3] serial: samsung: Re-factors UART IRQ resource for various Samsung SoC Tamseel Shams 2020-07-06 8:13 ` Krzysztof Kozlowski 2020-07-13 14:03 ` M Tamseel Shams
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).