tree:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-5.8
head: e5d099503c6aa0c43fa0962084d92fb15c0fd941
commit: d0278f2d39d1acf420a12d73deb786db20b05f55 [114/382] drm/amd/display: allow query
ddc data over aux to be read only operation
config: i386-randconfig-c001-20200817 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
coccinelle warnings: (new ones prefixed by >>)
> drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c:541:34-39:
WARNING: conversion to bool not needed here
#
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable queue-5.8
git checkout d0278f2d39d1acf420a12d73deb786db20b05f55
vim +541 drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
497
498 bool dal_ddc_service_query_ddc_data(
499 struct ddc_service *ddc,
500 uint32_t address,
501 uint8_t *write_buf,
502 uint32_t write_size,
503 uint8_t *read_buf,
504 uint32_t read_size)
505 {
506 bool success = true;
507 uint32_t payload_size =
508 dal_ddc_service_is_in_aux_transaction_mode(ddc) ?
509 DEFAULT_AUX_MAX_DATA_SIZE : EDID_SEGMENT_SIZE;
510
511 uint32_t write_payloads =
512 (write_size + payload_size - 1) / payload_size;
513
514 uint32_t read_payloads =
515 (read_size + payload_size - 1) / payload_size;
516
517 uint32_t payloads_num = write_payloads + read_payloads;
518
519
520 if (write_size > EDID_SEGMENT_SIZE || read_size > EDID_SEGMENT_SIZE)
521 return false;
522
523 if (!payloads_num)
524 return false;
525
526 /*TODO: len of payload data for i2c and aux is uint8!!!!,
527 * but we want to read 256 over i2c!!!!*/
528 if (dal_ddc_service_is_in_aux_transaction_mode(ddc)) {
529 struct aux_payload payload;
530
531 payload.i2c_over_aux = true;
532 payload.address = address;
533 payload.reply = NULL;
534 payload.defer_delay = get_defer_delay(ddc);
535
536 if (write_size != 0) {
537 payload.write = true;
538 /* should not set mot (middle of transaction) to 0
539 * if there are pending read payloads
540 */
541 payload.mot = read_size == 0 ? false : true;
542 payload.length = write_size;
543 payload.data = write_buf;
544
545 success = dal_ddc_submit_aux_command(ddc, &payload);
546 }
547
548 if (read_size != 0 && success) {
549 payload.write = false;
550 /* should set mot (middle of transaction) to 0
551 * since it is the last payload to send
552 */
553 payload.mot = false;
554 payload.length = read_size;
555 payload.data = read_buf;
556
557 success = dal_ddc_submit_aux_command(ddc, &payload);
558 }
559 } else {
560 struct i2c_command command = {0};
561 struct i2c_payloads payloads;
562
563 if (!dal_ddc_i2c_payloads_create(ddc->ctx, &payloads, payloads_num))
564 return false;
565
566 command.payloads = dal_ddc_i2c_payloads_get(&payloads);
567 command.number_of_payloads = 0;
568 command.engine = DDC_I2C_COMMAND_ENGINE;
569 command.speed = ddc->ctx->dc->caps.i2c_speed_in_khz;
570
571 dal_ddc_i2c_payloads_add(
572 &payloads, address, write_size, write_buf, true);
573
574 dal_ddc_i2c_payloads_add(
575 &payloads, address, read_size, read_buf, false);
576
577 command.number_of_payloads =
578 dal_ddc_i2c_payloads_get_count(&payloads);
579
580 success = dm_helpers_submit_i2c(
581 ddc->ctx,
582 ddc->link,
583 &command);
584
585 dal_ddc_i2c_payloads_destroy(&payloads);
586 }
587
588 return success;
589 }
590
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org