Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp618349imu; Fri, 11 Jan 2019 06:17:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN4PmdzaCHqUDwqnGt16Am6KmbWFrfSmsEfyQfbOYUx8UjdQ8woK6f3Bx62acuE4cfP0Eo+0 X-Received: by 2002:aa7:8542:: with SMTP id y2mr14907396pfn.83.1547216266006; Fri, 11 Jan 2019 06:17:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547216265; cv=none; d=google.com; s=arc-20160816; b=U1qRwW2aEnC9fSGFVyNBf57Ll3tePicI3YboVpgbJB7zGaFfuQrBp2tZAByUH3RVoy 0rlcXZahY+wJz3agvG/1PpXKKR1lyGMK+2BFMBz9B+sbF0HeIGKW2OzxCDnWAXcUtZ3+ X6brI+IojZgKxkw0qeiHb5xUGavuN6eTNRUNK9gGU3dol1ziV/qopwldbAW2kl1yIgj5 AKggDZvfROWBASmQ9QNl+8AalRcGfUXzA4+YVpCDvHMTjRZxrvFPhJMztPdEZsSbO68d ZCOf+N2h4DeWUOsWcp1eSizTp/R35Izo/SOoC+6ijtImtypGqqxV+TBw0jfJ34dHl27R Wl2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=QooJ2+oMCgy72PaxJ/VJWzV3+0zvKgI1mojlS+3lljk=; b=Qd/WvCEdJS7HPE7Mv9AjYIshY/QCi577EW9GRXGDoIVtbH8cRjEnHEFyY6pqk8nLKU 6szm9njpcVN6xwIRy/P2ia4coJcR8Mk/aYoz9PkGcHHxeJDqNP98/lIIV1GHjUXw+J6q u4o0ziHvkFzpHv3DPz/JKDbURZ9cr0Ep42073N8YUC9N14uee+jB7GZAVqsT1D0V55Hd rSnjEQxh+AOfYLvI6Eo8h4oFR/gckD9Zw9ZFVRqEHcLhnxWAIdAgLGDzX4TXB5E5FQrD 4BtK1qOjyGZ0hB7twbvYKEAA31/zd9iIdLv4IKUsLRdcJ+6itFiYKwPej5+uqUopkcUP 3smg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@raspberrypi.org header.s=pp header.b=F6AFswdr; dkim=pass header.i=@raspberrypi.org header.s=google header.b=hPbDvnBb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=raspberrypi.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2si4329689pgu.115.2019.01.11.06.17.30; Fri, 11 Jan 2019 06:17:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@raspberrypi.org header.s=pp header.b=F6AFswdr; dkim=pass header.i=@raspberrypi.org header.s=google header.b=hPbDvnBb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=raspberrypi.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731410AbfAKLfC (ORCPT + 99 others); Fri, 11 Jan 2019 06:35:02 -0500 Received: from mx08-00252a01.pphosted.com ([91.207.212.211]:53084 "EHLO mx08-00252a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728997AbfAKLfC (ORCPT ); Fri, 11 Jan 2019 06:35:02 -0500 Received: from pps.filterd (m0102629.ppops.net [127.0.0.1]) by mx08-00252a01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0BBNF27010773 for ; Fri, 11 Jan 2019 11:34:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.org; h=from : to : cc : subject : date : message-id; s=pp; bh=QooJ2+oMCgy72PaxJ/VJWzV3+0zvKgI1mojlS+3lljk=; b=F6AFswdrcA4FsoyX0lkW8MA5v26p+s3gM1xvRAnpIap6uAWL8W0IQjtEGc4LjG1SLHsq jSPBklsMbjN7T4BPxl7xeSj/720nRsZgpf7IMmwUvwcN0UVI7stz4hgqiQPyp66BqlAz bNKFOxtBkIgq+ot7lwqPNR4oIZuuexTXKQesgGdzUdtW07LBh6Xhm32qNCRzffkyQ4Mj wNdndriNsDqa+RNIN3vqxbLtDcdmpA9zVDJujljcISZ1mYk+0RdHpTF9byY44WJSrucg WtVNyKMJU38Tfyv5OJ/c98Ax56xRShQtVWQLkDq2PlRfYTbHN8lIZbUVREiwnYvK8f9q CA== Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by mx08-00252a01.pphosted.com with ESMTP id 2ptjuub14f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK) for ; Fri, 11 Jan 2019 11:34:59 +0000 Received: by mail-wm1-f69.google.com with SMTP id f6so676628wmj.5 for ; Fri, 11 Jan 2019 03:34:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.org; s=google; h=from:to:cc:subject:date:message-id; bh=QooJ2+oMCgy72PaxJ/VJWzV3+0zvKgI1mojlS+3lljk=; b=hPbDvnBbXbE3cVvNDMHOHEDbnPNNPkdP+fS3YDMQzQQ/TvyT10UoVVSTgQfHHPYuA3 opwKLsFvbfWWnqMw++WHpiFeLg6qC1SWKhbRpQRVY9LL3pPx7Hzrb/B5jMWRJCEfq7vF yZQbXbBMCAhVajhTZMCegacbfOfWispPnuruMJ2E+4ORJaA7IHM5hyH3Yzx2vvGZHSSN nPwGpGP043+eM8aNMTY6QIpLNPB1PWBmKlPoedUcXU+/vCsoW/FuKP3Twijk0eWWIMRl OQ0Kf8omrDYP/NTxC009D3sPw6ias2+PYIWl1+eoTBzkEdUu+xLCZsYRc39dMDpW6eCX +lvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QooJ2+oMCgy72PaxJ/VJWzV3+0zvKgI1mojlS+3lljk=; b=gsYtMIQtuUcVxs3qSwMot/4/LPgu9jvGnxHuq0jQ4RVgBrPEb4F55Lb18AohnPe4bm nBKEKeH+bhE1YLwVCBasC/tWa30ea4wqv4ADm1zvzddouR+2YC4VImFJiJWUw589qvjQ pe7zBCIvA3f4Cp8QdeDC/1N32RoxTUSbh3cWr6UeSMLEqkXe9uO2PbrmEE7wihqIgb2U vH9OF1keKTPJU0hokGktA8g+IFMzzYIsWTSqRZiGvggBwKzqNf/GZfO/rTp8bAs3m4LT J8I0Wnvbk3dz3oGvwfe7BNcmR/WrSIePqUGWaGUkeIt3q1bsJgMXL0jB2VYPlz9ZC020 E+Ow== X-Gm-Message-State: AJcUukcDJK+v2bG5znZbBri6mdqAmVc2tJb46jOyk0APjWmuvUvrdeCL Ys98EvlgJlUz/+5y6MCxKceJz74dhHj0/vW61NGJ9SAFgV16gXDmoFkyzKSzu86mO1WGzKSKHIJ KqnCxBM5AALEiWWLeRHf/gekx X-Received: by 2002:a1c:c707:: with SMTP id x7mr1905574wmf.120.1547206498170; Fri, 11 Jan 2019 03:34:58 -0800 (PST) X-Received: by 2002:a1c:c707:: with SMTP id x7mr1905552wmf.120.1547206497889; Fri, 11 Jan 2019 03:34:57 -0800 (PST) Received: from localhost.localdomain (cust51-dsl50.idnet.net. [212.69.50.51]) by smtp.gmail.com with ESMTPSA id x186sm19403931wmg.41.2019.01.11.03.34.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Jan 2019 03:34:57 -0800 (PST) From: Phil Elwell To: Eric Anholt , Stefan Wahren , Greg Kroah-Hartman , Dominic Braun , Nicolas Saenz Julienne , Arnd Bergmann , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Phil Elwell Subject: [PATCH] staging: vchiq: Fix local event signalling Date: Fri, 11 Jan 2019 11:34:53 +0000 Message-Id: <1547206493-105303-1-git-send-email-phil@raspberrypi.org> X-Mailer: git-send-email 2.7.4 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-11_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Prior to the recent event reworking (see Fixes), thread synchronisation was implemented using completions, the worker thread being woken with a call to complete(). The replacement uses waitqueues, which are more like condition variables in that the waiting thread is only woken if the condition is true. When the VPU signals the ARM, it first sets the event's fired flag to indicate which event is being signalled, but the places in the ARM-side code where the worker thread is being woken - remote_event_signal_local via request_poll - did not do so as it wasn't previously necessary, and since the armed flag was being cleared this lead to a deadlock. Fixes: 852b2876a8a8 ("staging: vchiq: rework remove_event handling") Signed-off-by: Phil Elwell --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index 9e17ec6..53f5a1c 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -446,6 +446,7 @@ remote_event_wait(wait_queue_head_t *wq, struct remote_event *event) static inline void remote_event_signal_local(wait_queue_head_t *wq, struct remote_event *event) { + event->fired = 1; event->armed = 0; wake_up_all(wq); } -- 2.7.4