Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2636223imm; Thu, 11 Oct 2018 13:35:58 -0700 (PDT) X-Google-Smtp-Source: ACcGV62FJSf297VOWPYvD75PhsXOJM1KmNYtoVCXcCd+fUbWNAPI3cBpntVF/imnCCl8FEg/IOEf X-Received: by 2002:a63:c306:: with SMTP id c6-v6mr2773253pgd.133.1539290158888; Thu, 11 Oct 2018 13:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539290158; cv=none; d=google.com; s=arc-20160816; b=OQFTs/7E+ib9XE06pFHfpATU7eTAKWDImJVxlsY0DpnhNOBuKFwg2A/KHEuaSD90Op vVOQaUsUfH1N0ua6CK2OXXr8dQyRDxtd8XMhnXrgaOFQtdS+YEBCYpMcOUnA9jqaW9v+ vCBqDjUI9/w+FlxSLeppQIAod6K2zYqwsi+3NA2/0qWgz/vbWKwEO0ZwskaO2OMRFqX/ xMbulrd2SdtZCjxca7Nc21h8GOBXTAHPb5GF2FPm12seFOlfXWirZWBsNBktKU6G6/yl PBNN3ev5WmyG4jCGog2k9Q1G+XKYiLz5wsarXPjsRXxxHljGuc3vHPFg4ETw52yGBNGY 5F4w== 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=6MA7r3pqggjiXJ4qdbSMk1eGLA2APS0+qTKWwsui+YE=; b=RjVk6kPIk8Ejn2vzouWKMgaYvRhieh3wYxyDHRvJlpCyp/U1q8yqIC2mqv6uLIroVa xdtKS3BWJa6uSx343DyYgWNw4MM83lSuhy1y0YoQacqV3o7G7VIkVX6UtOk3hRWcFBvD ti7zRoYZ37Wl9A8+h3GFqDO40/nQ8G8HZgXD+9/VuuP190aUhDT6y8tjB+IIY43sLvjW LGEo2nUxG41TGYnDY5TY4lU4KNVkyCS5XeXh8MYXaZZAFdhuDyaQuo3kfyypk3HbFiY0 p2gXO3551M1WXmTXnFN+ZE0cCvi8GIGXg0eAyUPS5xqECo7J3aEn5UjlhTafT6Uppc9s WrBA== 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 c1-v6si26144888pld.107.2018.10.11.13.35.43; Thu, 11 Oct 2018 13:35:58 -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 S1726074AbeJLEEP (ORCPT + 99 others); Fri, 12 Oct 2018 00:04:15 -0400 Received: from www.llwyncelyn.cymru ([82.70.14.225]:45506 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbeJLEEP (ORCPT ); Fri, 12 Oct 2018 00:04:15 -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 w9BKZ9Qc004192; Thu, 11 Oct 2018 21:35:09 +0100 Date: Thu, 11 Oct 2018 21:35:08 +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: <20181011213508.40b8ce0e@alans-desktop> In-Reply-To: <20181011142911.13750-2-hdegoede@redhat.com> References: <20181011142911.13750-1-hdegoede@redhat.com> <20181011142911.13750-2-hdegoede@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 > 1) PMIC accesses often come in the form of a read-modify-write on one of > the PMIC registers, we currently release the P-Unit's PMIC bus semaphore > between the read and the write. If the P-Unit modifies the register during > this window?, then we end up overwriting the P-Unit's changes. > I believe that this is mostly an academic problem, but I'm not sure. It should be. > 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. > b) Make a pm_qos request to force all CPU cores out of C6/C7 since entering > C6/C7 while we hold the semaphore hangs the SoC Not just C6/C7 necessarily. We need to stop assorted transitions. Given how horrible this lot was to debug originally do you have any meaningful test data and performance numbers to justify it ? As an ahem 'feature' it's gone away in modern chips so is it worth the attention ? Alan