From patchwork Tue Jun 5 07:13:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 925325 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 410NMr1cqKz9s1B for ; Tue, 5 Jun 2018 17:14:16 +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="SE424EL5"; 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 410NMq59gDzF1g0 for ; Tue, 5 Jun 2018 17:14:15 +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="SE424EL5"; 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:c01::244; helo=mail-pl0-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="SE424EL5"; dkim-atps=neutral Received: from mail-pl0-x244.google.com (mail-pl0-x244.google.com [IPv6:2607:f8b0:400e:c01::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 410NMT3yZkzF1mw for ; Tue, 5 Jun 2018 17:13:57 +1000 (AEST) Received: by mail-pl0-x244.google.com with SMTP id c23-v6so956016plz.12 for ; Tue, 05 Jun 2018 00:13:57 -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=52ATi/osT8Kw6qNYY5vv+95BHSlFlChvzggt8UDioD4=; b=SE424EL5+0slhUb6Iz0Woqfvl16wU1ef9BLJW0IbAgA2nxmpcuW5fCWBlqsdg5yLm9 NkuH5kJW8apLSYvo4kcY7zWuQ8ZfbJ6c9L2Y3tkSdTzxqCRRBjjjXZdSpikncVsbOENv WCIOHk9oGHEAIQHOfdvoQG8tn8kr1I5n2HrUP1+OI625HoR2cmNwGK5abCAx2+aijlCM wd00Fqls2zee7KxTTg1p/I0V93a6bxgDym7uaW0oNmx9cN/nLB1jPLkJfteGiCOzMrFs UR14BPiS0VRUMN2HJQN1sEec/97pkBy3OlXxWE4qJoZmSeGqWJlFc1ToLst4uad4ZjEc TRLw== 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=52ATi/osT8Kw6qNYY5vv+95BHSlFlChvzggt8UDioD4=; b=Fz29CiX5Z25/E8J2QPQ1gTXt0CMNn6CmoNDQBeVe1Pa/dnYlsV4mWoUHqZCDuhWEyD Cnyik4s1AQwZ3oTO9oHhPwjTeghQ9fBAf7FawX0zeFDmJbvOJbyJJjfA11b0/5sZGgef s61S3NPcP0TdOsayJrHaVa48IRq7s+856FBpirT5yvLAHM8WTEyqmw9G4rDqZebw1S9N zTe1CWz6sL9G5bYxZrMteyzteRsHPvdAcl9S9XhFPgE13/nOlOX75r6En4IczH8Rq/sa zZ7wJhLQ/8wabgmCvsQP9CqRl6XTYXdBIr1mkJXJXPfwW27nb5f6ErS2DLnl1fElWJE8 9Yhg== X-Gm-Message-State: ALKqPwfSIMmbT1esYH1HVlLkoZiu3yIhCZq3joNXdmdXvG87S9RUOayW zo0gClNXR+JyvkwWIqB1kJPVd4UO X-Google-Smtp-Source: ADUXVKLa/y5Z2i/qNo6XvMIpclzhmzLGp/HffbEkMOa7TD5lEU9QUrgxx5hxhADVk/XUsW+TObIQWQ== X-Received: by 2002:a17:902:7688:: with SMTP id m8-v6mr22337078pll.54.1528182835151; Tue, 05 Jun 2018 00:13:55 -0700 (PDT) Received: from aurora.jms.id.au ([203.0.153.9]) by smtp.gmail.com with ESMTPSA id y8-v6sm39201026pgq.75.2018.06.05.00.13.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 00:13:54 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Tue, 05 Jun 2018 16:43:48 +0930 From: Joel Stanley To: skiboot@lists.ozlabs.org Date: Tue, 5 Jun 2018 16:43:34 +0930 Message-Id: <20180605071337.22915-2-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 1/4] occ-sensor: Avoid using uninitialised struct cpu_thread 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: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" When adding the sensors in occ_sensors_init, if the type is not OCC_SENSOR_LOC_CORE, then the loop to find 'c' will not be executed. Then c->pir is used for both of the the add_sensor_node calls below. This provides a default value of 0 instead. Found using scan-build. Signed-off-by: Joel Stanley Reviewed-by: Shilpasri G Bhat --- It may not be the correct fix. Please review closely. --- hw/occ-sensor.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/occ-sensor.c b/hw/occ-sensor.c index a31a2a5d6dea..783f75740c42 100644 --- a/hw/occ-sensor.c +++ b/hw/occ-sensor.c @@ -543,6 +543,7 @@ bool occ_sensors_init(void) for (i = 0; i < hb->nr_sensors; i++) { const char *type, *loc; struct cpu_thread *c = NULL; + uint32_t pir = 0; if (md[i].structure_type != OCC_SENSOR_READING_FULL) continue; @@ -565,6 +566,7 @@ bool occ_sensors_init(void) break; if (!c) continue; + pir = c->pir; } type = get_sensor_type_string(md[i].type); @@ -572,7 +574,7 @@ bool occ_sensors_init(void) add_sensor_node(loc, type, i, SENSOR_SAMPLE, &md[i], &phandles[phcount], &ptype[phcount], - c->pir, occ_num, chip->id); + pir, occ_num, chip->id); phcount++; /* Add energy sensors */ @@ -581,7 +583,7 @@ bool occ_sensors_init(void) add_sensor_node(loc, "energy", i, SENSOR_ACCUMULATOR, &md[i], &phandles[phcount], &ptype[phcount], - c->pir, occ_num, chip->id); + pir, occ_num, chip->id); phcount++; } From patchwork Tue Jun 5 07:13:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 925326 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 410NND1wK5z9s0W for ; Tue, 5 Jun 2018 17:14:36 +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="tbae1Oqz"; 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 410NND0MQzzF1nZ for ; Tue, 5 Jun 2018 17:14:36 +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="tbae1Oqz"; 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:c05::241; helo=mail-pg0-x241.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="tbae1Oqz"; dkim-atps=neutral Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (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 410NMd1zJczF1mC for ; Tue, 5 Jun 2018 17:14:05 +1000 (AEST) Received: by mail-pg0-x241.google.com with SMTP id p21-v6so717051pgd.11 for ; Tue, 05 Jun 2018 00:14:05 -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=eLcbawZvFdEID9AKoajRgluTdil9cmqiSrrZp8dHz20=; b=tbae1OqzgPrxQx99+tcUiT85CjmXiw/uNPXlo5TQ9ksjGlsj8JewugpPELThuWXiBZ m91fYzZciLYi1YLvWcFJoxp2U/IpR6LcG8g/56Lwuf1SSutRD0FL6+WyuZ+kTZCLPc5Q Z50XiQQ2X0dakCZx5GSBvixyNZiNNZHDjAZlpkyDl42Pn08MzCi+9HjbaYtWiuOXPdYy EFEKrBHTH+fTStWte3EOszZrB66c8D7mX2WPhBIg5UqFNtR1r5MBVTT16hCQUb1BD7KR ohAhUtIkZ7bs8qph2VI95BOhR/tbMrmS9kL6kqL9K4Blmz42pqQQG9BTc5WppMPK1PgR EYxQ== 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=eLcbawZvFdEID9AKoajRgluTdil9cmqiSrrZp8dHz20=; b=nRIUMeDmsWy6F4Dxwp3xDLkes7bpZ3rmhkojc6t4AXkaV04HznLNOYsxl2yFAUizkE z1FUr0U97p4NEKGEqLk5gk7HCX8KzxW6RrSnUA0HiaBn1vHgaox3Ze44IApcIvEi8kbJ ctmllc9+tx1JIg75HchEvAtBIdlkL/C2lBUBmTfvcN/h8MJ5gGTq7B6kTqUebRrBTiJh 5uYoVXfKVRaFtSNlZy9bJIPab052H+976kDkPe3eZHB5EQoLVvDsYL1SPvpm5IH9Cgdw 3THz+wFQ2UeHZnxaTNkHK4v1z8eCb7uPvEEw06Ikn5r5N6OhT/E5F3FiadLTCjHsqvHI EqaQ== X-Gm-Message-State: ALKqPwd66AnMxyXMdIG0S07MrwAKLgz447HF4pzqSqNHSbbNWzS/0A0m kX89+AcLo7zwaq9QJWd/it1+NHat X-Google-Smtp-Source: ADUXVKJQIoVM07S1WxxWKoxCCt7YcPKMNmJs2vXvXkSjzydWZ3kmTOMOYvo7phvHwg69J1y2MXy2aQ== X-Received: by 2002:a62:9652:: with SMTP id c79-v6mr24622565pfe.114.1528182842046; Tue, 05 Jun 2018 00:14:02 -0700 (PDT) Received: from aurora.jms.id.au ([203.0.153.9]) by smtp.gmail.com with ESMTPSA id k186-v6sm96736350pfc.142.2018.06.05.00.13.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 00:14:01 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Tue, 05 Jun 2018 16:43:56 +0930 From: Joel Stanley To: skiboot@lists.ozlabs.org Date: Tue, 5 Jun 2018 16:43:35 +0930 Message-Id: <20180605071337.22915-3-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 2/4] timebase: Remove unused remaining time calculation 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: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" In db9c1422002c ("Improve cpu_idle when PM is disabled") the time_wait_poll calculation was modified to calculate the remaining time on each loop. Because of this we don't need to decrement remaining any more. Found by scan-build. Signed-off-by: Joel Stanley --- core/timebase.c | 1 - 1 file changed, 1 deletion(-) diff --git a/core/timebase.c b/core/timebase.c index 777e4ba6b668..24e72959f542 100644 --- a/core/timebase.c +++ b/core/timebase.c @@ -41,7 +41,6 @@ static void time_wait_poll(unsigned long duration) if (remaining >= period) { opal_run_pollers(); time_wait_nopoll(period); - remaining -= period; } else time_wait_nopoll(remaining); From patchwork Tue Jun 5 07:13:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 925327 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 410NNY3L7hz9s0W for ; Tue, 5 Jun 2018 17:14:53 +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="XCdOJwi5"; 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 410NNY1mylzF1wt for ; Tue, 5 Jun 2018 17:14:53 +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="XCdOJwi5"; 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:c01::22a; helo=mail-pl0-x22a.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="XCdOJwi5"; dkim-atps=neutral Received: from mail-pl0-x22a.google.com (mail-pl0-x22a.google.com [IPv6:2607:f8b0:400e:c01::22a]) (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 410NMm2dypzF1kw for ; Tue, 5 Jun 2018 17:14:12 +1000 (AEST) Received: by mail-pl0-x22a.google.com with SMTP id g20-v6so977853plq.1 for ; Tue, 05 Jun 2018 00:14:12 -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=UWbazarCcwLjZ2DjHVnbIROb2emybdaQmwV0NweD83I=; b=XCdOJwi5z75OQJg34elQtCvPNTq4Q2SU/9Gv9hrBUhuUoCBUfbLzvUf4SnZF63KVud 395LtNa07yrhYjOVk3+g7I7f0LnIzZ4G0ckbkYrj6QeRP+j66mwgm/LwYRWn+ovkFwvF QVl/M8SoNW9HxHhUv2XeO9wGtV3u+rsVBawhBZfVpIZYtScIl96ID4CM11358MTldAL1 gzctS30eUoi3YOVSGhQ1V2I1vB+mVCq8zgkepsT+UjOAUX8xNsWfaazL0G9aUHAdiDWM s3Y7z3A9cpPvNDw1odPXVnaUpV2EZtHPCYXazXggis+T2sMoNOresWWT9zYzTbzoOU3G 7Ocg== 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=UWbazarCcwLjZ2DjHVnbIROb2emybdaQmwV0NweD83I=; b=K141e3QnUNalylDFw+cA2HYwXrUlmcH3VnYHo2+1KDfrHrq+Zfvw9aU7AzapVxGHBL +O+rVuS2vypU0M9WoSed5QPvOuPWcg9MBBj0pvPCJLPpFPi4FKM/LrM8rR6xnESMbuib m2Urw0GC9RLCva7g++Rq3c0iA8qYP5kH+Aal+JVsUxKST79ozUcJOV99GmAXFxEuKQr/ A7F+MalstMLqZkI37TtmkbYy5rU9sSEXIVugmo9Pie6NZObT5zWf0krObQG02GvysBoK PP6QpLqbSptZR9KvNw7d3uCbCp3ciMjE+ywz3Zz8i2/5GaEKwPuLOK098KllpOahe5s7 ZI+A== X-Gm-Message-State: ALKqPwelKhy7JTYgFIYW3/9AiOeVdYRnFFMNi8Nl3A9KRxmZsygJaDCk tvDOGcTyQcV1oN35f70YgEtLwwCd X-Google-Smtp-Source: ADUXVKIteS2blLXaGr1COT9B+YuOV5kNhFvleJ8R6m3t0QA6cM1p57eRSeRp5vLfbeGAoQfIEAsKmw== X-Received: by 2002:a17:902:b195:: with SMTP id s21-v6mr19327813plr.202.1528182849809; Tue, 05 Jun 2018 00:14:09 -0700 (PDT) Received: from aurora.jms.id.au ([203.0.153.9]) by smtp.gmail.com with ESMTPSA id u19-v6sm62668219pgv.25.2018.06.05.00.14.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 00:14:09 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Tue, 05 Jun 2018 16:44:03 +0930 From: Joel Stanley To: skiboot@lists.ozlabs.org Date: Tue, 5 Jun 2018 16:43:36 +0930 Message-Id: <20180605071337.22915-4-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 3/4] hdata: Remove hn variable where it is unused 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: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Whatever this was used for appears to pre-date the public release of skiboot. Found using scan-build. Signed-off-by: Joel Stanley --- hdata/iohub.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hdata/iohub.c b/hdata/iohub.c index 1630d2a8be32..f37f5abf31c8 100644 --- a/hdata/iohub.c +++ b/hdata/iohub.c @@ -848,7 +848,6 @@ static void io_parse_slots(const struct HDIF_common_hdr *sp_iohubs, int hub_id) static void io_parse_fru(const void *sp_iohubs) { unsigned int i; - struct dt_node *hn; int count; count = HDIF_get_iarray_size(sp_iohubs, CECHUB_FRU_IO_HUBS); @@ -863,6 +862,7 @@ static void io_parse_fru(const void *sp_iohubs) for (i = 0; i < count; i++) { const struct cechub_io_hub *hub; unsigned int size, hub_id; + struct dt_node *hn; uint32_t chip_id; hub = HDIF_get_iarray_item(sp_iohubs, CECHUB_FRU_IO_HUBS, @@ -906,26 +906,25 @@ static void io_parse_fru(const void *sp_iohubs) case CECHUB_HUB_MURANO: case CECHUB_HUB_MURANO_SEGU: prlog(PR_INFO, "CEC: Murano !\n"); - hn = io_add_p8(hub, sp_iohubs); + io_add_p8(hub, sp_iohubs); break; case CECHUB_HUB_VENICE_WYATT: prlog(PR_INFO, "CEC: Venice !\n"); - hn = io_add_p8(hub, sp_iohubs); + io_add_p8(hub, sp_iohubs); break; case CECHUB_HUB_NIMBUS_SFORAZ: case CECHUB_HUB_NIMBUS_MONZA: case CECHUB_HUB_NIMBUS_LAGRANGE: prlog(PR_INFO, "CEC: Nimbus !\n"); - hn = io_add_p9(hub, sp_iohubs); + io_add_p9(hub, sp_iohubs); break; case CECHUB_HUB_CUMULUS_DUOMO: prlog(PR_INFO, "CEC: Cumulus !\n"); - hn = io_add_p9(hub, sp_iohubs); + io_add_p9(hub, sp_iohubs); break; default: prlog(PR_ERR, "CEC: Hub ID 0x%04x unsupported !\n", hub_id); - hn = NULL; } chip_id = pcid_to_chip_id(be32_to_cpu(hub->proc_chip_id)); 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);