diff mbox series

[1/3] um: Monitor error events in IRQ controller

Message ID 20201207171940.25240-1-anton.ivanov@cambridgegreys.com
State Accepted
Headers show
Series [1/3] um: Monitor error events in IRQ controller | expand

Commit Message

Anton Ivanov Dec. 7, 2020, 5:19 p.m. UTC
From: Anton Ivanov <anton.ivanov@cambridgegreys.com>

Ensure that file closes, connection closes, etc are propagated
as interrupts in the interrupt controller.

Fixes: ff6a17989c08 ("Epoll based IRQ controller")
Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
---
 arch/um/os-Linux/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Johannes Berg Dec. 7, 2020, 5:35 p.m. UTC | #1
On Mon, 2020-12-07 at 17:19 +0000, anton.ivanov@cambridgegreys.com
wrote:
> From: Anton Ivanov <anton.ivanov@cambridgegreys.com>
> 
> Ensure that file closes, connection closes, etc are propagated
> as interrupts in the interrupt controller.
> 
> Fixes: ff6a17989c08 ("Epoll based IRQ controller")
> Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
> ---
>  arch/um/os-Linux/irq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c
> index d508310ee5e1..f1732c308c61 100644
> --- a/arch/um/os-Linux/irq.c
> +++ b/arch/um/os-Linux/irq.c
> @@ -48,7 +48,7 @@ int os_epoll_triggered(int index, int events)
>  int os_event_mask(int irq_type)
>  {
>  	if (irq_type == IRQ_READ)
> -		return EPOLLIN | EPOLLPRI;
> +		return EPOLLIN | EPOLLPRI | EPOLLERR | EPOLLHUP | EPOLLRDHUP;
>  	if (irq_type == IRQ_WRITE)
>  		return EPOLLOUT;

Why not monitor it also for write?

johannes
Anton Ivanov Dec. 7, 2020, 6:11 p.m. UTC | #2
On 07/12/2020 17:35, Johannes Berg wrote:
> On Mon, 2020-12-07 at 17:19 +0000, anton.ivanov@cambridgegreys.com
> wrote:
>> From: Anton Ivanov <anton.ivanov@cambridgegreys.com>
>>
>> Ensure that file closes, connection closes, etc are propagated
>> as interrupts in the interrupt controller.
>>
>> Fixes: ff6a17989c08 ("Epoll based IRQ controller")
>> Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
>> ---
>>   arch/um/os-Linux/irq.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c
>> index d508310ee5e1..f1732c308c61 100644
>> --- a/arch/um/os-Linux/irq.c
>> +++ b/arch/um/os-Linux/irq.c
>> @@ -48,7 +48,7 @@ int os_epoll_triggered(int index, int events)
>>   int os_event_mask(int irq_type)
>>   {
>>   	if (irq_type == IRQ_READ)
>> -		return EPOLLIN | EPOLLPRI;
>> +		return EPOLLIN | EPOLLPRI | EPOLLERR | EPOLLHUP | EPOLLRDHUP;
>>   	if (irq_type == IRQ_WRITE)
>>   		return EPOLLOUT;
> 
> Why not monitor it also for write?

The write code in most drivers has no error checking and no close upon 
error.

I will have to go through them and ensure they behave correctly first.

So - yes, it's a good idea and we will add it later, once I have 
double-checked all drivers.

> 
> johannes
> 
> 
> _______________________________________________
> linux-um mailing list
> linux-um@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-um
>
Anton Ivanov Dec. 9, 2020, 5:49 p.m. UTC | #3
On 07/12/2020 18:11, Anton Ivanov wrote:
> On 07/12/2020 17:35, Johannes Berg wrote:
>> On Mon, 2020-12-07 at 17:19 +0000, anton.ivanov@cambridgegreys.com
>> wrote:
>>> From: Anton Ivanov <anton.ivanov@cambridgegreys.com>
>>>
>>> Ensure that file closes, connection closes, etc are propagated
>>> as interrupts in the interrupt controller.
>>>
>>> Fixes: ff6a17989c08 ("Epoll based IRQ controller")
>>> Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
>>> ---
>>>   arch/um/os-Linux/irq.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c
>>> index d508310ee5e1..f1732c308c61 100644
>>> --- a/arch/um/os-Linux/irq.c
>>> +++ b/arch/um/os-Linux/irq.c
>>> @@ -48,7 +48,7 @@ int os_epoll_triggered(int index, int events)
>>>   int os_event_mask(int irq_type)
>>>   {
>>>       if (irq_type == IRQ_READ)
>>> -        return EPOLLIN | EPOLLPRI;
>>> +        return EPOLLIN | EPOLLPRI | EPOLLERR | EPOLLHUP | EPOLLRDHUP;
>>>       if (irq_type == IRQ_WRITE)
>>>           return EPOLLOUT;
>>
>> Why not monitor it also for write?
>
> The write code in most drivers has no error checking and no close upon 
> error.
>
> I will have to go through them and ensure they behave correctly first.
>
> So - yes, it's a good idea and we will add it later, once I have 
> double-checked all drivers.

I have a couple of further clean-up patches to follow, but they need 
both your series and my series to go in first.

They are mostly cosmetic - ensuring correct behavior on epoll errors and 
suppressing messages for conditions which are not really errors, but 
"business as usual".

A.

>
>>
>> johannes
>>
>>
>> _______________________________________________
>> linux-um mailing list
>> linux-um@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-um
>>
>
>
diff mbox series

Patch

diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c
index d508310ee5e1..f1732c308c61 100644
--- a/arch/um/os-Linux/irq.c
+++ b/arch/um/os-Linux/irq.c
@@ -48,7 +48,7 @@  int os_epoll_triggered(int index, int events)
 int os_event_mask(int irq_type)
 {
 	if (irq_type == IRQ_READ)
-		return EPOLLIN | EPOLLPRI;
+		return EPOLLIN | EPOLLPRI | EPOLLERR | EPOLLHUP | EPOLLRDHUP;
 	if (irq_type == IRQ_WRITE)
 		return EPOLLOUT;
 	return 0;