From patchwork Thu Dec 18 04:57:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eliot Blennerhassett X-Patchwork-Id: 5510391 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CB774BEEA8 for ; Thu, 18 Dec 2014 04:58:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EBFD3209AB for ; Thu, 18 Dec 2014 04:58:40 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 0D9AB209EA for ; Thu, 18 Dec 2014 04:58:39 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id F0B8E261552; Thu, 18 Dec 2014 05:58:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 8BBB1261554; Thu, 18 Dec 2014 05:58:21 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id ABEBC261557; Thu, 18 Dec 2014 05:58:20 +0100 (CET) Received: from smtp4.clear.net.nz (smtp4.clear.net.nz [203.97.37.64]) by alsa0.perex.cz (Postfix) with ESMTP id 06E662614AF for ; Thu, 18 Dec 2014 05:57:51 +0100 (CET) Received: from mxin3-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp4.clear.net.nz (CLEAR Net Mail) with ESMTP id <0NGR009DFHRSW910@smtp4.clear.net.nz> for alsa-devel@alsa-project.org; Thu, 18 Dec 2014 17:57:30 +1300 (NZDT) Received: from 121-72-250-62.cable.telstraclear.net (HELO eliot.lan) ([121.72.250.62]) by smtpin3.clear.net.nz with ESMTP; Thu, 18 Dec 2014 17:57:29 +1300 Date: Thu, 18 Dec 2014 17:57:13 +1300 From: eliot@blennerhassett.gen.nz To: alsa-devel@alsa-project.org Message-id: <1418878635-18960-1-git-send-email-eliot@blennerhassett.gen.nz> X-Mailer: git-send-email 1.9.1 Cc: tiwai@suse.de, Eliot Blennerhassett Subject: [alsa-devel] [PATCH 1/3] ALSA: asihpi: relax firmware version check X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eliot Blennerhassett Some products firmware is no longer being updated e.g. dsp5000, dsp8700 but it should continue to work with updated HPI versions. Avoid regression by allowing this firmware to be loaded as long as major version is the same. Warn about mismatching versions, as matching versions are preferred. Signed-off-by: Eliot Blennerhassett --- sound/pci/asihpi/hpidspcd.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/sound/pci/asihpi/hpidspcd.c b/sound/pci/asihpi/hpidspcd.c index ac91637..3603c24 100644 --- a/sound/pci/asihpi/hpidspcd.c +++ b/sound/pci/asihpi/hpidspcd.c @@ -1,8 +1,9 @@ -/***********************************************************************/ -/** +/*********************************************************************** AudioScience HPI driver - Copyright (C) 1997-2011 AudioScience Inc. + Functions for reading DSP code using hotplug firmware loader + + Copyright (C) 1997-2014 AudioScience Inc. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as @@ -17,11 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -\file -Functions for reading DSP code using -hotplug firmware loader from individual dsp code files -*/ -/***********************************************************************/ +***********************************************************************/ #define SOURCEFILE_NAME "hpidspcd.c" #include "hpidspcd.h" #include "hpidebug.h" @@ -68,17 +65,18 @@ short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code, goto error2; } - if ((header.version >> 9) != (HPI_VER >> 9)) { - /* Consider even and subsequent odd minor versions to be compatible */ - dev_err(&dev->dev, "Incompatible firmware version DSP image %X != Driver %X\n", + if (HPI_VER_MAJOR(header.version) != HPI_VER_MAJOR(HPI_VER)) { + /* Major version change probably means Host-DSP protocol change */ + dev_err(&dev->dev, + "Incompatible firmware version DSP image %X != Driver %X\n", header.version, HPI_VER); goto error2; } if (header.version != HPI_VER) { - dev_info(&dev->dev, - "Firmware: release version mismatch DSP image %X != Driver %X\n", - header.version, HPI_VER); + dev_warn(&dev->dev, + "Firmware version mismatch: DSP image %X != Driver %X\n", + header.version, HPI_VER); } HPI_DEBUG_LOG(DEBUG, "dsp code %s opened\n", fw_name);