RE: [PATCH 1/4] drivers/bus: Added Freescale Management Complex APIs

Stuart Yoder
2014-09-19T21:30:59Z

> -----Original Message-----
> From: Kim Phillips [mailto:kim.phillips@freescale.com]
> Sent: Friday, September 19, 2014 3:25 PM
> To: Yoder Stuart-B08248
> Cc: Rivera Jose-B46482; Alexander Graf; <gregkh@linuxfoundation.org>; <arnd@arndb.de>; <linux-
> kernel@vger.kernel.org>; Wood Scott-B07421; <linuxppc-release@linux.freescale.net>
> Subject: Re: [PATCH 1/4] drivers/bus: Added Freescale Management Complex APIs
>
> On Fri, 19 Sep 2014 14:06:32 -0500
> Yoder Stuart-B08248 <stuart.yoder@freescale.com> wrote:
>
> > > > >>>>> +/**
> > > > >>>>> + * @brief Management Complex firmware version information
> > > > >>>>> + */
> > > > >>>>> +#define MC_VER_MAJOR 2
> > > > >>>>> +#define MC_VER_MINOR 0
> > > > >>>>
> > > > >>>> code should be adjusted to run on all *compatible* versions of h/w,
> > > > >>>> not strictly the one set in these defines.
> > > > >>> This comment is not precise enough be actionable.
> > > > >>> What exactly you want to be changed here?
> > > > >>
> > > > >> I think the easy thing to do is to convert the exact version check into a ranged version check: have
> > > minimum and maximum versions you support. Or a list of exact versions you support. Or not check for the
> > > version at all - or only for the major version and guarantee that the major version indicates backwards
> > > compatibility.
> > > > >
> > > > > yes, this was my point: elsewhere I noticed the code denies to run
> > > > > iff those defines are not matched exactly: that code should change
> > > > > to run as Alex describes.
> > > > >
> > > > As I mentioned in the reply to Alex, I will remove the minor version check.
> > >
> > > the code should be able to run on all subsequent versions of the
> > > h/w, even in the major version case.
> >
> > You're right, in the future if there are future major versions we would want this
> > same driver to function on multiple versions of the hardware. But at this
> > point in time we don't know what future evolutions there will be and we
> > need the check to error out for now.
>
> why? We have to make the standard assumption that newer versions
> will be backward compatible, in which case the driver should be left
> to run.

If future changes are backward compatible then only the minor version changes. That is
the explicit definition of the meaning of major/minor version for this device.

If the major number changes, then it is not backward compatible and will require
driver changes. So this "error out" check is temporary until we reach that future
point, where it can be removed and we can hopefully implement dynamic handling
of the incompatibility.

Stuart