* [PATCH 0/2] serial: 8250_dw: fall back to poll if there's no interrupt @ 2023-08-02 15:05 Jisheng Zhang 2023-08-02 15:05 ` [PATCH 1/2] dt-bindings: serial: snps-dw-apb-uart: make interrupt optional Jisheng Zhang 2023-08-02 15:05 ` [PATCH 2/2] serial: 8250_dw: fall back to poll if there's no interrupt Jisheng Zhang 0 siblings, 2 replies; 9+ messages in thread From: Jisheng Zhang @ 2023-08-02 15:05 UTC (permalink / raw) To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ilpo Järvinen, Andy Shevchenko, Jiri Slaby Cc: linux-serial, devicetree, linux-kernel When there's no irq(this can be due to various reasons, for example, no irq from HW support, or we just want to use poll solution, and so on), falling back to poll is still better than no support at all. patch1 makes the interrupt property in dt-binding optional patch2 falls back to poll if there's no interrupt Jisheng Zhang (2): dt-bindings: serial: snps-dw-apb-uart: make interrupt optional serial: 8250_dw: fall back to poll if there's no interrupt .../devicetree/bindings/serial/snps-dw-apb-uart.yaml | 1 - drivers/tty/serial/8250/8250_dw.c | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) -- 2.40.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] dt-bindings: serial: snps-dw-apb-uart: make interrupt optional 2023-08-02 15:05 [PATCH 0/2] serial: 8250_dw: fall back to poll if there's no interrupt Jisheng Zhang @ 2023-08-02 15:05 ` Jisheng Zhang 2023-08-02 15:43 ` Conor Dooley 2023-08-02 15:05 ` [PATCH 2/2] serial: 8250_dw: fall back to poll if there's no interrupt Jisheng Zhang 1 sibling, 1 reply; 9+ messages in thread From: Jisheng Zhang @ 2023-08-02 15:05 UTC (permalink / raw) To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ilpo Järvinen, Andy Shevchenko, Jiri Slaby Cc: linux-serial, devicetree, linux-kernel The driver fall back to poll style when there's no irq. "poll" still looks better than no support. Signed-off-by: Jisheng Zhang <jszhang@kernel.org> --- Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml b/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml index 3862411c77b5..17c553123f96 100644 --- a/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml +++ b/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml @@ -117,7 +117,6 @@ properties: required: - compatible - reg - - interrupts unevaluatedProperties: false -- 2.40.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] dt-bindings: serial: snps-dw-apb-uart: make interrupt optional 2023-08-02 15:05 ` [PATCH 1/2] dt-bindings: serial: snps-dw-apb-uart: make interrupt optional Jisheng Zhang @ 2023-08-02 15:43 ` Conor Dooley 2023-08-02 21:57 ` Andy Shevchenko 0 siblings, 1 reply; 9+ messages in thread From: Conor Dooley @ 2023-08-02 15:43 UTC (permalink / raw) To: Jisheng Zhang Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ilpo Järvinen, Andy Shevchenko, Jiri Slaby, linux-serial, devicetree, linux-kernel [-- Attachment #1: Type: text/plain, Size: 932 bytes --] On Wed, Aug 02, 2023 at 11:05:44PM +0800, Jisheng Zhang wrote: > The driver fall back to poll style when there's no irq. "poll" still > looks better than no support. What is the user for this where the interrupt is not actually wired up in the hardware? > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > --- > Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml b/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml > index 3862411c77b5..17c553123f96 100644 > --- a/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml > +++ b/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml > @@ -117,7 +117,6 @@ properties: > required: > - compatible > - reg > - - interrupts > > unevaluatedProperties: false > > -- > 2.40.1 > [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] dt-bindings: serial: snps-dw-apb-uart: make interrupt optional 2023-08-02 15:43 ` Conor Dooley @ 2023-08-02 21:57 ` Andy Shevchenko 2023-08-02 22:53 ` Conor Dooley 0 siblings, 1 reply; 9+ messages in thread From: Andy Shevchenko @ 2023-08-02 21:57 UTC (permalink / raw) To: Conor Dooley Cc: Jisheng Zhang, Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ilpo Järvinen, Jiri Slaby, linux-serial, devicetree, linux-kernel On Wed, Aug 02, 2023 at 04:43:48PM +0100, Conor Dooley wrote: > On Wed, Aug 02, 2023 at 11:05:44PM +0800, Jisheng Zhang wrote: > > The driver fall back to poll style when there's no irq. "poll" still > > looks better than no support. > > What is the user for this where the interrupt is not actually wired up > in the hardware? FYI: kernel console doesn't use interrupts, so for example it might be the debug port. Note, I have no idea of the Zhang's case, just my assumption. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] dt-bindings: serial: snps-dw-apb-uart: make interrupt optional 2023-08-02 21:57 ` Andy Shevchenko @ 2023-08-02 22:53 ` Conor Dooley 2023-08-03 11:40 ` Andy Shevchenko 0 siblings, 1 reply; 9+ messages in thread From: Conor Dooley @ 2023-08-02 22:53 UTC (permalink / raw) To: Andy Shevchenko Cc: Jisheng Zhang, Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ilpo Järvinen, Jiri Slaby, linux-serial, devicetree, linux-kernel [-- Attachment #1: Type: text/plain, Size: 717 bytes --] On Thu, Aug 03, 2023 at 12:57:44AM +0300, Andy Shevchenko wrote: > On Wed, Aug 02, 2023 at 04:43:48PM +0100, Conor Dooley wrote: > > On Wed, Aug 02, 2023 at 11:05:44PM +0800, Jisheng Zhang wrote: > > > The driver fall back to poll style when there's no irq. "poll" still > > > looks better than no support. > > > > What is the user for this where the interrupt is not actually wired up > > in the hardware? > > FYI: kernel console doesn't use interrupts, so for example it might be > the debug port. Note, I have no idea of the Zhang's case, just my assumption. I'm less interested in what the software is doing, it's what the device that has not connected the interrupt is that I am curious about. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] dt-bindings: serial: snps-dw-apb-uart: make interrupt optional 2023-08-02 22:53 ` Conor Dooley @ 2023-08-03 11:40 ` Andy Shevchenko 2023-08-06 9:40 ` Jisheng Zhang 0 siblings, 1 reply; 9+ messages in thread From: Andy Shevchenko @ 2023-08-03 11:40 UTC (permalink / raw) To: Conor Dooley Cc: Jisheng Zhang, Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ilpo Järvinen, Jiri Slaby, linux-serial, devicetree, linux-kernel On Wed, Aug 02, 2023 at 11:53:59PM +0100, Conor Dooley wrote: > On Thu, Aug 03, 2023 at 12:57:44AM +0300, Andy Shevchenko wrote: > > On Wed, Aug 02, 2023 at 04:43:48PM +0100, Conor Dooley wrote: > > > On Wed, Aug 02, 2023 at 11:05:44PM +0800, Jisheng Zhang wrote: > > > > The driver fall back to poll style when there's no irq. "poll" still > > > > looks better than no support. > > > > > > What is the user for this where the interrupt is not actually wired up > > > in the hardware? > > > > FYI: kernel console doesn't use interrupts, so for example it might be > > the debug port. Note, I have no idea of the Zhang's case, just my assumption. > > I'm less interested in what the software is doing, it's what the device > that has not connected the interrupt is that I am curious about. As I said. The hw may be purely for debugging purposes (and yes, I have heard about such a hardware). -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] dt-bindings: serial: snps-dw-apb-uart: make interrupt optional 2023-08-03 11:40 ` Andy Shevchenko @ 2023-08-06 9:40 ` Jisheng Zhang 0 siblings, 0 replies; 9+ messages in thread From: Jisheng Zhang @ 2023-08-06 9:40 UTC (permalink / raw) To: Andy Shevchenko Cc: Conor Dooley, Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ilpo Järvinen, Jiri Slaby, linux-serial, devicetree, linux-kernel On Thu, Aug 03, 2023 at 02:40:05PM +0300, Andy Shevchenko wrote: > On Wed, Aug 02, 2023 at 11:53:59PM +0100, Conor Dooley wrote: > > On Thu, Aug 03, 2023 at 12:57:44AM +0300, Andy Shevchenko wrote: > > > On Wed, Aug 02, 2023 at 04:43:48PM +0100, Conor Dooley wrote: > > > > On Wed, Aug 02, 2023 at 11:05:44PM +0800, Jisheng Zhang wrote: > > > > > The driver fall back to poll style when there's no irq. "poll" still > > > > > looks better than no support. > > > > > > > > What is the user for this where the interrupt is not actually wired up > > > > in the hardware? > > > > > > FYI: kernel console doesn't use interrupts, so for example it might be > > > the debug port. Note, I have no idea of the Zhang's case, just my assumption. Hi Conor, Andy, Andy's assumption about the uart dedicated for debug purpose is true, since it's for log only, so no interrupt need at all. We can also see such no irq support in litex uart driver(liteuart.c) and even a 8250 variant(8250_ioc3.c). Thanks > > > > I'm less interested in what the software is doing, it's what the device > > that has not connected the interrupt is that I am curious about. > > As I said. The hw may be purely for debugging purposes (and yes, I have heard > about such a hardware). > > -- > With Best Regards, > Andy Shevchenko > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/2] serial: 8250_dw: fall back to poll if there's no interrupt 2023-08-02 15:05 [PATCH 0/2] serial: 8250_dw: fall back to poll if there's no interrupt Jisheng Zhang 2023-08-02 15:05 ` [PATCH 1/2] dt-bindings: serial: snps-dw-apb-uart: make interrupt optional Jisheng Zhang @ 2023-08-02 15:05 ` Jisheng Zhang 2023-08-02 21:56 ` Andy Shevchenko 1 sibling, 1 reply; 9+ messages in thread From: Jisheng Zhang @ 2023-08-02 15:05 UTC (permalink / raw) To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ilpo Järvinen, Andy Shevchenko, Jiri Slaby Cc: linux-serial, devicetree, linux-kernel When there's no irq(this can be due to various reasons, for example, no irq from HW support, or we just want to use poll solution, and so on), falling back to poll is still better than no support at all. Signed-off-by: Jisheng Zhang <jszhang@kernel.org> --- drivers/tty/serial/8250/8250_dw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 7db51781289e..39db768517eb 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -524,8 +524,12 @@ static int dw8250_probe(struct platform_device *pdev) return dev_err_probe(dev, -EINVAL, "no registers defined\n"); irq = platform_get_irq(pdev, 0); - if (irq < 0) - return irq; + if (irq < 0) { + if (irq != -ENXIO) + return irq; + /* no interrupt -> fall back to polling */ + irq = 0; + } spin_lock_init(&p->lock); p->mapbase = regs->start; -- 2.40.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] serial: 8250_dw: fall back to poll if there's no interrupt 2023-08-02 15:05 ` [PATCH 2/2] serial: 8250_dw: fall back to poll if there's no interrupt Jisheng Zhang @ 2023-08-02 21:56 ` Andy Shevchenko 0 siblings, 0 replies; 9+ messages in thread From: Andy Shevchenko @ 2023-08-02 21:56 UTC (permalink / raw) To: Jisheng Zhang Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ilpo Järvinen, Jiri Slaby, linux-serial, devicetree, linux-kernel On Wed, Aug 02, 2023 at 11:05:45PM +0800, Jisheng Zhang wrote: > When there's no irq(this can be due to various reasons, for example, > no irq from HW support, or we just want to use poll solution, and so > on), falling back to poll is still better than no support at all. ... > irq = platform_get_irq(pdev, 0); You will still have an error message. Perhaps you need to replace it with irq = platform_get_irq_optional(pdev, 0); > - if (irq < 0) > - return irq; > + if (irq < 0) { > + if (irq != -ENXIO) > + return irq; > + /* no interrupt -> fall back to polling */ > + irq = 0; > + } This can be slightly modified: /* no interrupt -> fall back to polling */ if (irq == -ENXIO) irq = 0; if (irq < 0) return irq; -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-08-06 9:52 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-08-02 15:05 [PATCH 0/2] serial: 8250_dw: fall back to poll if there's no interrupt Jisheng Zhang 2023-08-02 15:05 ` [PATCH 1/2] dt-bindings: serial: snps-dw-apb-uart: make interrupt optional Jisheng Zhang 2023-08-02 15:43 ` Conor Dooley 2023-08-02 21:57 ` Andy Shevchenko 2023-08-02 22:53 ` Conor Dooley 2023-08-03 11:40 ` Andy Shevchenko 2023-08-06 9:40 ` Jisheng Zhang 2023-08-02 15:05 ` [PATCH 2/2] serial: 8250_dw: fall back to poll if there's no interrupt Jisheng Zhang 2023-08-02 21:56 ` Andy Shevchenko
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).