From patchwork Mon May 25 14:35:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 476221 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 38E011401B5 for ; Tue, 26 May 2015 00:36:05 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=fDNzatTC; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ED0E04B6F8; Mon, 25 May 2015 16:35:52 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6TX9HwafAxAO; Mon, 25 May 2015 16:35:52 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 02BAD4B69A; Mon, 25 May 2015 16:35:52 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C444F4B6DF for ; Mon, 25 May 2015 16:35:37 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D7_y40i4yclS for ; Mon, 25 May 2015 16:35:37 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-qg0-f42.google.com (mail-qg0-f42.google.com [209.85.192.42]) by theia.denx.de (Postfix) with ESMTPS id 07CD54B6BD for ; Mon, 25 May 2015 16:35:31 +0200 (CEST) Received: by qgez61 with SMTP id z61so45998134qge.1 for ; Mon, 25 May 2015 07:35:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:subject:date:in-reply-to:references:mime-version :content-type; bh=utRHcttjN/rmIW7DuK0CtV6obABn1w/FjQ6MYlV2U6E=; b=fDNzatTCwts7CnWGWQ7+hzCMBYbgFGmacR4kguYUakr+PsB9RZzCJUS0VU3roxdTuV FfIUdzoQHeaxE2HbvL7SYTZHN8SHrWkR9MAldwpEmCfMPScVMILITf2SMnOqW5lGtS08 9PnYekZrKThmMRwtRKk6xELDT+PVVba7XjIn2e2XjtZSkKMHuHoJJWfNdy4k57yax4nz plRZOwiL3M6iPm3CSkCCCnJmUdOl+r48xegMw0nrF+85UxNSwygPkHOqK9CN44yRcuG3 qdBDjF2FRyBjXLYo2rxXwPW0S74Gr8nKUMXm7Djw3B56oto6fagdqJ6pm8KxRiWd9T7o RivA== X-Received: by 10.55.23.130 with SMTP id 2mr44674366qkx.33.1432564530891; Mon, 25 May 2015 07:35:30 -0700 (PDT) Received: from mail.hotmail.com (blu004-wss1s5.hotmail.com. [134.170.2.220]) by mx.google.com with ESMTPSA id f15sm4264541qkh.23.2015.05.25.07.35.30 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 May 2015 07:35:30 -0700 (PDT) Received: from BLU437-SMTP81 ([134.170.2.215]) by BLU004-WSS1S5.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Mon, 25 May 2015 07:35:29 -0700 X-TMN: [eNQ8ZtFm93ApnPynJbL5ClnR8BTquA9C] Message-ID: From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Mon, 25 May 2015 22:35:07 +0800 X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1432564507-23841-1-git-send-email-bmeng.cn@gmail.com> References: <1432564507-23841-1-git-send-email-bmeng.cn@gmail.com> X-OriginalArrivalTime: 25 May 2015 14:35:28.0856 (UTC) FILETIME=[0BD8D580:01D096F8] MIME-Version: 1.0 Subject: [U-Boot] [PATCH v2 4/4] x86: Do sanity test on pirq table before writing X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" If pirq_routing_table points to NULL, that means U-Boot fails to generate the table before in create_pirq_routing_table(), so we test it against NULL before actually writing it. Signed-off-by: Bin Meng Acked-by: Simon Glass --- Changes in v2: None arch/x86/cpu/irq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/cpu/irq.c b/arch/x86/cpu/irq.c index d1711af..74b89ad 100644 --- a/arch/x86/cpu/irq.c +++ b/arch/x86/cpu/irq.c @@ -209,5 +209,8 @@ void pirq_init(void) u32 write_pirq_routing_table(u32 addr) { + if (!pirq_routing_table) + return addr; + return copy_pirq_routing_table(addr, pirq_routing_table); }