From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762787AbcHESx6 (ORCPT ); Fri, 5 Aug 2016 14:53:58 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:48000 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422970AbcHESxv (ORCPT ); Fri, 5 Aug 2016 14:53:51 -0400 Subject: Re: [PATCH v2 1/2] soc: qcom: provide mechanism for drivers to access L2 registers To: Mark Rutland References: <1470345071-9455-1-git-send-email-nleeder@codeaurora.org> <1470345071-9455-2-git-send-email-nleeder@codeaurora.org> <20160805100018.GA25152@leverpostej> Cc: Catalin Marinas , Will Deacon , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mark Langsdorf , Mark Salter , Jon Masters , Timur Tabi , cov@codeaurora.org, nleeder@codeaurora.org From: Neil Leeder Message-ID: Date: Fri, 5 Aug 2016 14:53:47 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160805100018.GA25152@leverpostej> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/5/2016 06:00 AM, Mark Rutland wrote: > On Thu, Aug 04, 2016 at 05:11:10PM -0400, Neil Leeder wrote: >> L2 registers are accessed using a select register and data >> register pair. To prevent multiple concurrent writes to the >> select register by independent drivers, the write to the >> select register and the associated access of the data register >> are protected with a lock. All drivers accessing the L2 >> registers use the set and get functions provided by >> l2-accessors to ensure correct reads and writes to L2 registers. > > As of this series, this is only used by the PMU driver. Which other > drivers do you plan to use this for? > > If there's nothing else planned at the moment, it would be nicer to fold > these into the PMU driver. > I see a couple of other drivers on codeaurora.org using it: the Error Reporting (ERP) driver and an adaptive clock generator. I'd guess they'll be submitted to LKML but they're not mine so I don't know when. As the purpose of this is to be the common interface for multiple drivers to stop them walking over each other, I think it makes sense to keep it separate. > [...] > >> +config QCOM_L2_ACCESSORS >> + bool "Qualcomm Technologies L2-cache accessors" >> + depends on ARCH_QCOM && ARM64 >> + help >> + Say y here to enable support for the Qualcomm Technologies >> + L2 accessors. >> + Provides support for accessing registers in the L2 cache >> + for Qualcomm Technologies chips. > > Which chips have this? Qualcomm Technologies ARM64 chips, so currently QDF24xx family and anything Kryo based. I'd assume any future chip families as well. Given the 'depends on' line, I wasn't sure there was any benefit to essentially duplicating that in the help text. > > Have drivers select this as necessary. There's no reason for this to be > used-selectable given this is trivial common infrastructure. OK, I'll fix that > > [...] > >> +#include >> +#include >> +#include >> +#include >> +#include > > Nit: please sort these alphabetically. OK > > [...] > >> +EXPORT_SYMBOL(set_l2_indirect_reg); > > The PMU driver isn't a module, so this doesn't need to be exported. > Until there's a modular user, please get rid of EXPORT_SYMBOL. > >> +EXPORT_SYMBOL(get_l2_indirect_reg); > > Likewise. OK to both of these. > > Thanks, > Mark. > Thank you for the comments. Neil -- Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.