From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77635171099 for ; Thu, 1 Aug 2024 10:15:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722507311; cv=none; b=BkmPiy/M9PL0JCQXa5XK3EFdGuRzY1/IOD85YqWXrN0medTUCDqCqKOnlwEV5urlgY0BSrv15y/4cZZxOKKNIdGbzZ28vDr+KXDxkOY4+TUO0fEx14NEsnn06SdjhjZlu+wws/ZHCaz7AIUei4/6qi6Lpv9vQewW6fChSnZndeM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722507311; c=relaxed/simple; bh=U9wr7GqkmrMX2vYC7lUvPnIEz6kcUPwaUXveRaPautM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Cg5DaDLBWA9rlAWlzS+D+2h3ztfujcpBmnBo7p3/taRzTFkoGCMjk0T9pO4XJy9cs+nNdPnVnIPgqNc3b3v7GpJPPb+CdD9ZsczPCkyuprjfVmjYzi76jDg2vYUEmvBMrPsb0q06/8fjy6EfG6+xGwNUgUdtnMVDk+59dDaXuDE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=Z1ag3YUc; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="Z1ag3YUc" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a7ab5fc975dso609549166b.1 for ; Thu, 01 Aug 2024 03:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1722507308; x=1723112108; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=lWBquabnZ6kcEWp0IKOcbEM+16+nIy0kpShVIFZJXnM=; b=Z1ag3YUcUcYk9TSMAqv5fTfKBPlGfDNiA/vlDmBFjJuX03VNfqbSZavHdw3z3gpBM8 eLuR+hWwVb0t3YkgV/36nsDqVeB60EHvB13IsDVV1LbKL4OQqJ7KQliNgNQnqSjgctzR YLzkEmNWKbawkt8jCDU5bCeUZGs8+ze55xNPL7ScqA6pMsfvozRr0P4I10wGAgOYgTR+ wSFuZ2Mkj1cshfOPpzge0jYyDE7cl/bA0LzBEGgSozehzKsz/6R7cX/1ns6Gmksd+feo NCxkvy+iLdg4rwIToZ0jgiX15JQGgu2Xv60LcTn9uh5piMPltE0doldbZVp+MwFGeB4z 5M1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722507308; x=1723112108; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lWBquabnZ6kcEWp0IKOcbEM+16+nIy0kpShVIFZJXnM=; b=wb57EeLbKKNewhoQZ26+yMyRsSYo1D19RiaBU8fk70NGTxq7H5I95QOS7h3bBGTUur 0qDOokzx3+gfoAxdryEUcHhAlG4c5FP9nwAoEpG21JEhbETLWZBbXRK1hu+L8dqK3qOZ SHqagO/+/2wor+vcyNfb6ff2zNPLBuum9ww3F5mbHNl7n0iOCQu5+H54EXkhXDRiBPWN 5eDXrf1Ni022TAdiLivh9Y5grlshONk6V9Rkw0UqL7JrKhGgwAghHvceJp5oJICqHboP ujwtmEiPb1VKXRCn9gsjhyvpvm++ql3/lphekM1UC8ReZTRl5f/rxh3ysZoEqI7awwKx HKIA== X-Forwarded-Encrypted: i=1; AJvYcCWJn3zLVm713v/u6qqKKuPHgenJfQ9aiCJtNoNvyOlCubLSe3jd5bpkRv1fKXNao+bLJXocTCWUqKuBRkeUCVgFt9VwzYXcqbmLg5g6 X-Gm-Message-State: AOJu0YxE/efQmTn4AaiSsRjqGCb5comt/Sqddtjk6jFDlvLMVJJc1cbF D2muhvnYa8NwQEW1Pni8VW1ZCJOZ+vGtPwUK2fg+JVXgwk5A7Df7EhwrhSZ3qWA= X-Google-Smtp-Source: AGHT+IEeTCuavVhswNVgEm2olLofx/pt8cE9Bumon3z0afUonWZ842xMiwTVqZcy8FZzQmEJxlyJMw== X-Received: by 2002:a17:907:7da0:b0:a7a:8876:4429 with SMTP id a640c23a62f3a-a7daf65d495mr148745866b.45.1722507307311; Thu, 01 Aug 2024 03:15:07 -0700 (PDT) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7acad4348bsm875471766b.118.2024.08.01.03.15.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Aug 2024 03:15:06 -0700 (PDT) Date: Thu, 1 Aug 2024 12:15:00 +0200 From: Andrew Jones To: Alexandre Ghiti Cc: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Andrea Parri , Nathan Chancellor , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Arnd Bergmann , Leonardo Bras , Guo Ren , linux-doc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org Subject: Re: [PATCH v4 13/13] riscv: Add qspinlock support Message-ID: <20240801-e773d3752fe8b5484405d404@orel> References: <20240731072405.197046-1-alexghiti@rivosinc.com> <20240731072405.197046-14-alexghiti@rivosinc.com> <20240731-ce25dcdc5ce9ccc6c82912c0@orel> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Aug 01, 2024 at 10:43:03AM GMT, Alexandre Ghiti wrote: ... > > > diff --git a/include/asm-generic/qspinlock.h b/include/asm-generic/qspinlock.h > > > index 0655aa5b57b2..bf47cca2c375 100644 > > > --- a/include/asm-generic/qspinlock.h > > > +++ b/include/asm-generic/qspinlock.h > > > @@ -136,6 +136,7 @@ static __always_inline bool virt_spin_lock(struct qspinlock *lock) > > > } > > > #endif > > > > > > +#ifndef __no_arch_spinlock_redefine > > > > I'm not sure what's better/worse, but instead of inventing this > > __no_arch_spinlock_redefine thing we could just name all the functions > > something like __arch_spin* and then add defines for both to asm/spinlock.h, > > i.e. > > > > #define queued_spin_lock(l) __arch_spin_lock(l) > > ... > > > > #define ticket_spin_lock(l) __arch_spin_lock(l) > > ... > > __arch_spin_lock() would use queued_spin_lock() so that would make an > "infinite recursive definition" right? And that would override the > "real" queued_spin_lock() implementation too. > > But maybe I missed something! > It depends on where the definition is done. It should work if the preprocessor expands the implementation of __arch_spin_* before evaluating the #define of queued_spin_*. IOW, we just need to put the defines after the static inline constructions. Thanks, drew