Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'media/v5.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:

- some fixes at CEC core to comply with HDMI 2.0 specs and fix some
border cases

- a fix at the transmission logic of the pulse8-cec driver

- one alignment fix on a data struct at ipu3 when built with 32 bits

* tag 'media/v5.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
media: intel-ipu3: Align struct ipu3_uapi_awb_fr_config_s to 32 bytes
media: pulse8-cec: fix lost cec_transmit_attempt_done() call
media: cec: check 'transmit_in_progress', not 'transmitting'
media: cec: avoid decrementing transmit_queue_sz if it is 0
media: cec: CEC 2.0-only bcast messages were ignored

+41 -18
+27 -13
drivers/media/cec/cec-adap.c
··· 380 380 } else { 381 381 list_del_init(&data->list); 382 382 if (!(data->msg.tx_status & CEC_TX_STATUS_OK)) 383 - data->adap->transmit_queue_sz--; 383 + if (!WARN_ON(!data->adap->transmit_queue_sz)) 384 + data->adap->transmit_queue_sz--; 384 385 } 385 386 386 387 if (data->msg.tx_status & CEC_TX_STATUS_OK) { ··· 433 432 * need to do anything special in that case. 434 433 */ 435 434 } 435 + /* 436 + * If something went wrong and this counter isn't what it should 437 + * be, then this will reset it back to 0. Warn if it is not 0, 438 + * since it indicates a bug, either in this framework or in a 439 + * CEC driver. 440 + */ 441 + if (WARN_ON(adap->transmit_queue_sz)) 442 + adap->transmit_queue_sz = 0; 436 443 } 437 444 438 445 /* ··· 465 456 bool timeout = false; 466 457 u8 attempts; 467 458 468 - if (adap->transmitting) { 459 + if (adap->transmit_in_progress) { 469 460 int err; 470 461 471 462 /* ··· 500 491 goto unlock; 501 492 } 502 493 503 - if (adap->transmitting && timeout) { 494 + if (adap->transmit_in_progress && timeout) { 504 495 /* 505 496 * If we timeout, then log that. Normally this does 506 497 * not happen and it is an indication of a faulty CEC ··· 509 500 * so much traffic on the bus that the adapter was 510 501 * unable to transmit for CEC_XFER_TIMEOUT_MS (2.1s). 511 502 */ 512 - pr_warn("cec-%s: message %*ph timed out\n", adap->name, 513 - adap->transmitting->msg.len, 514 - adap->transmitting->msg.msg); 503 + if (adap->transmitting) { 504 + pr_warn("cec-%s: message %*ph timed out\n", adap->name, 505 + adap->transmitting->msg.len, 506 + adap->transmitting->msg.msg); 507 + /* Just give up on this. */ 508 + cec_data_cancel(adap->transmitting, 509 + CEC_TX_STATUS_TIMEOUT); 510 + } else { 511 + pr_warn("cec-%s: transmit timed out\n", adap->name); 512 + } 515 513 adap->transmit_in_progress = false; 516 514 adap->tx_timeouts++; 517 - /* Just give up on this. */ 518 - cec_data_cancel(adap->transmitting, 519 - CEC_TX_STATUS_TIMEOUT); 520 515 goto unlock; 521 516 } 522 517 ··· 535 522 data = list_first_entry(&adap->transmit_queue, 536 523 struct cec_data, list); 537 524 list_del_init(&data->list); 538 - adap->transmit_queue_sz--; 525 + if (!WARN_ON(!data->adap->transmit_queue_sz)) 526 + adap->transmit_queue_sz--; 539 527 540 528 /* Make this the current transmitting message */ 541 529 adap->transmitting = data; ··· 1099 1085 valid_la = false; 1100 1086 else if (!cec_msg_is_broadcast(msg) && !(dir_fl & DIRECTED)) 1101 1087 valid_la = false; 1102 - else if (cec_msg_is_broadcast(msg) && !(dir_fl & BCAST1_4)) 1088 + else if (cec_msg_is_broadcast(msg) && !(dir_fl & BCAST)) 1103 1089 valid_la = false; 1104 1090 else if (cec_msg_is_broadcast(msg) && 1105 - adap->log_addrs.cec_version >= CEC_OP_CEC_VERSION_2_0 && 1106 - !(dir_fl & BCAST2_0)) 1091 + adap->log_addrs.cec_version < CEC_OP_CEC_VERSION_2_0 && 1092 + !(dir_fl & BCAST1_4)) 1107 1093 valid_la = false; 1108 1094 } 1109 1095 if (valid_la && min_len) {
+13 -4
drivers/media/usb/pulse8-cec/pulse8-cec.c
··· 116 116 unsigned int vers; 117 117 struct completion cmd_done; 118 118 struct work_struct work; 119 + u8 work_result; 119 120 struct delayed_work ping_eeprom_work; 120 121 struct cec_msg rx_msg; 121 122 u8 data[DATA_SIZE]; ··· 138 137 { 139 138 struct pulse8 *pulse8 = 140 139 container_of(work, struct pulse8, work); 140 + u8 result = pulse8->work_result; 141 141 142 - switch (pulse8->data[0] & 0x3f) { 142 + pulse8->work_result = 0; 143 + switch (result & 0x3f) { 143 144 case MSGCODE_FRAME_DATA: 144 145 cec_received_msg(pulse8->adap, &pulse8->rx_msg); 145 146 break; ··· 175 172 pulse8->escape = false; 176 173 } else if (data == MSGEND) { 177 174 struct cec_msg *msg = &pulse8->rx_msg; 175 + u8 msgcode = pulse8->buf[0]; 178 176 179 177 if (debug) 180 178 dev_info(pulse8->dev, "received: %*ph\n", 181 179 pulse8->idx, pulse8->buf); 182 - pulse8->data[0] = pulse8->buf[0]; 183 - switch (pulse8->buf[0] & 0x3f) { 180 + switch (msgcode & 0x3f) { 184 181 case MSGCODE_FRAME_START: 185 182 msg->len = 1; 186 183 msg->msg[0] = pulse8->buf[1]; ··· 189 186 if (msg->len == CEC_MAX_MSG_SIZE) 190 187 break; 191 188 msg->msg[msg->len++] = pulse8->buf[1]; 192 - if (pulse8->buf[0] & MSGCODE_FRAME_EOM) 189 + if (msgcode & MSGCODE_FRAME_EOM) { 190 + WARN_ON(pulse8->work_result); 191 + pulse8->work_result = msgcode; 193 192 schedule_work(&pulse8->work); 193 + break; 194 + } 194 195 break; 195 196 case MSGCODE_TRANSMIT_SUCCEEDED: 196 197 case MSGCODE_TRANSMIT_FAILED_LINE: 197 198 case MSGCODE_TRANSMIT_FAILED_ACK: 198 199 case MSGCODE_TRANSMIT_FAILED_TIMEOUT_DATA: 199 200 case MSGCODE_TRANSMIT_FAILED_TIMEOUT_LINE: 201 + WARN_ON(pulse8->work_result); 202 + pulse8->work_result = msgcode; 200 203 schedule_work(&pulse8->work); 201 204 break; 202 205 case MSGCODE_HIGH_ERROR:
+1 -1
drivers/staging/media/ipu3/include/intel-ipu3.h
··· 449 449 __u16 reserved1; 450 450 __u32 bayer_sign; 451 451 __u8 bayer_nf; 452 - __u8 reserved2[3]; 452 + __u8 reserved2[7]; 453 453 } __attribute__((aligned(32))) __packed; 454 454 455 455 /**