From: Hans Verkuil <hverkuil@xs4all.nl>
To: Mauro Carvalho Chehab <m.chehab@samsung.com>,
linux-media@vger.kernel.org
Subject: Re: [PATCH] bttv: Add support for PCI-8604PW
Date: Mon, 17 Mar 2014 13:02:09 +0100 [thread overview]
Message-ID: <5326E441.6080705@xs4all.nl> (raw)
In-Reply-To: <20140317115904.GA10962@minime.bse>
On 03/17/2014 12:59 PM, Daniel Glöckner wrote:
> Hi Hans,
>
> On Mon, Mar 17, 2014 at 10:44:29AM +0100, Hans Verkuil wrote:
>>> + switch (state) {
>>> + case 1:
>>> + case 5:
>>> + case 6:
>>> + case 4:
>>> + pr_debug("PCI-8604PW in state %i, toggling pin\n",
>>> + state);
>>> + btwrite(0x080000, BT848_GPIO_DATA);
>>> + msleep(1);
>>> + btwrite(0x000000, BT848_GPIO_DATA);
>>> + msleep(1);
>>> + break;
>>> + case 7:
>>> + pr_info("PCI-8604PW unlocked\n");
>>> + return;
>>> + case 0: /* FIXME */
>>
>> Fix what? My guess is that if this state happens, then you have no idea how to
>> get out of it. Did you actually see this happen, or is this a theoretical case?
>
> yes, if we are in state 7 and toggle GPIO[19] one more time, the CPLD
> goes into state 0, where PCI bus mastering is inhibited again.
> We have not managed to get out of that state.
>
>>> + pr_err("PCI-8604PW locked until reset\n");
>>> + return;
>
>>> + state = (state << 4) | ((btread(BT848_GPIO_DATA) >> 21) & 7);
>>> +
>>> + switch (state) {
>>> + case 0x15:
>>> + case 0x56:
>>> + case 0x64:
>>> + case 0x47:
>>> +/* case 0x70: */
>>
>> Why is this commented out?
>
> The transition from state 7 to state 0 is, as explained above, valid
> but undesired and with this code impossible as we exit as soon as we
> are in state 7.
Can you post a new version with comments that explain this?
This is non-obvious information that should be documented in the code.
Thanks!
Hans
prev parent reply other threads:[~2014-03-17 12:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-16 10:33 [PATCH] bttv: Add support for PCI-8604PW Daniel Glöckner
2014-03-17 9:44 ` Hans Verkuil
2014-03-17 11:59 ` Daniel Glöckner
2014-03-17 12:02 ` Hans Verkuil [this message]
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=5326E441.6080705@xs4all.nl \
--to=hverkuil@xs4all.nl \
--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