Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1009260imm; Fri, 12 Oct 2018 10:09:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV61D25e1+vFNMw7k4UoxggwhaEYHNraJfl6GKv47r2V8O4bg8tIhE9qpzBtesLR5awGuEyhQ X-Received: by 2002:a63:d64b:: with SMTP id d11-v6mr6233392pgj.450.1539364186960; Fri, 12 Oct 2018 10:09:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539364186; cv=none; d=google.com; s=arc-20160816; b=D8eIX+1OQ7lVKptnk0biDqIbPPMrB9b3/8mGLGYkbNAQ4QoMqToG92OtxWrHU+ktai ZNaz59PSrt3XbuV1/n4SqNr4cAl5G2dKXiEqD9FecKl6yule5ef1vOG8L7aCWQULtmlY ys8n065x8U7vMddm+nL4mpWZwnnCcVclwbAxw9N97wlL5Ua3WY5kY8ruFMKyS00O456C VHCDa/3CPMD3ZlLBwhyYksOMk93rMnL0IhJFFK6SyaQL1rS1g0o1D8DJ8fwfkd+l4i23 Fj1QUuJXOHIlk+dRePUD8B6VOMNR/pzJfI2p3t910bntkpacXz3+1SxFYMFc2jHsYpFZ PLBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=th15w8Qkuu8Yn8YyuDTJhnlpcAduEK5VbKAFWgg6+io=; b=hZZj7k8Mh/QuLWMkjNlQVDSJmBeTChIbuPEWdTm3p87WGaJTvBzExiTW7DenHvUBIy MBJOIw6+EC+jmPb2aAQ3uw6Z6/A7ednPN2o1vjUMlMJYnDw4nKaaFylRrJdjdeAeddHP Rmh5dOpwMQj085vriA/Hvtq7TqzmWGrtfW6mUy6TCKdwtDVSvUw0H9GruuUvB5D9jqWh 9DKRwxZ3nmtqVkl/HShjMUZQihpfdFmRCAg9PsWFvbzo3Ge75/paWQixyvpWO1917cgo YYj5JBdIIjuJ2UDvR28KI8c9oMxIx/2+/4ufdUP3sXTTvMX4chUa0Z5zYBA2RTCA4Srw bUlA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si1784939plx.140.2018.10.12.10.09.31; Fri, 12 Oct 2018 10:09:46 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727361AbeJMAmh (ORCPT + 99 others); Fri, 12 Oct 2018 20:42:37 -0400 Received: from www.llwyncelyn.cymru ([82.70.14.225]:50736 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbeJMAmg (ORCPT ); Fri, 12 Oct 2018 20:42:36 -0400 Received: from alans-desktop (82-70-14-226.dsl.in-addr.zen.co.uk [82.70.14.226]) by fuzix.org (8.15.2/8.15.2) with ESMTP id w9CH8LrL031467; Fri, 12 Oct 2018 18:08:22 +0100 Date: Fri, 12 Oct 2018 18:08:21 +0100 From: Alan Cox To: Hans de Goede Cc: Jarkko Nikula , Wolfram Sang , Andy Shevchenko , Mika Westerberg , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/3] x86: baytrail/cherrytrail: Rework and move P-Unit PMIC bus semaphore code Message-ID: <20181012180821.602abd04@alans-desktop> In-Reply-To: <34244947-6b73-55c2-a0e8-b6a66050a612@redhat.com> References: <20181011142911.13750-1-hdegoede@redhat.com> <20181011142911.13750-2-hdegoede@redhat.com> <20181011213508.40b8ce0e@alans-desktop> <34244947-6b73-55c2-a0e8-b6a66050a612@redhat.com> Organization: Intel Corporation X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > It should be. > > You mean that the problem should be purely academic, IOW that registers touched > by the P-Unit are never touched through ACPI Opregions / power-resources? As far as I am aware. Holding the lock over both is definitely better regardless > >> 2) To safely access the shared I2C bus, we need to do 3 things: > >> a) Notify the GPU driver that we are starting a window in which it may not > >> access the P-Unit, since the P-Unit seems to ignore the semaphore for > >> explicit power-level requests made by the GPU driver > > > > That's not what happens. It's more a problem of > > > > We take the SEM > > The GPU driver pokes the GPU > > The GPU decides it wants to change the power situation > > The GPU asks > > It blocks on the SEM > > > > and the system deadlocks. > > That may be, but why does it deadlock? As I understand it because the CPU is stuck waiting for the GPU which is waiting for the SEM which the CPU is holding. This isn't purely software remember. > I can understand that you are reluctant to change this code, but this > commit is not changing the logic, it mostly just moves the code around > and I do believe that overall doing this is worthwhile. Fair enough Alan