From patchwork Tue Nov 10 17:20:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 1397750 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CVvlW2Rfdz9sTL for ; Wed, 11 Nov 2020 04:20:54 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1kcXK5-00088q-2k; Tue, 10 Nov 2020 17:20:49 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kcXK3-00088i-TC for fwts-devel@lists.ubuntu.com; Tue, 10 Nov 2020 17:20:47 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kcXK3-0004Uk-Lc; Tue, 10 Nov 2020 17:20:47 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] lib: fwts_cmos: remove cli/sti assembler from cmos reading Date: Tue, 10 Nov 2020 17:20:47 +0000 Message-Id: <20201110172047.3401279-1-colin.king@canonical.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" From: Colin Ian King Recent Linux kernel config defaults will not allow messing around with the interrupt disable/enable from userspace and will segfault the code. Remove these as they don't really need to be used and we just need to remember that updates to CMOS data may occur under kernel control while it is being read by fwts. Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Ivan Hu --- src/lib/src/fwts_cmos.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib/src/fwts_cmos.c b/src/lib/src/fwts_cmos.c index b40c8100..6b285eac 100644 --- a/src/lib/src/fwts_cmos.c +++ b/src/lib/src/fwts_cmos.c @@ -47,7 +47,6 @@ int fwts_cmos_read(const uint8_t offset, uint8_t *value) goto tidy0x80; } - asm("cli"); /* specify offset to read */ if (fwts_outb(offset, 0x70) != FWTS_OK) { ret = FWTS_ERROR; @@ -64,7 +63,6 @@ int fwts_cmos_read(const uint8_t offset, uint8_t *value) if (fwts_inb(0x71, value) != FWTS_OK) ret = FWTS_ERROR; tidy: - asm("sti"); (void)iopl(0); tidy0x80: (void)ioperm(0x80, 1, 0);