re: drm/radeon: add radeon_atom_get_clock_dividers helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Christian König,

The patch 7062ab67d4c6: "drm/radeon: add
radeon_atom_get_clock_dividers helper" from Apr 8, 2013, has endian
bugs.

drivers/gpu/drm/radeon/radeon_atombios.c
  2712                          if (clock_type == COMPUTE_ENGINE_PLL_PARAM) {
  2713                                  args.v3.ulClock.ulComputeClockFlag = clock_type;
  2714                                  args.v3.ulClock.ulClockFreq = cpu_to_le32(clock);       /* 10 khz */
                                                        ^^^^^^^^^^^
This is 24 bit bitfield so it can't store a __le32.  On little endian
systems it will truncate high bits away so that's ok, but on big endian
it will break.

  2715  
  2716                                  atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
  2717  
  2718                                  dividers->post_div = args.v3.ucPostDiv;
  2719                                  dividers->enable_post_div = (args.v3.ucCntlFlag &
  2720                                                               ATOM_PLL_CNTL_FLAG_PLL_POST_DIV_EN) ? true : false;

There are a lot of other Sparse endian warnings but I haven't looked
at them.  Here is how to check:  http://lwn.net/Articles/205624/

regards,
dan carpenter

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux