mbim driver: call the release function in case MBIM OPEN fails
PATCH 1/1 mbim driver: call the release function in case MBIM OPEN fails
--- drivers/mbimmodem/mbim.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mbimmodem/mbim.c +3 -0
@@ -781,6 +781,9 @@ static bool open_read_handler(struct l_io *io, void *user_data)/* Grab OPEN_DONE Status field */ if (l_get_le32 (buf) !=0 ) {close (fd); +if (device->disconnect_handler) + device->disconnect_handler (device->ready_data); + device->is_ready = false;return false; }
Signature · 1 line
1.9.1
Hi Giacinto,
An actual description of what is happening would be helpful
Quoted 9 lines · Giacinto Cifelli
--- drivers/mbimmodem/mbim.c | 3 +++ 1 file changed, 3 insertions(+)drivers/mbimmodem/mbim.c +0
-0
drivers/mbimmodem/mbim.c static bool open_read_handler(struct l_io *io, void *user_data) · line 786
Quoted 6 lines
drivers/mbimmodem/mbim.c +3
-0@@ -781,6 +781,9 @@ static bool open_read_handler(struct l_io *io, void *user_data)/* Grab OPEN_DONE Status field */ if (l_get_le32 (buf) !=0 ) {close (fd); +if (device->disconnect_handler) + device->disconnect_handler (device->ready_data); + device->is_ready = false;
I don't get this part. So device->is_ready = false assignment is pointless. It is already false.
Also, aren't we going to call device->disconnect_handler anyway by virtue of closing the fd? l_io_set_disconnect_handler which we set in mbim_device_new should already be taking care of this.
Regards,
-Denis
Hi Denis,
Quoted 9 lines · Denis Kenzior
Hi Giacinto,
An actual description of what is happening would be helpful
Quoted 4 lines · Giacinto Cifelli
--- drivers/mbimmodem/mbim.c | 3 +++ 1 file changed, 3 insertions(+)
Quoted 15 lines
drivers/mbimmodem/mbim.c static bool open_read_handler(struct l_io *io, void
Quoted 5 lines
drivers/mbimmodem/mbim.c +0
-0@@ -781,6 +781,9 @@ static bool open_read_handler(struct l_io *io, void
*user_data)Quoted 6 lines
drivers/mbimmodem/mbim.c +3
-0/* Grab OPEN_DONE Status field */ if (l_get_le32 (buf) !=0 ) {close (fd); +if (device->disconnect_handler) + device->disconnect_handler (device->ready_data); + device->is_ready = false
I don't get this part. So device->is_ready = false assignment is
Quoted 7 lines
pointless. It is already false.
Also, aren't we going to call
device->disconnect_handleranyway by virtue of closing the fd?l_io_set_disconnect_handlerwhich we set inmbim_device_newshould already be taking care of this.
I will check about the is_ready false, but definitely the disconnect_handler is not called, I can tell you,
because on a special condition I have received a OPEN DONE with failure, and the driver remained hanging.
However, after calling it, there is a second call to disconnect_handler, but not if it is not done here.
Maybe the code should be verified somewhere else? Any other suggestions?
Regards,
Quoted 2 lines
-Denis
Regards,
Giacinto
Hi Giacinto,
Quoted 7 lines
I will check about the
is_readyfalse, but definitely thedisconnect_handleris not called, I can tell you,
because on a special condition I have received a OPEN DONE with failure, and the driver remained hanging.
However, after calling it, there is a second call todisconnect_handler, but not if it is not done here.
Maybe the code should be verified somewhere else? Any other suggestions?
Okay, I played with this a bit and indeed there was an issue. It should be fixed in ell upstream now.
See commit 0294175cff974ae9aae93e3609c5f6502db410ee.
Regards,
-Denis
Hi Denis,
Quoted 10 lines · Denis Kenzior
Hi Giacinto,
Quoted 7 lines
I will check about the
is_readyfalse, but definitely thedisconnect_handleris not called, I can tell you,
because on a special condition I have received a OPEN DONE with failure, and the driver remained hanging.
However, after calling it, there is a second call todisconnect_handler, but not if it is not done here.
Maybe the code should be verified somewhere else? Any other suggestions?
Quoted 5 lines
Okay, I played with this a bit and indeed there was an issue. It should be fixed in ell upstream now.
See commit
0294175cff974ae9aae93e3609c5f6502db410ee.
It works with this ell patch, and the disconnect_handler is called once. Thank you very much.
Quoted 4 lines
Regards,
-Denis
Regards,
Giacinto