From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E82FC433DB for ; Mon, 1 Mar 2021 13:16:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 65BC264E07 for ; Mon, 1 Mar 2021 13:16:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235430AbhCANQE (ORCPT ); Mon, 1 Mar 2021 08:16:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:57894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235500AbhCANNt (ORCPT ); Mon, 1 Mar 2021 08:13:49 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 03A6864E22; Mon, 1 Mar 2021 13:13:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614604388; bh=7VQhDQHBN69eYudYHQ45S6nSPODMEqDA9oTA2ks0k84=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZF28LG/JYAVNOczO0ZBbuPPmbMa7fPuYGu+Bip9RKfHDJUYFIXZjsweYBgSJUUkJP L+roho3iN1cTjv94tLIzHvxwNU0JnTJSTCRpnZHCZwxVCas8srkVObI5tiGnflbomN Jdv+jZYWgIPoz0unGoApdYCMKAIz1Qh/JrMgFXJQy8yDOxJaBsrrBaeNovuqtQKfWA KWZXtwUg5kGLtvUrUKwbQF6oil+J0Hom/K7CCRshQcgQo2BtT4Dewu0zMs0XV3ebWy j8GQydQf8U9yPTLInP6U6yAkRg7avel6w1NAdSggKF1bdmSAdaUUPWCr97WF0KG49A BUvfR1BpvLysw== Date: Mon, 1 Mar 2021 14:13:05 +0100 From: Maxime Ripard To: Wilken Gottwalt Cc: linux-kernel@vger.kernel.org, Ohad Ben-Cohen , Bjorn Andersson , Baolin Wang , Rob Herring , Chen-Yu Tsai , Jernej Skrabec Subject: Re: [PATCH v6 2/2] hwspinlock: add sun6i hardware spinlock support Message-ID: <20210301131305.wrsonoqwcm6ua2e2@hendrix> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 27, 2021 at 02:03:54PM +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 Didn't I review this one already? Maxime