Message ID | 20240308121021.1732-1-yongsuyoo0215@gmail.com (mailing list archive) |
---|---|
State | New |
Headers |
Received: from sv.mirrors.kernel.org ([139.178.88.99]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from <linux-media+bounces-6720-patchwork=linuxtv.org@vger.kernel.org>) id 1riZ3b-0001SW-1C for patchwork@linuxtv.org; Fri, 08 Mar 2024 12:10:36 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EC5C32834EF for <patchwork@linuxtv.org>; Fri, 8 Mar 2024 12:10:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A51F56756; Fri, 8 Mar 2024 12:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FvwdXM/I" X-Original-To: linux-media@vger.kernel.org Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6572A535CA; Fri, 8 Mar 2024 12:10:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709899826; cv=none; b=S98WSt33X0QTeHI4TNHV6rK3F0P20Z4lEVQTGYvwjF0fYyk6A2Kgjm/BUbnMCd1F1o54glbttfY4HY7ECVvxusSEHH3KmvYwmRwy7otE3jQSGA8KLap/inPwsT/M0xVz6tn+WcT7mXsOEGgt89Fv9gEX3HaU1b9tpWYwajjM6Mo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709899826; c=relaxed/simple; bh=Umw52OeAdsCrNTCL2UqZxJ1nYRjrDFqkST66g4dDbGc=; h=From:To:Subject:Date:Message-Id; b=iMxMHEQ8G8WFYy+G+Ml3YGfztOIZd1TkR/S0DCD0hNhhVCoMKTfHt4/Ub/MgKSrUFaHvji6avaDv1Xse91DJqlggYcaS9YtlRqmxAINvl7gqdk1Q6H53RlBaKPy70qb0FgmeN33RkxkCf+v/Qv0sOll8/9Q+YJc6gzvg4NOxsaQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FvwdXM/I; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1dc29f1956cso5088275ad.0; Fri, 08 Mar 2024 04:10:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709899825; x=1710504625; darn=vger.kernel.org; h=message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=FT4YKhx1arQKM4uZFE6CXUn3u3YsdPfEE6W1XkpDDy0=; b=FvwdXM/IPjZt+7o3kBFuAll5FU/BVwPWDbIfpmdEZ8FOh3TTwDh7XjxpQfdRPhzvt7 2Bwr5d7W14h+Elt24k4g46BXGnQrlhg1JNWbrN6XL2+2wdQu70nYKvtvkB3co2W9eqLt /8lYwD5EttxlNuE+YLcW9AFjK4NZKMen/nQuKBr2UOsUVKXtviz15gWxvhZYfg8EfnTH xxMCiUQtlMKnO2fOM8JZJ+mh99kiXNkech8jyWp2kH9zq1PAHpSMYoRmsjBujRhUDAZK 4Nf00Inpy1+XRuKdfKWrMixMDRj024q79SfsurbNqr9I6k37DPaRD/7vn6yZeA/y5o6Z bL3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709899825; x=1710504625; h=message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FT4YKhx1arQKM4uZFE6CXUn3u3YsdPfEE6W1XkpDDy0=; b=j0CSGjjmegYcvsdI1A2BV/URH07eANl7t4j4N9TxN02iUUSWUK1SMFgLL0JTESI6XG cASrKfUAtgrvPu/iDOtv1gFN9Hm+RdS/Kz3FojZ6Xg7ZjwmtJr/qNMLlgJRTwBIsN3js JVYQHF1v5ISSelaw+FyTl4/R+z/bR/7/I6cXCJ5g6WN2jymUzUoXzOP66BpaSfUZiCYf pPmVAAWjuBLaazionwOeINRH34Q2SEDoD3w/4Hu0pNd8ozGPOKpTrtIiXJxfLTwnVVqO ZMrfawhsGq8gEAT1ONKaF/Jj3n55wI5vKFoox+Wgm9FLd8hXwCIYQJ1F0ei4vHsNdB4s FcsA== X-Forwarded-Encrypted: i=1; AJvYcCWbS6/gG8+VXl9lqNpZ3dj9WDn32y3fUCa7GGx51fNaFaFT3ROZbxJeQEH/+PoeRn/UC5dSfKKQoEsxvAqy4ass5LGZZUvVtkZvjaC/7DrtKRLkSBS5KBrt2gsJLKL7Pf1iF2HQUVWoXJo= X-Gm-Message-State: AOJu0YzkSCI+fsv6/MzgBN+RvrjAQp82dTBkfanzcWBMVAiZvjAxgdhE 85r4ZLNwSoyEyDR+glc8Rayu1uHBUtdCdsF4cf+AeSpQhSTn4+EBVdzpvjawRwA= X-Google-Smtp-Source: AGHT+IHsH8NDwM4TODYOCRN5NcxpEfZ5S2tEIVEttMzmnICm6qCNbDEBiYPhQlBVvEUzv2dZkNIrTA== X-Received: by 2002:a17:902:ec92:b0:1dc:42da:bad with SMTP id x18-20020a170902ec9200b001dc42da0badmr12957207plg.62.1709899824581; Fri, 08 Mar 2024 04:10:24 -0800 (PST) Received: from goorm.ap-northeast-2.compute.internal (ec2-52-78-100-77.ap-northeast-2.compute.amazonaws.com. [52.78.100.77]) by smtp.gmail.com with ESMTPSA id jf19-20020a170903269300b001db37fd26bcsm2491016plb.116.2024.03.08.04.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 04:10:24 -0800 (PST) From: yongsuyoo0215@gmail.com To: mchehab@kernel.org, yongsuyoo0215@gmail.com, v4bel@theori.io, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: dvb_ca_en50221: Fix a bug for detecting CI MODULE Date: Fri, 8 Mar 2024 12:10:21 +0000 Message-Id: <20240308121021.1732-1-yongsuyoo0215@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: <linux-media.vger.kernel.org> List-Subscribe: <mailto:linux-media+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-media+unsubscribe@vger.kernel.org> X-LSpam-Score: -3.9 (---) X-LSpam-Report: No, score=-3.9 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DMARC_PASS=-0.001,FREEMAIL_FORGED_FROMDOMAIN=1,FREEMAIL_FROM=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no |
Series |
media: dvb_ca_en50221: Fix a bug for detecting CI MODULE
|
|
Commit Message
YongSu Yoo
March 8, 2024, 12:10 p.m. UTC
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(+)
Comments
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 >
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 > >
… > 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
Dear Markus Elfring Can you explain what I shall do more ? 1. What is the "typo" ? 2. Can you take some examples which show the "Imperative wording" ? 3. Can you give me some examples for adding "Fixes" ? Do I have to use "Fixes" instead of "Fix" ? 2024년 5월 2일 (목) 오전 1:25, Markus Elfring <Markus.Elfring@web.de>님이 작성: > > … > > 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
> 1. What is the "typo" ? Please take another look at opportunities for spell checking also in commit messages. >>>> … right informtion. … a Bug. … > 2. Can you take some examples which show the "Imperative wording" ? I hope that you can take published guidance better into account (instead of the wording “We fix this bug.” in the discussed changelog). https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.9#n94 > 3. Can you give me some examples for adding "Fixes" ? An other tag specification might be more appropriate than the following suggestion. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.9#n145 Fixes: a75aa90c7c2f ("media: dvb_ca_en50221: Used a helper variable") Regards, Markus
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;