diff mbox

FSP/CONSOLE: Do not enable input irq in write path

Message ID 20170601154353.9208-1-hegdevasant@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Vasant Hegde June 1, 2017, 3:43 p.m. UTC
We use irq for reading input from console, but not in output path.
Hence do not enable input irq in write path.

Fixes : 583c8203 (fsp/console: Allocate irq for each hvc console)
CC: Sam Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hw/fsp/fsp-console.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Sam Mendoza-Jonas July 21, 2017, 4:21 a.m. UTC | #1
On Thu, 2017-06-01 at 21:13 +0530, Vasant Hegde wrote:
> We use irq for reading input from console, but not in output path.
> Hence do not enable input irq in write path.
> 
> Fixes : 583c8203 (fsp/console: Allocate irq for each hvc console)
> CC: Sam Mendoza-Jonas <sam@mendozajonas.com>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

As encountered by Stewart, fixes a soft-lockup on ZZ with a 4.12.1
kernel.

Acked-By: Samuel Mendoza-Jonas <sam@mendozajonas.com> 

> ---
>  hw/fsp/fsp-console.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/hw/fsp/fsp-console.c b/hw/fsp/fsp-console.c
> index 8eaf7b8..fd67b20 100644
> --- a/hw/fsp/fsp-console.c
> +++ b/hw/fsp/fsp-console.c
> @@ -193,7 +193,6 @@ static size_t fsp_write_vserial(struct fsp_serial *fs, const char *buf,
>  #ifndef DISABLE_CON_PENDING_EVT
>  	opal_update_pending_evt(OPAL_EVENT_CONSOLE_OUTPUT,
>  				OPAL_EVENT_CONSOLE_OUTPUT);
> -	opal_update_pending_evt(fs->irq, fs->irq);
>  #endif
>  	return len;
>  }
> @@ -746,12 +745,10 @@ void fsp_console_poll(void *data __unused)
>  			if (!fs->open)
>  				continue;
>  			if (sb->next_out == sb->next_in) {
> -				opal_update_pending_evt(fs->irq, 0);
>  				continue;
>  			}
>  			if (fs->log_port) {
>  				flush_console();
> -				opal_update_pending_evt(fs->irq, 0);
>  			} else {
>  #ifdef OPAL_DEBUG_CONSOLE_POLL
>  				if (debug < 5) {
Stewart Smith July 25, 2017, 8:18 a.m. UTC | #2
Vasant Hegde <hegdevasant@linux.vnet.ibm.com> writes:
> We use irq for reading input from console, but not in output path.
> Hence do not enable input irq in write path.
>
> Fixes : 583c8203 (fsp/console: Allocate irq for each hvc console)
> CC: Sam Mendoza-Jonas <sam@mendozajonas.com>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

Thanks, merged to master as of 72aa080d0970f7757ccf4f3b00096f2f8bbcafde.

I also now have a test case that seems independent of skiboot version,
where you can get a soft lockup in kopald on recent kernels.. This seems
to be limited to when you exit petitboot and go for a fast reboot
*really* soon after booting. I can usually reproduce within 5
fast-reboots, but sometimes takes as much as 10.

I'm pretty convinced that this is a kernel issue.. or at least not a
*regression* on the skiboot side since our service pack stream.

So, I think we should get to the bottom of that before I necessarily
backport this fix to 5.4.x?

Ideally, it's probably about time some time is spent on getting that
giant test matrix for these things automated....
diff mbox

Patch

diff --git a/hw/fsp/fsp-console.c b/hw/fsp/fsp-console.c
index 8eaf7b8..fd67b20 100644
--- a/hw/fsp/fsp-console.c
+++ b/hw/fsp/fsp-console.c
@@ -193,7 +193,6 @@  static size_t fsp_write_vserial(struct fsp_serial *fs, const char *buf,
 #ifndef DISABLE_CON_PENDING_EVT
 	opal_update_pending_evt(OPAL_EVENT_CONSOLE_OUTPUT,
 				OPAL_EVENT_CONSOLE_OUTPUT);
-	opal_update_pending_evt(fs->irq, fs->irq);
 #endif
 	return len;
 }
@@ -746,12 +745,10 @@  void fsp_console_poll(void *data __unused)
 			if (!fs->open)
 				continue;
 			if (sb->next_out == sb->next_in) {
-				opal_update_pending_evt(fs->irq, 0);
 				continue;
 			}
 			if (fs->log_port) {
 				flush_console();
-				opal_update_pending_evt(fs->irq, 0);
 			} else {
 #ifdef OPAL_DEBUG_CONSOLE_POLL
 				if (debug < 5) {