Re: [PATCH 6/6] staging: fsl-mc: Changed version matching rules for MC object drivers

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

 



On 03/27/2015 10:01 PM, J. German Rivera wrote:
Before this change, we were requiring a complete version match (major and
minor version numbers) between MC objects and corresponding drivers, to
allow MC objects to be bound to their drivers. We realized that a mismatch
in minor version numbers should be tolerated, as long as the major version
numbers match. This allows the driver to decide what to do in the minor
version mismatch case. For example, a driver may decide to run with
downgraded functionality if the MC firmware object has older minor version
number than the driver. Also, a driver with older minor version than the
MC firmware object may decide to run even though it cannot use newer
functionality of the MC object.

As part of this change, the dpmng Flib version was also updated
to match the latest MC firmware version.

Signed-off-by: J. German Rivera <German.Rivera@xxxxxxxxxxxxx>

I think this is a step into the right direction, but you really don't want to match only when the minor equals. Usually you'd like something like

  if (cur_minor > max_minor) {
dev_warn("Unknown version %d.%d of fsl-mc detected. Please update your kernel if you encounter problems.")
  }

but always assume that cur_minor < max_minor works. In cases where the protocol did change between minors, add code to support the older minors as well.


Alex

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux