Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp752534lqs; Fri, 14 Jun 2024 05:00:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU78DXopGlaC6x/YFf0dGQk60AkpJ70aJIyFnJPVrQ3oOOFGYXywMTRbPqaHKLrJwtrNXVDEvy5t91tFHH6DtL658ETeYjeJmPZukD9KQ== X-Google-Smtp-Source: AGHT+IH5RgW+xc37uAzZFgigRHjclZlFx07nsx5aJeN0h25Z2mBtTAcf4jQHv1juvl0P9qCk2vhV X-Received: by 2002:a17:906:48d:b0:a52:3583:b9d0 with SMTP id a640c23a62f3a-a6f60cef3demr172578466b.3.1718366436095; Fri, 14 Jun 2024 05:00:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718366436; cv=pass; d=google.com; s=arc-20160816; b=XNDUUWMOY+1fOUlfKIYevKRoy1vGTol52SB5uIu1+u9qBn/4YxwaNyW4/SO3SgH0FL LvEVfVUuMaL24VaUnes7pUnorcLxsZLxtk5aJUAdJAwu+rrGngNQReJdMhDYbIXlBtdK 8OVG/ig+cYD1epWfYniew4m1rupuAmLu8f+IYX1r412lH9vQZt0Diw4vtKyxK//ZcSWX WNvjSqWnN5Vzo2EXkVEu4GlR7jayDDhH+1VrYkmOxAmswwQGKo9iLCrleF60GTUCKna8 9mnB1f24p2JIPuRUuYzUpnD5+o2FQF2hTGZ2nRVYpibDuc5COq+N23qFVBjUlKZ+0sem S0Qw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:message-id:date:to:cc:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=bAlhxQStFAmZTApOJUn3JrhaamWFbMWxst5fkHbC0gU=; fh=gwCW47VynzRDCfeIZlcQamJh4XfoTwQeBaS9nJJSrfU=; b=dfhLp6CDljD/pq1sbnBwmvlSFlaEiaGmRcGw0Pg91JlbXzhrY5sZVrp7bJtnZbAj/P k4TI6hWoiRl+6GtGjnQpq1G8MEKVhFRoAk+spD211RQtbZfNEM5DpVwpNx8gBO+jXx2k Y3tvLDCtYFtZjTZizxEJl+NrVtylvEBSD8D9+vPhdi/5f5MGq8p3pvYGwrI/Qk7wBXI3 nkooAWy9AwXGq1nQus0TVC6onJXxlFV3nsbmgC7hdEPc3hjEr6V4uqFAmj6XivOrGZT4 QVTj3GOAfQurQW/UYMZFPEjZchl5jUcyvJ773ZSXfv2F6YhHnQzsp/JNkEPdI4mlbxeG FWQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Zmo2T1k1; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-214857-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214857-linux.lists.archive=gmail.com@vger.kernel.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-a6f56e809ecsi164379766b.1002.2024.06.14.05.00.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 05:00:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214857-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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=Zmo2T1k1; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-214857-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214857-linux.lists.archive=gmail.com@vger.kernel.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 CE91B1F2198E for ; Fri, 14 Jun 2024 12:00:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9ECDB811FE; Fri, 14 Jun 2024 12:00:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Zmo2T1k1" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64FDE19596D for ; Fri, 14 Jun 2024 12:00:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718366426; cv=none; b=U3j6LHgoLM/C4uR0W5UGAKuktqY0Zf2eMQdjwqiBl34MQfQAd1e+J9skUPIkRLN33R/JWIMwZuDXrtgNRmCdZDuQmCSyLgkuli6Gqh7BuDcK91LhSWKKeemJ3XbgRYnhQXrs9UDbodyXrwtBmFHPULmamsyoCPDOx+xIYuXjKXs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718366426; c=relaxed/simple; bh=bAlhxQStFAmZTApOJUn3JrhaamWFbMWxst5fkHbC0gU=; h=Content-Type:MIME-Version:In-Reply-To:References:Subject:From:Cc: To:Date:Message-ID; b=s7zPDGTpupNFRndFqhUNVUiidla+uLEFL2w8mLISJdNztDBAE2P48dcjwYJ+/aN/JdHlI5emwfCAjyL7b7+9gvRh92vgqIkVJO+m7BpJgTbCJz47sEMYeCER8ISeWYQZKdAAsfa0UMU9E1SK0jfBDPQtK0HNWbVuV/hcnPlCe2E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=Zmo2T1k1; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3ABA310C4; Fri, 14 Jun 2024 14:00:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1718366408; bh=bAlhxQStFAmZTApOJUn3JrhaamWFbMWxst5fkHbC0gU=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=Zmo2T1k1JxFY7Ox3jeUaRrzQNPwnyou67p0Hk1qjQkB3kuQV2Vebe+OKunm5vb/6w Ir5w6cx1/YWrUUBK0OxpRjO1wwu1M9hiWtbfIjdOtE+HsGidYNwWwpdRm2W9qKc2kN 4OW8ynggelj4VVeVy9npTBOm2hIudjAUC/aUuGhw= Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <104f23d7-9832-4c06-92c7-d3ea84fbf186@gmx.net> References: <20240613194150.2915202-1-kieran.bingham@ideasonboard.com> <20240613194150.2915202-2-kieran.bingham@ideasonboard.com> <082d9df0-0947-4452-a3fc-87eab2019e01@gmx.net> <171836496531.2248009.11650291484570726735@ping.linuxembedded.co.uk> <104f23d7-9832-4c06-92c7-d3ea84fbf186@gmx.net> Subject: Re: [PATCH] staging: vc04_services: vchiq_arm: Fix initialisation check From: Kieran Bingham Cc: Broadcom internal kernel review list , Greg Kroah-Hartman , Laurent Pinchart , Dave Stevenson , detule , Dan Carpenter , BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE , STAGING SUBSYSTEM , open list To: Florian Fainelli , Stefan Wahren , Umang Jain , linux-rpi-kernel@lists.infradead.org Date: Fri, 14 Jun 2024 13:00:19 +0100 Message-ID: <171836641941.2248009.7362589437453917188@ping.linuxembedded.co.uk> User-Agent: alot/0.10 Quoting Stefan Wahren (2024-06-14 12:52:53) > Hi Kieran, >=20 > Am 14.06.24 um 13:36 schrieb Kieran Bingham: > > Hi Stefan, > > > > Sorry, indeed I completely missed this mail. > > > > Quoting Stefan Wahren (2024-06-13 21:01:42) > >> Hi Kieran, > >> > >> Am 13.06.24 um 21:41 schrieb Kieran Bingham: > >>> The vchiq_state used to be obtained through an accessor > >>> which would validate that the VCHIQ had been initialised > >>> correctly with the remote. > >>> > >>> In commit 42a2f6664e18 ("staging: vc04_services: Move global g_state = to > >>> vchiq_state") the global state was moved to the vchiq_mgnt structures > >>> stored as a vchiq instance specific context. This conversion removed = the > >>> helpers and instead replaced users of this helper with the assumption > >>> that the state is always available and the remote connected. > >>> > >>> Fix this broken assumption by re-introducing the logic that was lost > >>> during the conversion. > >> thank you for sending this patch. Maybe it's worth to mention that this > >> patch also drop some unnecessary NULL checks of state. > > I don't understand this comment. Nothing is dropped is it? > > > > The newly added vchiq_remote_initialised() is itself a null-check too! > the vchiq_remote_initialised() only checks the member remote, but not > state itself. From my point of view the null-check for state is > unnecessary, because most of the code already assumed that state is not > null like e.g. in vchiq_open(). >=20 aha, I misread my own code ;-) Of course - I see it now. I'll send v3. -- Kieran