Skip to contentSkip to conversation

media: lgdt330x: fix lock status reporting

PATCH In review French, Nicholas A. 3 participants 3 messages Dec 9, 2018 – Dec 10, 2018 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: lgdt330x: fix lock status reporting

A typo in code cleanup commit db9c1007bc07 ("media: lgdt330x: do some cleanups at status logic") broke the FE_HAS_LOCK reporting for 3303 chips by inadvertently modifying the register mask.

The broken lock status is critial as it prevents video capture cards from reporting signal strength, scanning for channels, and capturing video.

Fix regression by reverting mask change.

---
 drivers/media/dvb-frontends/lgdt330x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb-frontends/lgdt330x.c +1 -1
index 96807e134886..8abb1a510a81 100644
@@ -783,7 +783,7 @@ static int lgdt3303_read_status(struct dvb_frontend *fe,
 
 		if ((buf[0] & 0x02) == 0x00)
 			*status |= FE_HAS_SYNC;
-		if ((buf[0] & 0xfd) == 0x01)
+		if ((buf[0] & 0x01) == 0x01)
 			*status |= FE_HAS_VITERBI | FE_HAS_LOCK;
 		break;
 	default:
Signature · 1 line
2.19.2
Reviewed-by on v1 1/1
#1 lore raw

Hello Nick,

Thank you for the patch.

Quoted 11 lines · Nicholas A.

A typo in code cleanup commit db9c1007bc07 ("media: lgdt330x: do some cleanups at status logic") broke the FE_HAS_LOCK reporting for 3303 chips by inadvertently modifying the register mask.

The broken lock status is critial as it prevents video capture cards from reporting signal strength, scanning for channels, and capturing video.

Fix regression by reverting mask change.

This looks good to me. The patch should have a

Fixes db9c1007bc07 ("media: lgdt330x: do some cleanups at status logic")

line though. With that added,

The patch that broke this was committed without any review. Once again we get a proof that this isn't an acceptable policy. The review process needs to be fixed.

Quoted 18 lines
---
 drivers/media/dvb-frontends/lgdt330x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/media/dvb-frontends/lgdt330x.c index 96807e134886..8abb1a510a81 100644

drivers/media/dvb-frontends/lgdt330x.c +1 -1
@@ -783,7 +783,7 @@ static int lgdt3303_read_status(struct dvb_frontend *fe,
 
 		if ((buf[0] & 0x02) == 0x00)
 			*status |= FE_HAS_SYNC;
-		if ((buf[0] & 0xfd) == 0x01)
+		if ((buf[0] & 0x01) == 0x01)
 			*status |= FE_HAS_VITERBI | FE_HAS_LOCK;
 		break;
 	default:
Signature · 3 lines
Regards,

Laurent Pinchart
Tested-by on v1 1/1
#2 lore raw
In reply to French, Nicholas A.
Quoted 31 lines · Nicholas A.

A typo in code cleanup commit db9c1007bc07 ("media: lgdt330x: do some cleanups at status logic") broke the FE_HAS_LOCK reporting for 3303 chips by inadvertently modifying the register mask.

The broken lock status is critial as it prevents video capture cards from reporting signal strength, scanning for channels, and capturing video.

Fix regression by reverting mask change.

---
 drivers/media/dvb-frontends/lgdt330x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb-frontends/lgdt330x.c +1 -1
index 96807e134886..8abb1a510a81 100644
@@ -783,7 +783,7 @@ static int lgdt3303_read_status(struct dvb_frontend *fe,
 
 		if ((buf[0] & 0x02) == 0x00)
 			*status |= FE_HAS_SYNC;
-		if ((buf[0] & 0xfd) == 0x01)
+		if ((buf[0] & 0x01) == 0x01)
 			*status |= FE_HAS_VITERBI | FE_HAS_LOCK;
 		break;
 	default:
Signature · 1 line
2.19.2

Patch worked for me.