From patchwork Wed Feb 11 09:46:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 44572 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 58D6F2151F for ; Wed, 11 Feb 2015 09:47:24 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id w7sf1470628lbi.0 for ; Wed, 11 Feb 2015 01:47:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=bF04wHMzIEEvPofXdkGL/TAKqFirwTTTiocctecBHwk=; b=FCkKw/6lXZGsXsMX6XiDWDGJx7ECiG7Yc30mzuhEvfdSN2sbJaOoG08LrTjlEwphKH 4EGc1O7MGv0C+EHf3mha6fEgR5qJPMXX8eyIBq+R1UZNmLNfSKgVUlaFQQJe4xUgwfj2 Lb4Na+46vIbcVU7qGjB3JdPN9FLrS039NBrWSo6Vj/YgN6ZrP8j3uExgk7Ok+zzr8aDH YaYZJXdJEnKGdLOyRRl1Gr+E75U0yifB7XFVW7D6E/xsV1ADCW2Aa/VuIXdLuIvUOUwR HuqMeyJhCL7euySKBrNzJap7RZc4N6PsTnS20rQKD47aEGCViqHrIIkeQdPEpC1FKH8b DcvA== X-Gm-Message-State: ALoCoQll2UgUxClgC7fErtWLvig6rOn7dxxfBxx82XcWB+kbv6el/9UhwRqsoyD5EvrbagRcIrX1 X-Received: by 10.152.43.166 with SMTP id x6mr3352752lal.3.1423648042804; Wed, 11 Feb 2015 01:47:22 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.38 with SMTP id p6ls43053lap.49.gmail; Wed, 11 Feb 2015 01:47:22 -0800 (PST) X-Received: by 10.112.63.196 with SMTP id i4mr26660199lbs.27.1423648042533; Wed, 11 Feb 2015 01:47:22 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id ta1si196484lbb.67.2015.02.11.01.47.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 01:47:22 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id f15so1288580lbj.13 for ; Wed, 11 Feb 2015 01:47:22 -0800 (PST) X-Received: by 10.112.54.167 with SMTP id k7mr26699482lbp.72.1423648042410; Wed, 11 Feb 2015 01:47:22 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1141395lbj; Wed, 11 Feb 2015 01:47:21 -0800 (PST) X-Received: by 10.66.162.41 with SMTP id xx9mr12303027pab.68.1423648040600; Wed, 11 Feb 2015 01:47:20 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si392478pdi.19.2015.02.11.01.47.19; Wed, 11 Feb 2015 01:47:20 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752745AbbBKJrO (ORCPT + 28 others); Wed, 11 Feb 2015 04:47:14 -0500 Received: from mail-pd0-f181.google.com ([209.85.192.181]:39980 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752693AbbBKJqw (ORCPT ); Wed, 11 Feb 2015 04:46:52 -0500 Received: by pdev10 with SMTP id v10so3318132pde.7 for ; Wed, 11 Feb 2015 01:46:51 -0800 (PST) X-Received: by 10.70.10.100 with SMTP id h4mr45204923pdb.10.1423648011415; Wed, 11 Feb 2015 01:46:51 -0800 (PST) Received: from khorivan.itg.ti.com ([210.177.145.249]) by mx.google.com with ESMTPSA id c9sm360560pdm.51.2015.02.11.01.46.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Feb 2015 01:46:50 -0800 (PST) From: Ivan Khoronzhuk To: matt.fleming@intel.com, ard.biesheuvel@linaro.org Cc: leif.lindholm@linaro.org, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [Patch 3/3] firmware: dmi_scan: use full dmi version for SMBIOS3 Date: Wed, 11 Feb 2015 11:46:32 +0200 Message-Id: <1423647992-3787-4-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1423647992-3787-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1423647992-3787-1-git-send-email-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ivan.khoronzhuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , New SMBIOS3 spec adds additional field for versioning - docrev. The docrev identifies the revision of a specification implemented in the table structures, so display SMBIOS version > 3 in format, like: 3.22.1 It's not affect on other part of code because version number is analyzed using comparing, and it's obvious that 0x000208 is less than 0x030201 for example. Signed-off-by: Ivan Khoronzhuk --- drivers/firmware/dmi_scan.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 952e95c..e4a2d25 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -17,7 +17,7 @@ */ static const char dmi_empty_string[] = " "; -static u16 __initdata dmi_ver; +static u32 dmi_ver __initdata; static u32 dmi_len; static u16 dmi_num; /* @@ -534,7 +534,8 @@ static int __init dmi_smbios3_present(const u8 *buf) { if (memcmp(buf, "_SM3_", 5) == 0 && buf[6] < 32 && dmi_checksum(buf, buf[6])) { - dmi_ver = get_unaligned_be16(buf + 7); + dmi_ver = get_unaligned_be32(buf + 6); + dmi_ver &= 0xFFFFFF; dmi_len = get_unaligned_le32(buf + 12); dmi_base = get_unaligned_le64(buf + 16); smbios_header_size = buf[6]; @@ -553,8 +554,9 @@ static int __init dmi_smbios3_present(const u8 *buf) dmi_num = dmi_len / 4; if (dmi_walk_early(dmi_decode) == 0) { - pr_info("SMBIOS %d.%d present.\n", - dmi_ver >> 8, dmi_ver & 0xFF); + pr_info("SMBIOS %d.%d.%d present.\n", + dmi_ver >> 16, (dmi_ver >> 8) & 0xFF, + dmi_ver & 0xFF); dmi_format_ids(dmi_ids_string, sizeof(dmi_ids_string)); pr_debug("DMI: %s\n", dmi_ids_string); return 0;