linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Walls <awalls.cx18@gmail.com>
To: Devin Heitmueller <dheitmueller@kernellabs.com>,
	Sean Young <sean@mess.org>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH v3 04/26] media: lirc_zilog: remove receiver
Date: Wed, 11 Oct 2017 20:50:07 -0400	[thread overview]
Message-ID: <1507769407.2736.10.camel@gmail.com> (raw)
In-Reply-To: <CAGoCfixQ6uLwbs7pQv5SzNkhP_Au18WrdNnM=Odi4JpbAn174w@mail.gmail.com>

Hi Sean and Devin:

On Wed, 2017-10-11 at 20:25 -0400, Devin Heitmueller wrote:
> > There's an ir_lock mutex in the driver to prevent simultaneous
> > access to the Rx and Tx functions of the z8.  Accessing Rx and Tx
> > functions of the chip together can cause it to do the wrong thing
> > (sometimes hang?), IIRC.
> > 
> > I'll see if I can dig up my old disassembly of the z8's firmware to
> > see if that interlock is strictly necessary.

Following up on this:

1. The I2C bus command and response buffers inside the Z8 appear to be
independent and non-overlapping (ignore the garbage assembly
mnemonics):

; I2C data buffer addresses
01bf srp   #%00   ; 01 00 ; Buffer pointer I2C addr E0 (70w) IR Tx  - 160 bytes
01c1 add   r0,@r0 ; 03 00 ; Buffer pointer I2C addr E1 (70r) IR Tx  -   4 bytes
01c3 add   r1,@r5 ; 03 15 ; Buffer pointer I2C addr E2 (71w) IR Rx  -   5 bytes
01c5 add   r1,@r0 ; 03 10 ; Buffer pointer I2C addr E3 (71r) IR Rx  -   5 bytes
01c7 add   r0,@r10; 03 0a ; Buffer pointer I2C addr E4 (72w) IR PB1 -   4 bytes
01c9 add   r1,@r10; 03 1a ; Buffer pointer I2C addr E5 (72r) IR PB1 -   4 bytes
01cb add   r0,@r5 ; 03 05 ; Buffer pointer I2C addr E6 (73w) IR Lrn -   1 bytes
01cd add   r0,r0  ; 02 00 ; Buffer pointer I2C addr E7 (73r) IR Lrn - 256 bytes

and the I2C handling routines appear to do the right thing in waiting
for "full" buffers before operating on them.

2. Z8 Port B is used by both Tx and Rx functions, but the functions
each only use 1 line of the I/O port and they use different lines.

3. Z8 Port C is unused.

4. Z8 Port A is used by both Tx functions, Rx functions, the I2C
interface.  If something inside the Z8 screws up the I2C bus comms with
the chip, it's likely the errant misconfiguration of Port A during
certain Rx and Tx operations.

5. Rx and IR Learn both use the same external hardware.  Not
coordinating Rx with Learn mode in the same driver, will prevent Learn
operation from working.  That is, if Learn mode is ever implemented. 
(Once upon a time, I was planning on doing that.  But I have no time
for that anymore.)  

> > Yes I know ir-kbd-i2c is in mainline, but as I said, I had reasons
> > for avoiding it when using Tx operation of the chip.  It's been 7
> > years, and I'm getting too old to remember the reasons. :P
> 
> Yeah, you definitely don't want to be issuing requests to the Rx and
> Tx addresses at the same time.  Very bad things will happen.
> 
> Also, what is the polling interval for ir-kbd-i2c?  If it's too high
> you can wedge the I2C bus (depending on the hardware design).
> Likewise, many people disable IR RX entirely (which is trivial to do
> with lirc_zilog through a modprobe optoin).  This is because early
> versions of the HDPVR had issues where polling too often can
> interfere
> with traffic that configures the component receiver chip.  This was
> improved in later versions of the design, but many people found it
> was
> just easiest to disable RX since they don't use it (i.e. they would
> use the blaster for controlling their STB but use a separate IR
> receiver).
> 
> Are you testing with video capture actively in use?  If you're
> testing
> the IR interface without an active HD capture in progress you're
> likely to miss some of these edge cases (in particular those which
> would hang the encoder).

I'm glad someone remembers all this stuff.  I'm assuming you had more
pain with this than I ever did.  I never owned an HD-PVR.

Regards,
Andy

> I'm not against the removal of duplicate code in general, but you
> have
> to tread carefully because there are plenty of non-obvious edge cases
> to consider.
> 
> Devin
> 

  reply	other threads:[~2017-10-12  0:50 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10  7:17 [PATCH v3 00/26] lirc scancode interface, and more Sean Young
2017-10-10  7:17 ` [PATCH v3 01/26] media: lirc: implement scancode sending Sean Young
2017-10-10  7:17 ` [PATCH v3 02/26] media: lirc: use the correct carrier for scancode transmit Sean Young
2017-10-10  7:17 ` [PATCH v3 03/26] media: rc: auto load encoder if necessary Sean Young
2017-10-10  7:17 ` [PATCH v3 04/26] media: lirc_zilog: remove receiver Sean Young
2017-10-11 19:43   ` Andy Walls
2017-10-11 21:02     ` Sean Young
2017-10-11 23:24       ` Andy Walls
2017-10-12  0:25         ` Devin Heitmueller
2017-10-12  0:50           ` Andy Walls [this message]
2017-10-12  2:25             ` Devin Heitmueller
2017-10-12 12:25               ` Sean Young
2017-10-12 11:40           ` Sean Young
2017-10-10  7:17 ` [PATCH v3 05/26] media: lirc_zilog: fix variable types and other ugliness Sean Young
2017-10-10  7:17 ` [PATCH v3 06/26] media: lirc_zilog: port to rc-core using scancode tx interface Sean Young
2017-10-10  7:17 ` [PATCH v3 07/26] media: promote lirc_zilog out of staging Sean Young
2017-10-10  7:17 ` [PATCH v3 08/26] media: lirc: remove LIRCCODE and LIRC_GET_LENGTH Sean Young
2017-10-10  7:17 ` [PATCH v3 09/26] media: lirc: lirc interface should not be a raw decoder Sean Young
2017-10-10  7:17 ` [PATCH v3 10/26] media: lirc: validate scancode for transmit Sean Young
2017-10-10  7:18 ` [PATCH v3 11/26] media: rc: document and fix rc_validate_scancode() Sean Young
2017-10-10  7:18 ` [PATCH v3 12/26] media: lirc: merge lirc_dev_fop_ioctl and ir_lirc_ioctl Sean Young
2017-10-10  7:18 ` [PATCH v3 13/26] media: lirc: use kfifo rather than lirc_buffer for raw IR Sean Young
2017-10-10  7:18 ` [PATCH v3 14/26] media: lirc: move lirc_dev->attached to rc_dev->registered Sean Young
2017-10-10  7:18 ` [PATCH v3 15/26] media: lirc: do not call rc_close() on unregistered devices Sean Young
2017-10-10  7:18 ` [PATCH v3 16/26] media: lirc: create rc-core open and close lirc functions Sean Young
2017-10-10  7:18 ` [PATCH v3 17/26] media: lirc: remove name from lirc_dev Sean Young
2017-10-10  7:18 ` [PATCH v3 18/26] media: lirc: remove last remnants of lirc kapi Sean Young
2017-10-10  7:18 ` [PATCH v3 19/26] media: lirc: implement reading scancode Sean Young
2017-10-10  7:18 ` [PATCH v3 20/26] media: rc: ensure lirc device receives nec repeats Sean Young
2017-10-10  7:18 ` [PATCH v3 21/26] media: lirc: document LIRC_MODE_SCANCODE Sean Young
2017-10-10  7:18 ` [PATCH v3 22/26] media: lirc: introduce LIRC_SET_POLL_MODES Sean Young
2017-10-10  7:18 ` [PATCH v3 23/26] media: lirc: scancode rc devices should have a lirc device too Sean Young
2017-10-10  7:18 ` [PATCH v3 24/26] media: MAINTAINERS: remove lirc staging area Sean Young
2017-10-10  7:18 ` [PATCH v3 25/26] media: MAINTAINERS: add entry for zilog_ir Sean Young
2017-10-10  7:18 ` [PATCH v3 26/26] kfifo: DECLARE_KIFO_PTR(fifo, u64) does not work on arm 32 bit Sean Young
2017-10-10  7:59 ` Sean Young
2017-11-30 12:29   ` Mauro Carvalho Chehab
2017-11-30 12:34     ` Stefani Seibold
2017-12-08 14:07       ` Mauro Carvalho Chehab

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=1507769407.2736.10.camel@gmail.com \
    --to=awalls.cx18@gmail.com \
    --cc=dheitmueller@kernellabs.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sean@mess.org \
    /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).