Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752071AbdIFF1L (ORCPT ); Wed, 6 Sep 2017 01:27:11 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:38025 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751913AbdIFF1E (ORCPT ); Wed, 6 Sep 2017 01:27:04 -0400 X-Google-Smtp-Source: ADKCNb4iOsyC60jHvQy5X2owOzJ+1lUN2MATqLd5Gy+IvTc7dIARh5P8TVD56C177/UBsCJNdlfugA== Subject: Re: [RFC v2 6/6] platform/x86: intel_pmc_ipc: Use generic Intel IPC device calls To: Lee Jones , sathyanarayanan.kuppuswamy@linux.intel.com Cc: souvik.k.chakravarty@intel.com, x86@kernel.org, mingo@redhat.com, qipeng.zha@intel.com, hpa@zytor.com, dvhart@infradead.org, tglx@linutronix.de, andy@infradead.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org References: <1504401889-113524-7-git-send-email-sathyanarayanan.kuppuswamy@linux.intel.com> <20170905073849.eeeo3kbncozzer46@dell> From: "Kuppuswamy, Sathyanarayanan" Message-ID: <7d0dbcce-0863-cfb0-6012-2c3ac0fc3c27@gmail.com> Date: Tue, 5 Sep 2017 22:27:01 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170905073849.eeeo3kbncozzer46@dell> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1665 Lines: 39 Hi Lee, On 9/5/2017 12:38 AM, Lee Jones wrote: > On Sat, 02 Sep 2017, sathyanarayanan.kuppuswamy@linux.intel.com wrote: > >> From: Kuppuswamy Sathyanarayanan >> >> Removed redundant IPC helper functions and refactored the driver to use >> generic IPC device driver APIs. >> >> This patch also cleans-up PMC IPC user drivers to use APIs provided >> by generic IPC driver. >> >> Signed-off-by: Kuppuswamy Sathyanarayanan >> --- >> arch/x86/include/asm/intel_pmc_ipc.h | 37 +-- >> drivers/mfd/intel_soc_pmic_bxtwc.c | 24 +- >> include/linux/mfd/intel_soc_pmic.h | 2 + > I'm a bit concerned by the API. This is not a new change. Even before refactoring this driver, we have been using u32 bit variable to pass the DPTR and SPTR address. > Any reason why you're not using > pointers for addresses? I think the main reason is, this is the expected format defined by SCU/PMC spec. According to the spec document, SPTR and DPTR registers are used to program the 32 bit SRAM address from which the PMC/SCU firmware can read/write the data of an IPC command. if we are not using SPTR or DPTR, we need to leave the value at zero. > pointers, you should be using NULL, instead of 0. > >> drivers/platform/x86/intel_pmc_ipc.c | 364 +++++++++----------------- >> drivers/platform/x86/intel_telemetry_pltdrv.c | 114 ++++---- >> 5 files changed, 215 insertions(+), 326 deletions(-) >> >> Changes since v1: >> * Removed custom APIs. >> * Cleaned up PMC IPC user drivers to use APIs provided by generic >> IPC driver.