Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp562526pxf; Thu, 18 Mar 2021 07:08:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQXo7lP6igWFUTxkYo2GSucLsVeFS5fv7zFNBLakfiTm8TgIROHb+hMRjfd3hdkzkmUnQQ X-Received: by 2002:a50:fa04:: with SMTP id b4mr3961150edq.293.1616076515405; Thu, 18 Mar 2021 07:08:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616076515; cv=none; d=google.com; s=arc-20160816; b=a/e8q0lFzItLasb8y8sl6CQ1gJdpSckw/ckoVDi2gP2ElD8subz77ppUGl7y+JpbwY Mqre/0VVdPICgTzdukY/l68hKn2gyd0x2XiIar7XManAZTH7u8H0AeXoX9j4x+5dGfwo m3VJVmD2AWV1rBF3uyO+htMthtVNT51AT/9hIRCBsh7TM84HhgP9WClWtkZJ0Zn+ppOw hl9Rg3wk1b87xnC9BuoetO4LwPIj0+raNoxtZ3QQuerYOZh0GAugtj6+9u9jr4Hgg6OS 2HOzgOND1WXL/456idqZCLoFDV/YIlGLLmiAjYVtb4J/dTOojKjkrJZ8MB3pehWMWhyf BXLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=MdcSFDBabBXJ3ZmfTS0jbuleHUr6BGXdkTwtSV3soDI=; b=LfKljdHko3/ZmwZDxTkQuy6QOs2XUt/0w9bD6tkS42UvWmk/q+Jj3lLFC1htSqdrQk MU2MihYcnrOf0ZpqadnxsnueaC9LCtgGBIINgodrBB6xp62X/OSDfxTZEz2QksooDdee wuu7frqeQ94JQfNzk14Hds8T+c8hyWqR0/8izDb4ln3mshN/BqSzdXNPTQSEhrWPhHwW z6Dox0omQm5SE3VcBIdeAuNgdva++CBSrageQA1/qCTnX4A7Fylx43Ss9cqLrgWXeBKX Dmr21ZvOdgNQxu9R+BBQviJqkjVXnRCEbYli9B1/DT1Mf6/8oGBipdme7L4+HEMNV1pq ix4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=hM15uqg6; 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=posteo.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h6si1568882edw.354.2021.03.18.07.08.10; Thu, 18 Mar 2021 07:08:35 -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=@posteo.net header.s=2017 header.b=hM15uqg6; 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=posteo.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230458AbhCROHQ (ORCPT + 99 others); Thu, 18 Mar 2021 10:07:16 -0400 Received: from mout01.posteo.de ([185.67.36.65]:60718 "EHLO mout01.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229745AbhCROG5 (ORCPT ); Thu, 18 Mar 2021 10:06:57 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id EE853160062 for ; Thu, 18 Mar 2021 15:06:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1616076415; bh=L+TrlYsIZIC9UcHK7uCJaRSUZ6c2Z/GwHu8kU6KJLfo=; h=Date:From:To:Cc:Subject:From; b=hM15uqg6rA95wNqYDq6dOG7wi29YeD3FJZsGMFdRJi+bHikLrgtCeKDwlQ73Xm53c 7NZeKg5XpoWyYwqzOZLxsYTraFt4wD9M4vEbK2UPa0bSumJW8W7Hk7r9y2Q/FKVmQ2 OONon3mTeUFoEvVAin+LoiSzm7me+cp+YFGEETOA9MwkNPlc0jMhJtyxfreu79rHMC p8BjIhnCzP+srDYD3WTfCO/f9igVxFooeWRO3pdi/hGn4RJnic8q4HIHZSva/Bc488 DwmTzgpy9iWmenoTJUV7tfkpGz+juxsO5agMsjkjDR2S58Qq13pAEG4yrbYOLecRor PISnJh/kfPgHQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4F1TNY0Rlcz6tmV; Thu, 18 Mar 2021 15:06:52 +0100 (CET) Date: Thu, 18 Mar 2021 15:06:52 +0100 From: Wilken Gottwalt To: Maxime Ripard Cc: linux-kernel@vger.kernel.org, Ohad Ben-Cohen , Bjorn Andersson , Baolin Wang , Rob Herring , Chen-Yu Tsai , Jernej Skrabec Subject: Re: [PATCH v7 2/2] hwspinlock: add sun6i hardware spinlock support Message-ID: <20210318150652.6f961b38@monster.powergraphx.local> In-Reply-To: <20210315161220.sxjkam7bqli5fk5y@gilmour> References: <20210315161220.sxjkam7bqli5fk5y@gilmour> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 15 Mar 2021 17:12:20 +0100 Maxime Ripard wrote: > On Sun, Mar 14, 2021 at 10:31:13AM +0100, Wilken Gottwalt wrote: > > Adds the sun6i_hwspinlock driver for the hardware spinlock unit found in > > most of the sun6i compatible SoCs. > > > > This unit provides at least 32 spinlocks in hardware. The implementation > > supports 32, 64, 128 or 256 32bit registers. A lock can be taken by > > reading a register and released by writing a 0 to it. This driver > > supports all 4 spinlock setups, but for now only the first setup (32 > > locks) seem to exist in available devices. This spinlock unit is shared > > between all ARM cores and the embedded companion core. All of them can > > take/release a lock with a single cycle operation. It can be used to > > sync access to devices shared by the ARM cores and the companion core. > > > > There are two ways to check if a lock is taken. The first way is to read > > a lock. If a 0 is returned, the lock was free and is taken now. If an 1 > > is returned, the caller has to try again. Which means the lock is taken. > > The second way is to read a 32bit wide status register where every bit > > represents one of the 32 first locks. According to the datasheets this > > status register supports only the 32 first locks. This is the reason the > > first way (lock read/write) approach is used to be able to cover all 256 > > locks in future devices. The driver also reports the amount of supported > > locks via debugfs. > > > > Signed-off-by: Wilken Gottwalt > > Acked-by: Maxime Ripard Ah nice ... totally forgot to thank you for the patience and steady reviews. :-) > Maxime