Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1617402

Re: [PATCH] fpga fr br: fix warning for unexpected version number

Path csiph.com!news.mixmin.net!border2.nntp.ams1.giganews.com!nntp.giganews.com!news.panservice.it!bofh.it!news.nic.it!robomod
From matthew.gerlach@linux.intel.com
Newsgroups linux.kernel
Subject Re: [PATCH] fpga fr br: fix warning for unexpected version number
Date Thu, 06 Apr 2017 00:30:01 +0200
Message-ID <tt1B7-8sp-5@gated-at.bofh.it> (permalink)
References <tsYtA-6BL-19@gated-at.bofh.it> <tsZzj-7hF-1@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491431126; x=1522967126; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=TE416CQocJbLveDxbiVELkRr9+IUG0xpS+nx+0SDuA0=; b=eWKDd659s/U+FGrQUbHjV/NBiop76R7rFXxCLqx2OKrbQ3NNwVdgZSjS DruJ2xM9nVur9HvrkPXLOMVF5CgDjQ==;
X-Extloop1 1
X-Ironport-Av E=Sophos;i="5.37,280,1488873600"; d="scan'208";a="83659080"
X-X-Sender mgerlach@mgerlach-VirtualBox
User-Agent Alpine 2.20 (DEB 67 2015-01-07)
MIME-Version 1.0
Content-Type text/plain; charset=US-ASCII; format=flowed
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 69
Organization linux.* mail to news gateway
X-Original-Cc Alan Tull <atull@kernel.org>, linux-fpga@vger.kernel.org, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
X-Original-Date Wed, 5 Apr 2017 15:25:24 -0700 (PDT)
X-Original-Message-ID <alpine.DEB.2.20.1704051521090.2392@mgerlach-VirtualBox>
X-Original-References <1491419155-17440-1-git-send-email-matthew.gerlach@linux.intel.com> <CAAtXAHdZwyV2Wx3ZvK37i85zY8cc-rWcA=e74KCmFvgByg+k1Q@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1617402

Show key headers only | View raw



On Wed, 5 Apr 2017, Moritz Fischer wrote:

> Hi Matthew,
>

Hi Moritz,


> On Wed, Apr 5, 2017 at 12:05 PM,  <matthew.gerlach@linux.intel.com> wrote:
>> From: Matthew Gerlach <matthew.gerlach@linux.intel.com>
>>
>> The value in the version register of the altera freeze bridge
>> controller changed from the beta value of 2 to the
>> value of 0xad000003 in the official release of the IP.
>> This patch supports the old and new version numbers
>> without printing an warning.
>>
>> Signed-off-by: Matthew Gerlach <matthew.gerlach@linux.intel.com>
>> ---
>>  drivers/fpga/altera-freeze-bridge.c | 9 ++++++---
>>  1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/fpga/altera-freeze-bridge.c b/drivers/fpga/altera-freeze-bridge.c
>> index 8dcd9fb..bdfd5eb 100644
>> --- a/drivers/fpga/altera-freeze-bridge.c
>> +++ b/drivers/fpga/altera-freeze-bridge.c
>> @@ -28,6 +28,7 @@
>>  #define FREEZE_CSR_REG_VERSION                 12
>>
>>  #define FREEZE_CSR_SUPPORTED_VERSION           2
>> +#define FREEZE_CSR_OFFICIAL_VERSION            0xad000003
>>
>>  #define FREEZE_CSR_STATUS_FREEZE_REQ_DONE      BIT(0)
>>  #define FREEZE_CSR_STATUS_UNFREEZE_REQ_DONE    BIT(1)
>> @@ -241,10 +242,12 @@ static int altera_freeze_br_probe(struct platform_device *pdev)
>>                 priv->enable = 1;
>>
>>         revision = readl(priv->base_addr + FREEZE_CSR_REG_VERSION);
>> -       if (revision != FREEZE_CSR_SUPPORTED_VERSION)
>> +       if ((revision != FREEZE_CSR_SUPPORTED_VERSION) &&
>> +           (revision != FREEZE_CSR_OFFICIAL_VERSION))
>>                 dev_warn(dev,
>> -                        "%s Freeze Controller unexpected revision %d != %d\n",
>> -                        __func__, revision, FREEZE_CSR_SUPPORTED_VERSION);
>> +                        "%s unexpected revision 0x%x != 0x%x != 0x%x\n",
>> +                        __func__, revision, FREEZE_CSR_SUPPORTED_VERSION,
>> +                        FREEZE_CSR_OFFICIAL_VERSION);
>
> Maybe you actually wanna bail out if you read a random other value
> instead of what you
> expect instead of printing a warning.

I thought about making it an error if the version didn't match, but it was 
a dev_warn() before and that allowed folks to use the "old" driver with 
the new IP version.

>>
>>         return fpga_bridge_register(dev, FREEZE_BRIDGE_NAME,
>>                                     &altera_freeze_br_br_ops, priv);
>> --
>> 2.7.4
>>
>
> Cheers,
>
> Moritz
>

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] fpga fr br: fix warning for unexpected version number matthew.gerlach@linux.intel.com - 2017-04-05 21:10 +0200
  Re: [PATCH] fpga fr br: fix warning for unexpected version number Moritz Fischer <mdf@kernel.org> - 2017-04-05 22:20 +0200
    Re: [PATCH] fpga fr br: fix warning for unexpected version number matthew.gerlach@linux.intel.com - 2017-04-06 00:30 +0200
      Re: [PATCH] fpga fr br: fix warning for unexpected version number Moritz Fischer <mdf@kernel.org> - 2017-04-06 02:20 +0200

csiph-web