From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752387AbdFOOYS (ORCPT ); Thu, 15 Jun 2017 10:24:18 -0400 Received: from mail-lf0-f51.google.com ([209.85.215.51]:35334 "EHLO mail-lf0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752072AbdFOOYR (ORCPT ); Thu, 15 Jun 2017 10:24:17 -0400 MIME-Version: 1.0 In-Reply-To: References: <1497278211-5001-1-git-send-email-suzuki.poulose@arm.com> <1497278211-5001-6-git-send-email-suzuki.poulose@arm.com> <20170614174904.GA22030@xps15> From: Mathieu Poirier Date: Thu, 15 Jun 2017 08:24:14 -0600 Message-ID: Subject: Re: [PATCH 05/12] coresight tmc: Add helpers for accessing 64bit registers To: Suzuki K Poulose Cc: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15 June 2017 at 04:13, Suzuki K Poulose wrote: > On 14/06/17 18:49, Mathieu Poirier wrote: >> >> On Mon, Jun 12, 2017 at 03:36:44PM +0100, Suzuki K Poulose wrote: >>> >>> Coresight TMC splits 64bit registers into a pair of 32bit registers >>> (e.g DBA, RRP, RWP). Provide helpers to read/write to these registers. >> >> >> I'm good with this patch but please specify these changes are to support >> the >> SoC-600 suite. That way when we look back at this set in a couple of >> years we >> don't loose hair thinking we've been carrying bugs all this time. > > > To be honest, these are not necessarily just for the support of SoC-600. > It is applies to the current driver with SoC-400, as you could see below, > where we have always assumed that the RRP/RWP/DBA HI bits are always > 0. Technically, the TMC supports upto 40bits and hence we have been doing > it wrong. I just had another look at the documentation and you are correct - disregard my comment for this patch. > >>> - read_ptr = readl_relaxed(drvdata->base + TMC_RRP); >>> - write_ptr = readl_relaxed(drvdata->base + TMC_RWP); >>> + read_ptr = tmc_read_rrp(drvdata); >>> + write_ptr = tmc_read_rwp(drvdata); > > > > >>> - writel_relaxed(read_ptr, drvdata->base + TMC_RRP); >>> + tmc_write_rrp(drvdata, read_ptr); >>> perf_aux_output_flag(handle, PERF_AUX_FLAG_TRUNCATED); > > >>> writel_relaxed(axictl, drvdata->base + TMC_AXICTL); >>> + tmc_write_dba(drvdata, drvdata->paddr); >>> >>> - writel_relaxed(drvdata->paddr, drvdata->base + TMC_DBALO); >>> - writel_relaxed(0x0, drvdata->base + TMC_DBAHI); > > >>> >>> - rwp = readl_relaxed(drvdata->base + TMC_RWP); >>> + rwp = tmc_read_rwp(drvdata); >>> val = readl_relaxed(drvdata->base + TMC_STS); >>> > > > Suzuki