Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3868194pxk; Tue, 8 Sep 2020 04:56:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRaLH5UGAEQTAgKuxNTI+sVJKMY4HlCOPL+eDap8471WRne+zKFieXVjYTRZ01vxPbxTbZ X-Received: by 2002:a17:906:8c8:: with SMTP id o8mr25135223eje.91.1599566175038; Tue, 08 Sep 2020 04:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599566175; cv=none; d=google.com; s=arc-20160816; b=T+v61qpe4VS6w/M32eJ92Z2/ZBMAHVSnhYNUvdfRwITdTFPR8R7X4JQ0C/QosVz8gt vXttWkcbnK/uU1c3iaxrqcM5crFgz1puTSUcPpqzQbMm4XhFyq+yzMOHEV/qUqt6Is/9 pA96xqsequ/e/HjzjskBVvSdRWMy4MWHAUpnKN9I0piItbcVCg9Vfz5ngmXg34YI5hM4 tLrHLXZz3mvamsu3OX6gJhof6JQT2K+JyD2SBnXnzIXeVGrGYQY+jVKhYbRr1+XWs/eC 9HAqmRiTaq0rq26taOkD9IRz9PFHds1k5iu1IGl85fWXZpwCJGiXve1ZtGgDlotReyxO EPzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fpBhZdcFA2nT+LOHlmWJkzA7pUhfRv3Z0z4/r76r8sE=; b=0xUp3U20ysMNwIf6mLL0SOp4jj18/k/G1xYBBprHCgckbja9nRLQkgQjTAK4TKXF5J gsDelq5E8zYmpZ7KHNYqVf9n+Lx2rhKP/5NfAHqWi9LP7KlmLkCF3MglKlFaax6JU/8h Xlh60kzLDCdMbU+JkBTv9MtFCpcrAVguLbTCgU+HSuLXGDnKyci3WiSbnTyGrBmPUKZj X05JJ901xb7Mvw1FnaUuMNaM6TO8gu+RVMA7MQh3Ji4xHlmlXHnwtC8hxheOEqyQtrqc +2wmoT41T+WyleiaCJHJW0z1kdPyle7zlvgY36e/hf/8Pf9sMNpbFCt3FEQ+0uZ+xP39 TKKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GxvyckKn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r25si4373684edc.164.2020.09.08.04.55.52; Tue, 08 Sep 2020 04:56:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GxvyckKn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729037AbgIHLxP (ORCPT + 99 others); Tue, 8 Sep 2020 07:53:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:33020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729844AbgIHLtt (ORCPT ); Tue, 8 Sep 2020 07:49:49 -0400 Received: from mail-ua1-f47.google.com (mail-ua1-f47.google.com [209.85.222.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8C48B21D24 for ; Tue, 8 Sep 2020 11:48:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599565727; bh=fpBhZdcFA2nT+LOHlmWJkzA7pUhfRv3Z0z4/r76r8sE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=GxvyckKncdsWAYWdYCyBqzngQ5pJQGCl289UYedohvd+GwMQt9XRY5BeOXHIuWsDV Prg27ExRq9IgNFodmQtcOzZz/0NykeGclT7Ygs5XYJXiGKgVP/33bvTHF0xKyPsn+K TNGsFQ/mF6M8nnw049ryQE3R6u88pLzaBybumWpA= Received: by mail-ua1-f47.google.com with SMTP id u48so4961589uau.0 for ; Tue, 08 Sep 2020 04:48:47 -0700 (PDT) X-Gm-Message-State: AOAM532mkq4vsJZSnV2kdY2J4FXuVvCAH0QYttaRtFK1nw7PecZwP5ah NO0+ztoHgGg+AYma/lrFDXkmthTTSYnYYPjS0Y0oEQ== X-Received: by 2002:ab0:384a:: with SMTP id h10mr5000472uaw.77.1599565726623; Tue, 08 Sep 2020 04:48:46 -0700 (PDT) MIME-Version: 1.0 References: <20200908075716.30357-1-manivannan.sadhasivam@linaro.org> <20200908075716.30357-6-manivannan.sadhasivam@linaro.org> <20200908103444.5e526uawa45om6lt@vireshk-i7> <20200908111141.GB23095@mani> <20200908111813.bbgfxo5v7qt6ujpc@vireshk-i7> In-Reply-To: <20200908111813.bbgfxo5v7qt6ujpc@vireshk-i7> From: Amit Kucheria Date: Tue, 8 Sep 2020 17:18:35 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 5/7] cpufreq: qcom-hw: Use regmap for accessing hardware registers To: Viresh Kumar Cc: Manivannan Sadhasivam , "Rafael J. Wysocki" , Rob Herring , Andy Gross , Bjorn Andersson , Linux PM list , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , linux-arm-msm , Dmitry Baryshkov , Taniya Das Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 8, 2020 at 4:48 PM Viresh Kumar wrote: > > On 08-09-20, 16:41, Manivannan Sadhasivam wrote: > > On 0908, Viresh Kumar wrote: > > > On 08-09-20, 13:27, Manivannan Sadhasivam wrote: > > > > Use regmap for accessing cpufreq registers in hardware. > > > > > > Why ? Please mention why a change is required in the log. > > > > > > > Only because it is recommended to use regmap for abstracting the hw access. > > Yes it can be very useful in abstracting the hw access in case of > busses like SPI/I2C, others, but in this case there is only one way of > doing it with the exact same registers. I am not sure it is worth it > here. FWIW, I have never played with regmaps personally, and so every > chance I can be wrong here. One could handle the reg offsets through a struct initialisation, but then you end up with lots of #defines for bitmasks and bits for each version of the IP. And the core code becomes a bit convoluted IMO, trying to handle the differences. regmap hides the differences of the bit positions and register offsets between several IP versions. > > Moreover it handles the proper locking for us in the core (spinlock vs mutex). > > What locking do you need here ? Right, locking isn't the main reason here. > > > I've seen many subsystem maintainers prefer regmap over plain readl/writel > > calls. I'll add the reason in commit log. > > I am not sure if it is worth it here.