From patchwork Tue Jun 5 07:13:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 925328 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 410NNs3W1Vz9s0W for ; Tue, 5 Jun 2018 17:15:09 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TrvMdych"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 410NNs20VbzF220 for ; Tue, 5 Jun 2018 17:15:09 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TrvMdych"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c00::244; helo=mail-pf0-x244.google.com; envelope-from=joel.stan@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TrvMdych"; dkim-atps=neutral Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 410NMt55hGzF1nB for ; Tue, 5 Jun 2018 17:14:18 +1000 (AEST) Received: by mail-pf0-x244.google.com with SMTP id w7-v6so778710pfn.9 for ; Tue, 05 Jun 2018 00:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=xoGcjFLNgUgpGjtp4L1B6lxzPRpFdMHb4oO2n25cfGA=; b=TrvMdych0dhWuGJe2yDTtnjG6XB13gK48vrpFf6V54fzUXud/1ql+Z1RpRh09OsfLu 0H/HRT51ovkEN1ZIj2EV/kB/OdpD3R+H4h9NdnWQWwQHb4Z/KtxDQ2Wd7mw/gFdt2s2M E+/IXZDWTuY8bnrVij44Tl1l/gpIrJ9sRKjBjIveFxfwGXDWTXtXob3atI50rXomU4PZ /7oen9zCGbzZMNtpAOTpbCCBCVy78N8xWeXKE1p8R9cODotKpRVmcSXIXJSw9DgGr66M mgyOMacBsxOOo2LHKw2fCCciJk27wryK9pB5i2v9bNaii+ZsSVMhfCZoJ4sgszBPMqSd 7uTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=xoGcjFLNgUgpGjtp4L1B6lxzPRpFdMHb4oO2n25cfGA=; b=h2TtdwgrGmxp5cSb4ajA0UoB4t2myQoWgJ33IkFXFVOadQnqRCryWK7vhOvGh8luRo N2ouNyhptIZTNqR0ANUErrg00fNxrx1GJL4qIlqynweon/YFBcsS5j7RInAtZj9X8eTS 2CCFTzBv/BmLhX0d4ebGN+2AA7UOdWwgxcNF6P2cVuFb4xKJQ55ARyeMwq10fc41dWVU Mw1CMzt+99n6ffMcPSXxWuHonIlnmQDCTv7Nk0aGXP/PIgzDgXRti2PA0LU4VAKT4MZS uU72yMjgxdFiVKsS+EINwksSsHwAvltmsVPe4StvhvLpsy+uZN9UO2KX37R/I1n57ZKa HSnw== X-Gm-Message-State: ALKqPwc3DKp4XXdvxeH7YYopxNaBU8sbUwiXiMxmuWHBIOA1Z0PMhcYj UVWJ6pUTjMFtEckLxCbJNd2/9uQw X-Google-Smtp-Source: ADUXVKKAZXSvtX5cjT4HYShwNHYLrqtrhn/m/rh8C3suPwrBaqOPlaTA8QGW47/jwlB1QegZQC9xTg== X-Received: by 2002:a63:384d:: with SMTP id h13-v6mr19774623pgn.209.1528182856456; Tue, 05 Jun 2018 00:14:16 -0700 (PDT) Received: from aurora.jms.id.au ([203.0.153.9]) by smtp.gmail.com with ESMTPSA id s17-v6sm103435445pfi.165.2018.06.05.00.14.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 00:14:15 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Tue, 05 Jun 2018 16:44:10 +0930 From: Joel Stanley To: skiboot@lists.ozlabs.org Date: Tue, 5 Jun 2018 16:43:37 +0930 Message-Id: <20180605071337.22915-5-joel@jms.id.au> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180605071337.22915-1-joel@jms.id.au> References: <20180605071337.22915-1-joel@jms.id.au> Subject: [Skiboot] [PATCH 4/4] psi: Properly mask errors in SEMR X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ananth N Mavinakayanahalli MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" It looks like this code intended to read PSIHB SEMR, mask out some of the values, and write it back. Instead it writes the mask to the register. Found using scan-build. Fixes: 39addc6a0f1f ("PSI: Reorganize PSI link down handling code") Signed-off-by: Joel Stanley Acked-by: Ananth N Mavinakayanahalli --- hw/psi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/psi.c b/hw/psi.c index f7d8cd9a459d..f5168ba96765 100644 --- a/hw/psi.c +++ b/hw/psi.c @@ -74,7 +74,7 @@ void psi_disable_link(struct psi *psi) /* Mask errors in SEMR */ reg = in_be64(psi->regs + PSIHB_SEMR); - reg = ((0xfffull << 36) | (0xfffull << 20)); + reg &= ((0xfffull << 36) | (0xfffull << 20)); out_be64(psi->regs + PSIHB_SEMR, reg); printf("PSI: SEMR set to %llx\n", reg);