Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932290AbbDHXMj (ORCPT ); Wed, 8 Apr 2015 19:12:39 -0400 Received: from cantor2.suse.de ([195.135.220.15]:39356 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753681AbbDHXMi (ORCPT ); Wed, 8 Apr 2015 19:12:38 -0400 Message-ID: <5525B588.3020407@suse.de> Date: Thu, 09 Apr 2015 01:11:04 +0200 From: Alexander Graf User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "J. German Rivera" , gregkh@linuxfoundation.org, arnd@arndb.de, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org CC: stuart.yoder@freescale.com, Kim.Phillips@freescale.com, scottwood@freescale.com, bhamciu1@freescale.com, R89243@freescale.com, bhupesh.sharma@freescale.com, nir.erez@freescale.com, richard.schmitt@freescale.com Subject: Re: [PATCH 6/6] staging: fsl-mc: Changed version matching rules for MC object drivers References: <1427490069-3142-1-git-send-email-German.Rivera@freescale.com> <1427490069-3142-7-git-send-email-German.Rivera@freescale.com> In-Reply-To: <1427490069-3142-7-git-send-email-German.Rivera@freescale.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1638 Lines: 37 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 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/