* [PATCH] media: dvb_ca_en50221: Fix a bug for detecting CI MODULE
@ 2024-03-08 12:10 yongsuyoo0215
2024-04-11 12:03 ` YongSu Yoo
2024-05-01 16:25 ` Markus Elfring
0 siblings, 2 replies; 6+ messages in thread
From: yongsuyoo0215 @ 2024-03-08 12:10 UTC (permalink / raw)
To: mchehab, yongsuyoo0215, v4bel, linux-media, linux-kernel
From: Yongsu yoo <yongsuyoo0215@gmail.com>
Signed-off-by:Yongsu Yoo <yongsuyoo0215@gmail.com>
In source/drivers/media/dvb-core/dvb_ca_en50221.c, if the CA_RESET
ioctl is called, the dvb_ca_en50221_slot_shutdown will also be called.
Inside of the dvb_ca_en50221_slot_shutdown,
the ca->slot_info[slot].slot_state will become DVB_CA_SLOTSTATE_NONE.
In the most of cases, the ca->slot_info[slot].slot_state will quickly
becomes restored to other states by the subsequent operations of the
thread dvb_ca_en50221_thread_state_machine.
But in some rare cases, when the CA_GET_SLOT_INFO ioctl is immediately
called after the CA_RESET ioctl is called, the
the ca->slot_info[slot].slot_state can still remains at
DVB_CA_SLOTSTATE_NONE, and this causes CA_GET_SLOT_INFO ioctl not to
return CA_CI_MODULE_PRESENT as info->flags even if CA_CI_MODULE is
really connected on TV. This means that the CA_GET_SLOT_INFO ioctl
does not return right informtion. This is a Bug. We fix this bug.
---
drivers/media/dvb-core/dvb_ca_en50221.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
index baf64540dc00..8d37c3c13227 100644
--- a/drivers/media/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb-core/dvb_ca_en50221.c
@@ -1403,6 +1403,10 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file,
(sl->slot_state != DVB_CA_SLOTSTATE_INVALID)) {
info->flags = CA_CI_MODULE_PRESENT;
}
+ if ((sl->slot_state == DVB_CA_SLOTSTATE_NONE) &&
+ (sl->camchange_type == DVB_CA_EN50221_CAMCHANGE_INSERTED)) {
+ info->flags = CA_CI_MODULE_PRESENT;
+ }
if (sl->slot_state == DVB_CA_SLOTSTATE_RUNNING)
info->flags |= CA_CI_MODULE_READY;
break;
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] media: dvb_ca_en50221: Fix a bug for detecting CI MODULE
2024-03-08 12:10 [PATCH] media: dvb_ca_en50221: Fix a bug for detecting CI MODULE yongsuyoo0215
@ 2024-04-11 12:03 ` YongSu Yoo
2024-05-01 7:54 ` YongSu Yoo
2024-05-01 16:25 ` Markus Elfring
1 sibling, 1 reply; 6+ messages in thread
From: YongSu Yoo @ 2024-04-11 12:03 UTC (permalink / raw)
To: mchehab, yongsuyoo0215, v4bel, linux-media, linux-kernel
Dear All
Can you review this patch ?
Can you share how this modification is going ?
2024년 3월 8일 (금) 오후 9:10, <yongsuyoo0215@gmail.com>님이 작성:
>
> From: Yongsu yoo <yongsuyoo0215@gmail.com>
>
> Signed-off-by:Yongsu Yoo <yongsuyoo0215@gmail.com>
>
> In source/drivers/media/dvb-core/dvb_ca_en50221.c, if the CA_RESET
> ioctl is called, the dvb_ca_en50221_slot_shutdown will also be called.
> Inside of the dvb_ca_en50221_slot_shutdown,
> the ca->slot_info[slot].slot_state will become DVB_CA_SLOTSTATE_NONE.
> In the most of cases, the ca->slot_info[slot].slot_state will quickly
> becomes restored to other states by the subsequent operations of the
> thread dvb_ca_en50221_thread_state_machine.
> But in some rare cases, when the CA_GET_SLOT_INFO ioctl is immediately
> called after the CA_RESET ioctl is called, the
> the ca->slot_info[slot].slot_state can still remains at
> DVB_CA_SLOTSTATE_NONE, and this causes CA_GET_SLOT_INFO ioctl not to
> return CA_CI_MODULE_PRESENT as info->flags even if CA_CI_MODULE is
> really connected on TV. This means that the CA_GET_SLOT_INFO ioctl
> does not return right informtion. This is a Bug. We fix this bug.
> ---
> drivers/media/dvb-core/dvb_ca_en50221.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
> index baf64540dc00..8d37c3c13227 100644
> --- a/drivers/media/dvb-core/dvb_ca_en50221.c
> +++ b/drivers/media/dvb-core/dvb_ca_en50221.c
> @@ -1403,6 +1403,10 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file,
> (sl->slot_state != DVB_CA_SLOTSTATE_INVALID)) {
> info->flags = CA_CI_MODULE_PRESENT;
> }
> + if ((sl->slot_state == DVB_CA_SLOTSTATE_NONE) &&
> + (sl->camchange_type == DVB_CA_EN50221_CAMCHANGE_INSERTED)) {
> + info->flags = CA_CI_MODULE_PRESENT;
> + }
> if (sl->slot_state == DVB_CA_SLOTSTATE_RUNNING)
> info->flags |= CA_CI_MODULE_READY;
> break;
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] media: dvb_ca_en50221: Fix a bug for detecting CI MODULE
2024-04-11 12:03 ` YongSu Yoo
@ 2024-05-01 7:54 ` YongSu Yoo
0 siblings, 0 replies; 6+ messages in thread
From: YongSu Yoo @ 2024-05-01 7:54 UTC (permalink / raw)
To: mchehab, yongsuyoo0215, v4bel, linux-media, linux-kernel
Dear All
Can you review this patch ?
Can you share how this is going ?
2024년 4월 11일 (목) 오후 9:03, YongSu Yoo <yongsuyoo0215@gmail.com>님이 작성:
>
> Dear All
>
> Can you review this patch ?
> Can you share how this modification is going ?
>
> 2024년 3월 8일 (금) 오후 9:10, <yongsuyoo0215@gmail.com>님이 작성:
> >
> > From: Yongsu yoo <yongsuyoo0215@gmail.com>
> >
> > Signed-off-by:Yongsu Yoo <yongsuyoo0215@gmail.com>
> >
> > In source/drivers/media/dvb-core/dvb_ca_en50221.c, if the CA_RESET
> > ioctl is called, the dvb_ca_en50221_slot_shutdown will also be called.
> > Inside of the dvb_ca_en50221_slot_shutdown,
> > the ca->slot_info[slot].slot_state will become DVB_CA_SLOTSTATE_NONE.
> > In the most of cases, the ca->slot_info[slot].slot_state will quickly
> > becomes restored to other states by the subsequent operations of the
> > thread dvb_ca_en50221_thread_state_machine.
> > But in some rare cases, when the CA_GET_SLOT_INFO ioctl is immediately
> > called after the CA_RESET ioctl is called, the
> > the ca->slot_info[slot].slot_state can still remains at
> > DVB_CA_SLOTSTATE_NONE, and this causes CA_GET_SLOT_INFO ioctl not to
> > return CA_CI_MODULE_PRESENT as info->flags even if CA_CI_MODULE is
> > really connected on TV. This means that the CA_GET_SLOT_INFO ioctl
> > does not return right informtion. This is a Bug. We fix this bug.
> > ---
> > drivers/media/dvb-core/dvb_ca_en50221.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
> > index baf64540dc00..8d37c3c13227 100644
> > --- a/drivers/media/dvb-core/dvb_ca_en50221.c
> > +++ b/drivers/media/dvb-core/dvb_ca_en50221.c
> > @@ -1403,6 +1403,10 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file,
> > (sl->slot_state != DVB_CA_SLOTSTATE_INVALID)) {
> > info->flags = CA_CI_MODULE_PRESENT;
> > }
> > + if ((sl->slot_state == DVB_CA_SLOTSTATE_NONE) &&
> > + (sl->camchange_type == DVB_CA_EN50221_CAMCHANGE_INSERTED)) {
> > + info->flags = CA_CI_MODULE_PRESENT;
> > + }
> > if (sl->slot_state == DVB_CA_SLOTSTATE_RUNNING)
> > info->flags |= CA_CI_MODULE_READY;
> > break;
> > --
> > 2.17.1
> >
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] media: dvb_ca_en50221: Fix a bug for detecting CI MODULE
2024-03-08 12:10 [PATCH] media: dvb_ca_en50221: Fix a bug for detecting CI MODULE yongsuyoo0215
2024-04-11 12:03 ` YongSu Yoo
@ 2024-05-01 16:25 ` Markus Elfring
2024-05-23 13:11 ` YongSu Yoo
1 sibling, 1 reply; 6+ messages in thread
From: Markus Elfring @ 2024-05-01 16:25 UTC (permalink / raw)
To: Yongsu Yoo, linux-media, kernel-janitors
Cc: LKML, Hyunwoo Kim, Mauro Carvalho Chehab
…
> really connected on TV. This means that the CA_GET_SLOT_INFO ioctl
> does not return right informtion. This is a Bug. We fix this bug.
1. I hope that typos will be avoided for subsequent change descriptions.
2. How do you think about to improve the patch further with a corresponding imperative wording?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.9-rc6#n94
3. Would you like to add the tag “Fixes” accordingly?
Regards,
Markus
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-05-23 14:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-08 12:10 [PATCH] media: dvb_ca_en50221: Fix a bug for detecting CI MODULE yongsuyoo0215
2024-04-11 12:03 ` YongSu Yoo
2024-05-01 7:54 ` YongSu Yoo
2024-05-01 16:25 ` Markus Elfring
2024-05-23 13:11 ` YongSu Yoo
2024-05-23 14:02 ` Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®