From: Akihiro TSUKADA <tskd08@gmail.com>
To: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: linux-media@vger.kernel.org, james.hogan@imgtec.com
Subject: Re: [PATCH 4/4] pt3: add support for Earthsoft PT3 ISDB-S/T receiver card
Date: Mon, 18 Aug 2014 04:29:26 +0900 [thread overview]
Message-ID: <53F10296.8080905@gmail.com> (raw)
In-Reply-To: <20140815131725.6451cbf9.m.chehab@samsung.com>
On 2014年08月16日 01:17, Mauro Carvalho Chehab wrote:
..........
>> +++ b/drivers/media/pci/pt3/pt3.c
..........
>> +static int pt3_fetch_thread(void *data)
>> +{
>> + struct pt3_adapter *adap = data;
>> +
>> +#define PT3_FETCH_DELAY (10 * 1000)
>> +#define PT3_INITIAL_DISCARD_BUFS 4
>> +
>> + pt3_init_dmabuf(adap);
>> + adap->num_discard = PT3_INITIAL_DISCARD_BUFS;
>> +
>> + dev_dbg(adap->dvb_adap.device,
>> + "PT3: [%s] started.\n", adap->thread->comm);
>> + while (!kthread_should_stop()) {
>> + pt3_proc_dma(adap);
>> + usleep_range(PT3_FETCH_DELAY, PT3_FETCH_DELAY + 2000);
>> + }
>> + dev_dbg(adap->dvb_adap.device,
>> + "PT3: [%s] exited.\n", adap->thread->comm);
>> + adap->thread = NULL;
>> + return 0;
>> +}
>
> Why do you need a thread here? Having a thread requires some special
> care, as you need to delete it before suspend, restore at resume
> (if active) and be sure that it was killed at device removal.
>
> I'm not seeing any of those things on this driver.
PT3 is a dumb device that lacks interrupt,
so the driver has to poll the DMA buffers regularly to know if
a DMA has finished.
I forgot to clean up the thread in remove() and will add it in the v2.
As with suspend/resume, I can add a check of freezing() like in
dvb_frontend.c::dvb_frontend_thread(), but if I remember right,
I had read before that someone pointed out that
the suspend/resume of DVB is not supported by DVB core,
and not many of other drivers seem to support it either,
so I thought I could omit this feature and rely on module re-probing.
Should I implement power management ops and set them to .driver.pm?
next prev parent reply other threads:[~2014-08-17 19:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-14 15:43 [PATCH 0/4] dvb: Add support for PT3 ISDB-S/T card tskd08
2014-07-14 15:43 ` [PATCH 1/4] mxl301rf: add driver for MaxLinear MxL301RF OFDM tuner tskd08
2014-07-14 15:43 ` [PATCH 2/4] qm1d1c0042: add driver for Sharp QM1D1C0042 8PSK tuner tskd08
2014-07-14 15:43 ` [PATCH 3/4] tc90522: add driver for Toshiba TC90522 quad demodulator tskd08
2014-07-14 15:43 ` [PATCH 4/4] pt3: add support for Earthsoft PT3 ISDB-S/T receiver card tskd08
2014-08-15 16:17 ` Mauro Carvalho Chehab
2014-08-17 19:29 ` Akihiro TSUKADA [this message]
2014-08-15 16:09 ` [PATCH 3/4] tc90522: add driver for Toshiba TC90522 quad demodulator Mauro Carvalho Chehab
2014-08-17 18:24 ` Akihiro TSUKADA
2014-08-15 15:55 ` [PATCH 2/4] qm1d1c0042: add driver for Sharp QM1D1C0042 8PSK tuner Mauro Carvalho Chehab
2014-08-15 15:50 ` [PATCH 1/4] mxl301rf: add driver for MaxLinear MxL301RF OFDM tuner Mauro Carvalho Chehab
2014-08-17 16:47 ` Akihiro TSUKADA
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53F10296.8080905@gmail.com \
--to=tskd08@gmail.com \
--cc=james.hogan@imgtec.com \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).