Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp392460lqs; Thu, 13 Jun 2024 13:08:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXMaUozsq7P/gO1+YEX8oQfkXFVzIokiOjAmUy7zEKXy1g7dvky0nWavXHJqriErjjwCEJE+0QAiwOQVqCtvMvZ1OoOySMTkIAw8QZq2g== X-Google-Smtp-Source: AGHT+IGjsxbV1dIOQzfIRu0LidRPmBVN6j4xv7Qvt7C3OMa/LyBcIJtYkXquoadAQ19K8OmwmHk4 X-Received: by 2002:a17:906:2697:b0:a68:a137:d041 with SMTP id a640c23a62f3a-a6f60cf384bmr51237966b.12.1718309280881; Thu, 13 Jun 2024 13:08:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718309280; cv=pass; d=google.com; s=arc-20160816; b=Z2M7p7MsHQPzpCk/OGF125q0x0Ce7YxifIbYRYdkC/Z79e1GM7BibZ1k0GeSVKQSev 1MIdT5+66n07ghYFBwWVI9rQFIO6YYqTOYVCoz0mH/iRqjj5Cu2C76tb2wl3XJvOnclK NYgrMRgTGEJmBOH2Mg2pUdp5KoTrIn8yS1JcdQwH7Hqx/kGUBPLSTU0uinNj3BmTy84j YaPxoKBCkCRyKfhIxNSkuQJ9a7o24ekIR9dlm2D67RXebuJL8D7bqFLprBhJcg6RwcMN 4UeRgQRUfgb+ch3xrovM2127ahRnb5AJUMa7ofBA035cahMSjHQ7DfUm2Y6qckTeXIN9 fMmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=J8nD3Tx/2ajPq4oiZeg181ZjliU9kpOqAJj/ASz1bTw=; fh=WDbjiYMiODTudgOyUUER77t+VY0aEztjnaGLb3xcTIM=; b=tT0gRBj2MHnUoUTlFgR5EjCeFtG0kcTmcfsMhBJPlhgIGsvCevHVqx/fD7MT+bOAv3 3Z/7syf9zIRmDpwEKo8tx92H3NqxQyDFuRVfqd5x+5ip5c7VuNnyM/zT7xZOgknsz/up AVv8Is45RqGqPxwZNDxWqGW0NQYUZAZL9mZjVPu49zurqcLAB8Tosp4TOk0HsNUIuPio Y6OQ40W7bCi1gf7KF5PsPAh2+JWxdagpMoQ3+ZpMX9tsXYoHlwPHBpV0Akn9HK/AEZlB 8l1xEWuMQwe98Jw2ft3LQd7leHXqwIajxgE0qllqwc4hzBl583kprt+NnwWs1IupDRM4 P+wQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gIuyn12u; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-213959-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213959-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56e26805si100507866b.780.2024.06.13.13.08.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 13:08:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213959-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gIuyn12u; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-213959-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213959-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D8BB71F25F38 for ; Thu, 13 Jun 2024 19:58:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CF607EF1F; Thu, 13 Jun 2024 19:58:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gIuyn12u" Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96FBA6E5ED for ; Thu, 13 Jun 2024 19:58:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718308729; cv=none; b=jDrdRstjaYXy/DmkS5KI1S5oNwxJ8CUYF9QMyt1QYEK8zj/q+m8wCrLGwdS9kBpJ8cKWQx4DMCdaFOzEx7oZogYffBwQV/RSIYD0UUUSV3RDzDsc7wQLR9rqnZ3Ko5ADbtMuGINo8CFrGpnrJesU5qJrtVVYZsFzBUMLn+kR/0s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718308729; c=relaxed/simple; bh=8Ssi1Wk64QWUfBb7mj4mwNzyhBvvKGpbyu23BxvyHPY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UtemEFVleErc5POqbDUpTv4PT82WplCJfeoQCeGmAcpvMCztwUkZtlrPA5oQo9P8X4M+rci3zdmBPRFbRtcy5stlQEhHIYcpXA7UtYd6IfMIc8wj7+n9iGxDN/UeqP6TB1u0GK5oS5lrj7UvPI4dzRAARLBxJQ1vEbqjie5ClM0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=gIuyn12u; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-35f1c567ae4so1290497f8f.1 for ; Thu, 13 Jun 2024 12:58:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718308726; x=1718913526; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=J8nD3Tx/2ajPq4oiZeg181ZjliU9kpOqAJj/ASz1bTw=; b=gIuyn12uaNsmCQL1WfEyhz2Fw4ZS090blHCGwLKM+y4V46dNWm7+WlA/aJHAxAXWEV VJyoZtPjJbGM2dSsx7uW6ka7I+viDfhQGpYspmWEJGBJb8GLbLXelaOnQCYWJJjo/rPP 9DMd9zLJcXjOZK73XsdftQIImeqzbIAiG7hfoqlmMhQZzpk+K2lGBX2EcBy7ZdxVI/j/ 8Qo3RX5UNqthMQDyYkxIpDJHZ3cStJcMUg6VKWIGkPEdkl+hiufJIU1wzvoHrc2fCFtm GgW0hQYP6eTKC4oAS+BA7Wd9AMPXnHduR6NsXVT1OEkWyym0wvfWdXhhl3Z3BfmXdRGc n5DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718308726; x=1718913526; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=J8nD3Tx/2ajPq4oiZeg181ZjliU9kpOqAJj/ASz1bTw=; b=EILQc+6Xq4mTkx8U0cU5Pkc9WxhKAHdounLQDgRZJIHieDhscgp8r0MqJZa3UIngrp tqK2um3IZ5ekSuU8WaNYIWV6WaA6ASx8APfnyFLF6TS4iFlwuTlB7cY+OeUYz/X0fWop +t8/8puD1ta8lyPvYz8mMwogj6b7WvKt5UwUbe5b51uvM9ccgSHhkEJQe9/YxulMDLy+ uC3FyJIwL3nKgJOSZkmLjr7VDYizNF/ihWpKhXGbfcvbfdQmxfBEqVbFcQzZUgrjArio G6N75bQax0sThGVSmXQlfxtIoosOcYxGb1k7JJ84RfHH+XIV9AdV2OsYOVzBy4Ps4GzK sX0Q== X-Forwarded-Encrypted: i=1; AJvYcCXCeJd1PtTWkX9oySJCnLdHqs2BkMZZ/SeaiUnM1FNsAhhNMuf0pTvAxxMra1hZdaXAmNSbYqVgHu1T4pA+TSVg1V4OuAb6vdQRohTE X-Gm-Message-State: AOJu0YyDPC07VzXVi1ngxB/mXmuzyMHtew61FYBThjFaVewh6nVfUiF1 NXwUlKCRzU5w3YMV+3MZ+BVxrzTK3fiHyQ37jiCnTiDKuRU1a4rrsmPEAvSigVQ= X-Received: by 2002:adf:e64c:0:b0:35f:1f3c:b632 with SMTP id ffacd0b85a97d-3607a746efbmr516075f8f.12.1718308725147; Thu, 13 Jun 2024 12:58:45 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36075104a0fsm2545651f8f.96.2024.06.13.12.58.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 12:58:44 -0700 (PDT) Date: Thu, 13 Jun 2024 22:58:40 +0300 From: Dan Carpenter To: Kieran Bingham Cc: Umang Jain , Florian Fainelli , linux-rpi-kernel@lists.infradead.org, Broadcom internal kernel review list , Greg Kroah-Hartman , Stefan Wahren , Laurent Pinchart , Dave Stevenson , detule , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "open list:STAGING SUBSYSTEM" , open list , Julia Lawall Subject: Re: [PATCH] staging: vc04_services: vchiq_arm: Fix initialisation check Message-ID: References: <20240613194150.2915202-1-kieran.bingham@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240613194150.2915202-1-kieran.bingham@ideasonboard.com> On Thu, Jun 13, 2024 at 08:41:45PM +0100, Kieran Bingham wrote: > --- > .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 4 ++-- > .../staging/vc04_services/interface/vchiq_arm/vchiq_core.h | 5 +++++ > .../staging/vc04_services/interface/vchiq_arm/vchiq_dev.c | 7 ++++++- > 3 files changed, 13 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > index 54467be8c371..67d853f5f2a0 100644 > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > @@ -804,7 +804,7 @@ int vchiq_initialise(struct vchiq_state *state, struct vchiq_instance **instance > * block forever. > */ > for (i = 0; i < VCHIQ_INIT_RETRIES; i++) { > - if (state) > + if (vchiq_remote_initialised(state)) > break; > usleep_range(500, 600); > } :/ In the original code, this would either break on the first iteration or fail. The diff looked like this: for (i = 0; i < VCHIQ_INIT_RETRIES; i++) { - state = vchiq_get_state(); if (state) break; I feel bad for not spotting this. A static checker which looked at diffs could have made this work, but all of our tools look at a momement in time instead of looking at the change over time. regards, dan carpenter