Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2547565pxp; Tue, 22 Mar 2022 00:15:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygZrHCqy+yDVzSKTcVtjZuto8ZS193AKjgfOcvp5dNY+zIhhfFI95ig91r/Z0Wc3ubToOZ X-Received: by 2002:a17:903:244d:b0:154:3772:6b32 with SMTP id l13-20020a170903244d00b0015437726b32mr13456169pls.70.1647933359436; Tue, 22 Mar 2022 00:15:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647933359; cv=none; d=google.com; s=arc-20160816; b=pqowYwcSI35s+7SCZM3MHmAdybHPi/0LaVlu9ut3KmyPvUAGgizJ4GVb+GS8Cp/T3u KVFD/5iafYTbYo7HtvqRn38vCZyl6hDxvsQ1yU1EDdvP/Bbc9jRM/xZGWflg4dKHZX8e PkyCIXezi1ZnvszGRNWKlo1tZ9YfqZ2xRoSS8NwIA03m4L0OAdPkdQyCkI5ITJkOzXlW Qz8S5gQXclSlZ6bCbcms02PUnQQqgb68LwvjJnw+EshIcMQSWD0hxKf4+mrqEY892jkS 9GmfBrudbg4vJo5fBsq+6w1kyWeJITfEGGhOqYW9nOBjVak7WNQS+LmYel5h/HZNGIgn jHqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Hk2f0uSb4N2pzOfcUkdXHOxeHefIJ9Xhf/x7iIMtt7A=; b=aNZ7qVvYCx24ZpCAgr6Oasl+dqtqFRROytJmIHkhz/SxSBRYwGqplY6wv9lZMZSerA GlyvZfqP+KXTVHrgVCI5nI5T4ONVjjFgWOhFeQveVwZUkp+rgHvcJTmX/WDZZn9hpjGe 6A5TJUchufdifpfs/Mgzvq3aHAgFhPG2SDDEefBpv4DhM9ttTPWOY5qzwvuyBV8yLQd4 iIy2KRo1CDf+gG4LEDvO3Qz2VMI+nx1fpKZr/9jRN2F5JCTYxBemSvFRJaHDPRi5dRWm jaI+VM14ts/Gwbdn7EUWzu+nXRWvdHHjyy5uxWQbc1kB5onUcG5/cJxtSSTPRCFqdI5K klpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="mTM0o6i/"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u3-20020a634703000000b003816cf17c43si14598485pga.554.2022.03.22.00.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Mar 2022 00:15:59 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="mTM0o6i/"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0C39F62102; Mon, 21 Mar 2022 23:46:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237063AbiCVGrk (ORCPT + 99 others); Tue, 22 Mar 2022 02:47:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbiCVGri (ORCPT ); Tue, 22 Mar 2022 02:47:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90A4E5EDC9; Mon, 21 Mar 2022 23:46:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1D9116148A; Tue, 22 Mar 2022 06:46:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B024C340FD; Tue, 22 Mar 2022 06:46:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647931570; bh=hhAPCoaMSvMdBpBGQUL4AfiQiPsS12xmMjwJk64lVwA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mTM0o6i/TnOE5bjF9tnScVcRYE5SEfzZvk98MEJMIbvS6xAyHeaxae/iYLVA7qVoL y9gnflHGbsnEIrgNQaidlrWeCsQvu4UH8qF5tGEnPvIhDm0bUkbSMOUGULiJvi8QFB 0cJcQUC0WVmBHtd3ZWO4AdhceTlntVMAUcyS4b2itap/JZGhPywl0TQ8pNhJQVbpop 38kPysWdn0XE4g2LDDZPKjtutxQAqHcIdCQVur839yRxirldUtOz9czkaeC+fKMKRh qm/7CrO6b6gmY2k/8pWxprJHj2m/wu8e6W/YvQqPER8dgmFyZ+wKMgfOSJwX5u9DqA rTkxWbl/8oDEA== Received: by mail-vs1-f53.google.com with SMTP id v206so2003456vsv.2; Mon, 21 Mar 2022 23:46:10 -0700 (PDT) X-Gm-Message-State: AOAM532d3Cz57VEL0IRbano6HAh+o7aHNQAmZtoBKYZ6020BgiJIWvbG 3jmQ5OPHyPKQ36kXvjTZQkEQgvlGR0ya6n7I7e4= X-Received: by 2002:a67:bc05:0:b0:324:eed0:ec29 with SMTP id t5-20020a67bc05000000b00324eed0ec29mr5402967vsn.2.1647931569197; Mon, 21 Mar 2022 23:46:09 -0700 (PDT) MIME-Version: 1.0 References: <20220316232600.20419-1-palmer@rivosinc.com> <20220316232600.20419-4-palmer@rivosinc.com> In-Reply-To: From: Guo Ren Date: Tue, 22 Mar 2022 14:45:58 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/5] openrisc: Move to ticket-spinlock To: Stafford Horne Cc: Palmer Dabbelt , linux-riscv , Peter Zijlstra , Jonas Bonn , Stefan Kristiansson , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Paul Walmsley , Palmer Dabbelt , Albert Ou , Arnd Bergmann , jszhang@kernel.org, Kefeng Wang , Openrisc , Linux Kernel Mailing List , linux-arch Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 22, 2022 at 12:10 PM Stafford Horne wrote: > > On Tue, Mar 22, 2022 at 11:29:13AM +0800, Guo Ren wrote: > > On Tue, Mar 22, 2022 at 7:23 AM Stafford Horne wrote: > > > > > > On Wed, Mar 16, 2022 at 04:25:58PM -0700, Palmer Dabbelt wrote: > > > > From: Peter Zijlstra > > > > > > > > We have no indications that openrisc meets the qspinlock requirements, > > > > so move to ticket-spinlock as that is more likey to be correct. > > > > > > > > Signed-off-by: Palmer Dabbelt > > > > > > > > --- > > > > > > > > I have specifically not included Peter's SOB on this, as he sent his > > > > original patch > > > > > > > > without one. > > > > --- > > > > arch/openrisc/Kconfig | 1 - > > > > arch/openrisc/include/asm/Kbuild | 5 ++--- > > > > arch/openrisc/include/asm/spinlock.h | 3 +-- > > > > arch/openrisc/include/asm/spinlock_types.h | 2 +- > > > > 4 files changed, 4 insertions(+), 7 deletions(-) > > > > > > Hello, > > > > > > This series breaks SMP support on OpenRISC. I haven't traced it down yet, it > > > seems trivial but I have a few places to check. > > > > > > I replied to this on a kbuild warning thread, but also going to reply here with > > > more information. > > > > > > https://lore.kernel.org/lkml/YjeY7CfaFKjr8IUc@antec/#R > > > > > > So far this is what I see: > > > > > > * ticket_lock is stuck trying to lock console_sem > > > * it is stuck on atomic_cond_read_acquire > > > reading lock value: returns 0 (*lock is 0x10000) > > > ticket value: is 1 > > > * possible issues: > > > - OpenRISC is big endian, that seems to impact ticket_unlock, it looks > > All csky & riscv are little-endian, it seems the series has a bug with > > big-endian. Is that all right for qemu? (If qemu was all right, but > > real hardware failed.) > > Hi Guo Ren, > > OpenRISC real hardware and QEMU are both big-endian. It fails on both. > > I replied on patch 1/5 with a suggested patch which fixes the issue for me. > Please have a look. Great, I saw that: static __always_inline void ticket_unlock(arch_spinlock_t *lock) { u16 *ptr = (u16 *)lock + __is_defined(__BIG_ENDIAN); //__is_defined(__BIG_ENDIAN) would be zero for openrisc. Using CONFIG_CPU_BIG_ENDIAN is correct, Arnd has also asked me using CONFIG_CPU_BIG_ENDIAN in compat.h: diff --git a/include/asm-generic/compat.h b/include/asm-generic/compat.h index 11653d6846cc..d06308a2a7a8 100644 --- a/include/asm-generic/compat.h +++ b/include/asm-generic/compat.h @@ -14,6 +14,13 @@ #define COMPAT_OFF_T_MAX 0x7fffffff #endif +#if !defined(compat_arg_u64) && !defined(CONFIG_CPU_BIG_ENDIAN) +#define compat_arg_u64(name) u32 name##_lo, u32 name##_hi +#define compat_arg_u64_dual(name) u32, name##_lo, u32, name##_hi +#define compat_arg_u64_glue(name) (((u64)name##_lo & 0xffffffffUL) | \ + ((u64)name##_hi << 32)) +#endif + /* These types are common across all compat ABIs */ typedef u32 compat_size_t; typedef s32 compat_ssize_t; > BTW. now I can look into the sparse warnings. > > -Stafford > -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/