Message ID | 20230404182037.863533-23-sunilvl@ventanamicro.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp86673vqo; Tue, 4 Apr 2023 11:40:25 -0700 (PDT) X-Google-Smtp-Source: AKy350ZZQ9LnSMTuyxIFj+TVjewj1QJfecGzeB4DJ8+B5SdsPvQYpIvA+N0pgBY+LTCk6ks9/jm8 X-Received: by 2002:a05:6402:8d7:b0:4fd:2675:3783 with SMTP id d23-20020a05640208d700b004fd26753783mr516028edz.1.1680633625742; Tue, 04 Apr 2023 11:40:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680633625; cv=none; d=google.com; s=arc-20160816; b=bK/V14ctcJnHhiG5QJuLOtekKb7buw4h8AP/dmXx4X4N1CzmheQPXWZe90HHeED7Bg KQudlXkF1JoOo1TiHny3fmAQRL70tGixzE+Ck9GlXqVuZibz5BkB7ZFAtESjJK412wPR TaCqlgbensKFcQuBnyAiGiuuNoLvvwO8JdG6ia0rErR5F06lCjVV7RDtCxg5U7Mojnt1 S0dkRBFzunYtzZ+bBn4TpypojbJTLI+91NHMtbhmTqxafVLiJ/+p3mqP4U4KREefOkTG mN0z5rX/B2pOdBdhmlr7NMSxn+iGl/ZexTmjlpFAS7p79KfWLxvor2MsPgFL7ox82RE3 IcOw== 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:date:subject:cc:to:from :dkim-signature; bh=bQY7IsXlYzYdPvbtAuGQhW+vz7kmikxb6Hsl9qnqiJo=; b=JlrfJozv4//E1+g+ViaXaSaUnn29gLKUMIMo+1LyChhZJ20z4l0uUoYx2j36mkQpiC 1pfOp5X2Oc1BINQdVZnhOkt02TGZR9DpHLP4JMzVgIBCbiwJ/flSrKpboHkJQPcMErFw JnFF2MD5qG+lQd47/QVDeH8pxG9rAwRNWtlD64m3ZSgXZ3gyAnVi2ubdMUtumE6S+cp6 eMGqdFPTEFVYxp67DiUprALMcLdDMxSZ/TlwqcUvVjptohjouxvp3fjCeN4UpdHUE/Ff Q0jWZzrDss7+QxJ9VC44wOzn2bREEoD4zSOtIiRhiVnHrOBFaaK1FvxycS8KLzCeDAQw x7hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=SIAlskAB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w16-20020aa7cb50000000b004fcbd87bb03si2059521edt.333.2023.04.04.11.40.01; Tue, 04 Apr 2023 11:40:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=SIAlskAB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236272AbjDDS0c (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Tue, 4 Apr 2023 14:26:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236226AbjDDS0B (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 4 Apr 2023 14:26:01 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87C127289 for <linux-kernel@vger.kernel.org>; Tue, 4 Apr 2023 11:23:33 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id o11so32174808ple.1 for <linux-kernel@vger.kernel.org>; Tue, 04 Apr 2023 11:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1680632602; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bQY7IsXlYzYdPvbtAuGQhW+vz7kmikxb6Hsl9qnqiJo=; b=SIAlskABjXHJXgba+lu7R2T7GFAtUq29s7yTNteHrnjrRREnu/xfZzyK9AUbLub4UK OLevFJEkggs/7Las41GW3kOI9I0FbvaO/b1X4vW1T9Nqb/5dgHdvbBlCt4kJaRuyzOJP 5DO5UZ4mgBvY0/bjKpTLrHD2ZT/64XlWo9QjLPheIFMQeFiXMeVDHb2T8Gj12+6ixTqi JCpYKfxf/H/dO6Iehr15B5nWCst6ZMA+J12yAIa9JygFJJNFZ22V/Fvf8sJbgyIZa92u 3vXDVcm+fZTnZDGc6Osgee5Mxo83Hf/3/hhAazhj7e3hI24w4Z944ntBwybmg0bZtph9 w1Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680632602; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bQY7IsXlYzYdPvbtAuGQhW+vz7kmikxb6Hsl9qnqiJo=; b=mTN0eT/Nh9oJGFJtmS9rUnqziIT09k0XHlWencdv9UEI1+gHDAkcsJNPhCVRESrRPE AAiTV57T3bwqbJ0XLVsZiGLNR/S9+YR2bryMfkYmSjvYhU3Py87F5ItG4WKZrHP/+cWg vNeI6Svr1lXdmm90GmSOuZt+kia13dKuTz5g/VYkOO3BiggS7xOqLRFLcgOC5f+chY2k FBjE1H74CwrxBlh9KFBjy3uHs48ry0Hmgvqg+kYtsrTBUs1eEopFkZc6LO9kHVqJACL7 evNRvO2ry+2Lr98UrUhh+BVh/auM5JzKFFyZLyJMBwCnvop8TKwqWOoseyTRdSz8jd7L u80A== X-Gm-Message-State: AAQBX9d7XqjhkxMJ3Lxpfdu3YGejZNgfVvARl4gLS0/hfsaEmXM5WJLq 7BGRgFGB+gOAQt5N8zHYwosqiQ== X-Received: by 2002:a05:6a20:4659:b0:db:9726:8e46 with SMTP id eb25-20020a056a20465900b000db97268e46mr2674124pzb.54.1680632601831; Tue, 04 Apr 2023 11:23:21 -0700 (PDT) Received: from localhost.localdomain ([106.51.184.50]) by smtp.gmail.com with ESMTPSA id o12-20020a056a001bcc00b0062dcf5c01f9sm9018524pfw.36.2023.04.04.11.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 11:23:21 -0700 (PDT) From: Sunil V L <sunilvl@ventanamicro.com> To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-crypto@vger.kernel.org, platform-driver-x86@vger.kernel.org, llvm@lists.linux.dev Cc: Jonathan Corbet <corbet@lwn.net>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Len Brown <lenb@kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Thomas Gleixner <tglx@linutronix.de>, Weili Qian <qianweili@huawei.com>, Zhou Wang <wangzhou1@hisilicon.com>, Herbert Xu <herbert@gondor.apana.org.au>, Marc Zyngier <maz@kernel.org>, Maximilian Luz <luzmaximilian@gmail.com>, Hans de Goede <hdegoede@redhat.com>, Mark Gross <markgross@kernel.org>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Tom Rix <trix@redhat.com>, "Rafael J . Wysocki" <rafael@kernel.org>, "David S . Miller" <davem@davemloft.net>, Sunil V L <sunilvl@ventanamicro.com> Subject: [PATCH V4 22/23] platform/surface: Disable for RISC-V Date: Tue, 4 Apr 2023 23:50:36 +0530 Message-Id: <20230404182037.863533-23-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230404182037.863533-1-sunilvl@ventanamicro.com> References: <20230404182037.863533-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=cp1252 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762272085046891555?= X-GMAIL-MSGID: =?utf-8?q?1762272085046891555?= |
Series |
Add basic ACPI support for RISC-V
|
|
Commit Message
Sunil V L
April 4, 2023, 6:20 p.m. UTC
With CONFIG_ACPI enabled for RISC-V, this driver gets enabled
in allmodconfig build. However, RISC-V doesn't support sub-word
atomics which is used by this driver. Due to this, the build fails
with below error.
In function ‘ssh_seq_next’,
inlined from ‘ssam_request_write_data’ at drivers/platform/surface/aggregator/controller.c:1483:8:
././include/linux/compiler_types.h:399:45: error: call to ‘__compiletime_assert_335’ declared with attribute error: BUILD_BUG failed
399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
./include/linux/compiler.h:78:45: note: in definition of macro ‘unlikely’
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
././include/linux/compiler_types.h:387:9: note: in expansion of macro ‘__compiletime_assert’
387 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:399:9: note: in expansion of macro ‘_compiletime_assert’
399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
| ^~~~~~~~~~~~~~~~
./arch/riscv/include/asm/cmpxchg.h:335:17: note: in expansion of macro ‘BUILD_BUG’
335 | BUILD_BUG(); \
| ^~~~~~~~~
./arch/riscv/include/asm/cmpxchg.h:344:30: note: in expansion of macro ‘__cmpxchg’
344 | (__typeof__(*(ptr))) __cmpxchg((ptr), \
| ^~~~~~~~~
./include/linux/atomic/atomic-instrumented.h:1916:9: note: in expansion of macro ‘arch_cmpxchg’
1916 | arch_cmpxchg(__ai_ptr, __VA_ARGS__); \
| ^~~~~~~~~~~~
drivers/platform/surface/aggregator/controller.c:61:32: note: in expansion of macro ‘cmpxchg’
61 | while (unlikely((ret = cmpxchg(&c->value, old, new)) != old)) {
| ^~~~~~~
So, disable this driver for RISC-V even when ACPI is enabled for now.
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
---
drivers/platform/surface/aggregator/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 4 Apr 2023, at 19:20, Sunil V L <sunilvl@ventanamicro.com> wrote: > > With CONFIG_ACPI enabled for RISC-V, this driver gets enabled > in allmodconfig build. However, RISC-V doesn't support sub-word > atomics which is used by this driver. Why not? Compilers and libatomic do, so surely the Linux kernel should too. > Due to this, the build fails > with below error. > > In function ‘ssh_seq_next’, > inlined from ‘ssam_request_write_data’ at drivers/platform/surface/aggregator/controller.c:1483:8: > ././include/linux/compiler_types.h:399:45: error: call to ‘__compiletime_assert_335’ declared with attribute error: BUILD_BUG failed > 399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > | ^ > ./include/linux/compiler.h:78:45: note: in definition of macro ‘unlikely’ > 78 | # define unlikely(x) __builtin_expect(!!(x), 0) > | ^ > ././include/linux/compiler_types.h:387:9: note: in expansion of macro ‘__compiletime_assert’ > 387 | __compiletime_assert(condition, msg, prefix, suffix) > | ^~~~~~~~~~~~~~~~~~~~ > ././include/linux/compiler_types.h:399:9: note: in expansion of macro ‘_compiletime_assert’ > 399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > | ^~~~~~~~~~~~~~~~~~~ > ./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’ > 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > | ^~~~~~~~~~~~~~~~~~ > ./include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’ > 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") > | ^~~~~~~~~~~~~~~~ > ./arch/riscv/include/asm/cmpxchg.h:335:17: note: in expansion of macro ‘BUILD_BUG’ > 335 | BUILD_BUG(); \ > | ^~~~~~~~~ > ./arch/riscv/include/asm/cmpxchg.h:344:30: note: in expansion of macro ‘__cmpxchg’ > 344 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > ./include/linux/atomic/atomic-instrumented.h:1916:9: note: in expansion of macro ‘arch_cmpxchg’ > 1916 | arch_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~~ > drivers/platform/surface/aggregator/controller.c:61:32: note: in expansion of macro ‘cmpxchg’ > 61 | while (unlikely((ret = cmpxchg(&c->value, old, new)) != old)) { > | ^~~~~~~ > > So, disable this driver for RISC-V even when ACPI is enabled for now. > > Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> > --- > drivers/platform/surface/aggregator/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/platform/surface/aggregator/Kconfig b/drivers/platform/surface/aggregator/Kconfig > index c114f9dd5fe1..88afc38ffdc5 100644 > --- a/drivers/platform/surface/aggregator/Kconfig > +++ b/drivers/platform/surface/aggregator/Kconfig > @@ -4,7 +4,7 @@ > menuconfig SURFACE_AGGREGATOR > tristate "Microsoft Surface System Aggregator Module Subsystem and Drivers" > depends on SERIAL_DEV_BUS > - depends on ACPI > + depends on ACPI && !RISCV If you insist on doing this, at least make it some new config variable that’s self-documenting and means this automatically gets re-enabled when arch/riscv fixes this deficiency? Hard-coding arch lists like this seems like a terrible anti-pattern. Jess > select CRC_CCITT > help > The Surface System Aggregator Module (Surface SAM or SSAM) is an > -- > 2.34.1 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv
On 4/4/23 20:20, Sunil V L wrote: > With CONFIG_ACPI enabled for RISC-V, this driver gets enabled > in allmodconfig build. However, RISC-V doesn't support sub-word > atomics which is used by this driver. Due to this, the build fails > with below error. > > In function ‘ssh_seq_next’, > inlined from ‘ssam_request_write_data’ at drivers/platform/surface/aggregator/controller.c:1483:8: > ././include/linux/compiler_types.h:399:45: error: call to ‘__compiletime_assert_335’ declared with attribute error: BUILD_BUG failed > 399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > | ^ > ./include/linux/compiler.h:78:45: note: in definition of macro ‘unlikely’ > 78 | # define unlikely(x) __builtin_expect(!!(x), 0) > | ^ > ././include/linux/compiler_types.h:387:9: note: in expansion of macro ‘__compiletime_assert’ > 387 | __compiletime_assert(condition, msg, prefix, suffix) > | ^~~~~~~~~~~~~~~~~~~~ > ././include/linux/compiler_types.h:399:9: note: in expansion of macro ‘_compiletime_assert’ > 399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > | ^~~~~~~~~~~~~~~~~~~ > ./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’ > 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > | ^~~~~~~~~~~~~~~~~~ > ./include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’ > 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") > | ^~~~~~~~~~~~~~~~ > ./arch/riscv/include/asm/cmpxchg.h:335:17: note: in expansion of macro ‘BUILD_BUG’ > 335 | BUILD_BUG(); \ > | ^~~~~~~~~ > ./arch/riscv/include/asm/cmpxchg.h:344:30: note: in expansion of macro ‘__cmpxchg’ > 344 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > ./include/linux/atomic/atomic-instrumented.h:1916:9: note: in expansion of macro ‘arch_cmpxchg’ > 1916 | arch_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~~ > drivers/platform/surface/aggregator/controller.c:61:32: note: in expansion of macro ‘cmpxchg’ > 61 | while (unlikely((ret = cmpxchg(&c->value, old, new)) != old)) { > | ^~~~~~~ > > So, disable this driver for RISC-V even when ACPI is enabled for now. CONFIG_SURFACE_PLATFORMS should be enabled for ARM64 || X86 || COMPILE_TEST only, so I guess the issue only happens when compiling with the latter enabled? I'm not aware of any current plans of MS to release RISC-V-based Surface devices, so you could maybe also just explicitly disable CONFIG_SURFACE_PLATFORMS. In any case, I don't see any issues with disabling the whole platform/surface or only individual drivers for RISC-V, so for either solution: Acked-by: Maximilian Luz <luzmaximilian@gmail.com> > Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> > --- > drivers/platform/surface/aggregator/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/platform/surface/aggregator/Kconfig b/drivers/platform/surface/aggregator/Kconfig > index c114f9dd5fe1..88afc38ffdc5 100644 > --- a/drivers/platform/surface/aggregator/Kconfig > +++ b/drivers/platform/surface/aggregator/Kconfig > @@ -4,7 +4,7 @@ > menuconfig SURFACE_AGGREGATOR > tristate "Microsoft Surface System Aggregator Module Subsystem and Drivers" > depends on SERIAL_DEV_BUS > - depends on ACPI > + depends on ACPI && !RISCV > select CRC_CCITT > help > The Surface System Aggregator Module (Surface SAM or SSAM) is an
On Wed, Apr 05, 2023 at 11:33:00AM +0200, Maximilian Luz wrote: > On 4/4/23 20:20, Sunil V L wrote: > > With CONFIG_ACPI enabled for RISC-V, this driver gets enabled > > in allmodconfig build. However, RISC-V doesn't support sub-word > > atomics which is used by this driver. Due to this, the build fails > > with below error. > > > > In function ‘ssh_seq_next’, > > inlined from ‘ssam_request_write_data’ at drivers/platform/surface/aggregator/controller.c:1483:8: > > ././include/linux/compiler_types.h:399:45: error: call to ‘__compiletime_assert_335’ declared with attribute error: BUILD_BUG failed > > 399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > > | ^ > > ./include/linux/compiler.h:78:45: note: in definition of macro ‘unlikely’ > > 78 | # define unlikely(x) __builtin_expect(!!(x), 0) > > | ^ > > ././include/linux/compiler_types.h:387:9: note: in expansion of macro ‘__compiletime_assert’ > > 387 | __compiletime_assert(condition, msg, prefix, suffix) > > | ^~~~~~~~~~~~~~~~~~~~ > > ././include/linux/compiler_types.h:399:9: note: in expansion of macro ‘_compiletime_assert’ > > 399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > > | ^~~~~~~~~~~~~~~~~~~ > > ./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’ > > 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > > | ^~~~~~~~~~~~~~~~~~ > > ./include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’ > > 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") > > | ^~~~~~~~~~~~~~~~ > > ./arch/riscv/include/asm/cmpxchg.h:335:17: note: in expansion of macro ‘BUILD_BUG’ > > 335 | BUILD_BUG(); \ > > | ^~~~~~~~~ > > ./arch/riscv/include/asm/cmpxchg.h:344:30: note: in expansion of macro ‘__cmpxchg’ > > 344 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > > | ^~~~~~~~~ > > ./include/linux/atomic/atomic-instrumented.h:1916:9: note: in expansion of macro ‘arch_cmpxchg’ > > 1916 | arch_cmpxchg(__ai_ptr, __VA_ARGS__); \ > > | ^~~~~~~~~~~~ > > drivers/platform/surface/aggregator/controller.c:61:32: note: in expansion of macro ‘cmpxchg’ > > 61 | while (unlikely((ret = cmpxchg(&c->value, old, new)) != old)) { > > | ^~~~~~~ > > > > So, disable this driver for RISC-V even when ACPI is enabled for now. > > CONFIG_SURFACE_PLATFORMS should be enabled for ARM64 || X86 || COMPILE_TEST only, > so I guess the issue only happens when compiling with the latter enabled? > > I'm not aware of any current plans of MS to release RISC-V-based Surface > devices, so you could maybe also just explicitly disable CONFIG_SURFACE_PLATFORMS. > In any case, I don't see any issues with disabling the whole platform/surface > or only individual drivers for RISC-V, so for either solution: > > Acked-by: Maximilian Luz <luzmaximilian@gmail.com> > Hi Maximilian, Thanks!. Yes, COMPILE_TEST gets enabled for allmodconfig builds. Since the whole intention of COMPILE_TEST appears to be able to compile-test drivers on a platform than they are supposed to be used, I think it is better not to skip whole set of drivers but only that which can not build. So, I prefer to keep this change as is. Thanks, Sunil
Hi Jess, On Wed, Apr 05, 2023 at 05:19:35AM +0100, Jessica Clarke wrote: > On 4 Apr 2023, at 19:20, Sunil V L <sunilvl@ventanamicro.com> wrote: > > > > With CONFIG_ACPI enabled for RISC-V, this driver gets enabled > > in allmodconfig build. However, RISC-V doesn't support sub-word > > atomics which is used by this driver. > > Why not? Compilers and libatomic do, so surely the Linux kernel should > too. > I think you are probably right. But I don't want to combine that activity with this series. IMO, that should be separate activity. > > Due to this, the build fails > > with below error. > > > > In function ‘ssh_seq_next’, > > inlined from ‘ssam_request_write_data’ at drivers/platform/surface/aggregator/controller.c:1483:8: > > ././include/linux/compiler_types.h:399:45: error: call to ‘__compiletime_assert_335’ declared with attribute error: BUILD_BUG failed > > 399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > > | ^ > > ./include/linux/compiler.h:78:45: note: in definition of macro ‘unlikely’ > > 78 | # define unlikely(x) __builtin_expect(!!(x), 0) > > | ^ > > ././include/linux/compiler_types.h:387:9: note: in expansion of macro ‘__compiletime_assert’ > > 387 | __compiletime_assert(condition, msg, prefix, suffix) > > | ^~~~~~~~~~~~~~~~~~~~ > > ././include/linux/compiler_types.h:399:9: note: in expansion of macro ‘_compiletime_assert’ > > 399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > > | ^~~~~~~~~~~~~~~~~~~ > > ./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’ > > 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > > | ^~~~~~~~~~~~~~~~~~ > > ./include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’ > > 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") > > | ^~~~~~~~~~~~~~~~ > > ./arch/riscv/include/asm/cmpxchg.h:335:17: note: in expansion of macro ‘BUILD_BUG’ > > 335 | BUILD_BUG(); \ > > | ^~~~~~~~~ > > ./arch/riscv/include/asm/cmpxchg.h:344:30: note: in expansion of macro ‘__cmpxchg’ > > 344 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > > | ^~~~~~~~~ > > ./include/linux/atomic/atomic-instrumented.h:1916:9: note: in expansion of macro ‘arch_cmpxchg’ > > 1916 | arch_cmpxchg(__ai_ptr, __VA_ARGS__); \ > > | ^~~~~~~~~~~~ > > drivers/platform/surface/aggregator/controller.c:61:32: note: in expansion of macro ‘cmpxchg’ > > 61 | while (unlikely((ret = cmpxchg(&c->value, old, new)) != old)) { > > | ^~~~~~~ > > > > So, disable this driver for RISC-V even when ACPI is enabled for now. > > > > Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> > > --- > > drivers/platform/surface/aggregator/Kconfig | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/platform/surface/aggregator/Kconfig b/drivers/platform/surface/aggregator/Kconfig > > index c114f9dd5fe1..88afc38ffdc5 100644 > > --- a/drivers/platform/surface/aggregator/Kconfig > > +++ b/drivers/platform/surface/aggregator/Kconfig > > @@ -4,7 +4,7 @@ > > menuconfig SURFACE_AGGREGATOR > > tristate "Microsoft Surface System Aggregator Module Subsystem and Drivers" > > depends on SERIAL_DEV_BUS > > - depends on ACPI > > + depends on ACPI && !RISCV > > If you insist on doing this, at least make it some new config variable > that’s self-documenting and means this automatically gets re-enabled > when arch/riscv fixes this deficiency? Hard-coding arch lists like this > seems like a terrible anti-pattern. > I understand your point. But given that this is currently only issue with a single driver from Microsoft and that too only in COMPILE_TEST builds, I think introducing a new config variable is overkill. If we support sub-word atomics in kernel, the option may not be useful much anyway. There are patterns to disable an architecture for COMPILE_TEST builds. Thanks, Sunil
On 4/5/23 13:11, Sunil V L wrote: > On Wed, Apr 05, 2023 at 11:33:00AM +0200, Maximilian Luz wrote: >> On 4/4/23 20:20, Sunil V L wrote: >>> With CONFIG_ACPI enabled for RISC-V, this driver gets enabled >>> in allmodconfig build. However, RISC-V doesn't support sub-word >>> atomics which is used by this driver. Due to this, the build fails >>> with below error. >>> >>> In function ‘ssh_seq_next’, >>> inlined from ‘ssam_request_write_data’ at drivers/platform/surface/aggregator/controller.c:1483:8: >>> ././include/linux/compiler_types.h:399:45: error: call to ‘__compiletime_assert_335’ declared with attribute error: BUILD_BUG failed >>> 399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) >>> | ^ >>> ./include/linux/compiler.h:78:45: note: in definition of macro ‘unlikely’ >>> 78 | # define unlikely(x) __builtin_expect(!!(x), 0) >>> | ^ >>> ././include/linux/compiler_types.h:387:9: note: in expansion of macro ‘__compiletime_assert’ >>> 387 | __compiletime_assert(condition, msg, prefix, suffix) >>> | ^~~~~~~~~~~~~~~~~~~~ >>> ././include/linux/compiler_types.h:399:9: note: in expansion of macro ‘_compiletime_assert’ >>> 399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) >>> | ^~~~~~~~~~~~~~~~~~~ >>> ./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’ >>> 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) >>> | ^~~~~~~~~~~~~~~~~~ >>> ./include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’ >>> 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") >>> | ^~~~~~~~~~~~~~~~ >>> ./arch/riscv/include/asm/cmpxchg.h:335:17: note: in expansion of macro ‘BUILD_BUG’ >>> 335 | BUILD_BUG(); \ >>> | ^~~~~~~~~ >>> ./arch/riscv/include/asm/cmpxchg.h:344:30: note: in expansion of macro ‘__cmpxchg’ >>> 344 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ >>> | ^~~~~~~~~ >>> ./include/linux/atomic/atomic-instrumented.h:1916:9: note: in expansion of macro ‘arch_cmpxchg’ >>> 1916 | arch_cmpxchg(__ai_ptr, __VA_ARGS__); \ >>> | ^~~~~~~~~~~~ >>> drivers/platform/surface/aggregator/controller.c:61:32: note: in expansion of macro ‘cmpxchg’ >>> 61 | while (unlikely((ret = cmpxchg(&c->value, old, new)) != old)) { >>> | ^~~~~~~ >>> >>> So, disable this driver for RISC-V even when ACPI is enabled for now. >> >> CONFIG_SURFACE_PLATFORMS should be enabled for ARM64 || X86 || COMPILE_TEST only, >> so I guess the issue only happens when compiling with the latter enabled? >> >> I'm not aware of any current plans of MS to release RISC-V-based Surface >> devices, so you could maybe also just explicitly disable CONFIG_SURFACE_PLATFORMS. >> In any case, I don't see any issues with disabling the whole platform/surface >> or only individual drivers for RISC-V, so for either solution: >> >> Acked-by: Maximilian Luz <luzmaximilian@gmail.com> >> > Hi Maximilian, > > Thanks!. Yes, COMPILE_TEST gets enabled for allmodconfig builds. Since > the whole intention of COMPILE_TEST appears to be able to compile-test > drivers on a platform than they are supposed to be used, I think it is > better not to skip whole set of drivers but only that which can not build. > So, I prefer to keep this change as is. Hi Sunil, What I wanted to say with my previous mail: I'm fairly confident that platform/surface drivers will not be actively used on RISC-V hardware any time soon (not sure if that came over in this way). But whatever you/others prefer, I'm happy with either. Best regards, Max
diff --git a/drivers/platform/surface/aggregator/Kconfig b/drivers/platform/surface/aggregator/Kconfig index c114f9dd5fe1..88afc38ffdc5 100644 --- a/drivers/platform/surface/aggregator/Kconfig +++ b/drivers/platform/surface/aggregator/Kconfig @@ -4,7 +4,7 @@ menuconfig SURFACE_AGGREGATOR tristate "Microsoft Surface System Aggregator Module Subsystem and Drivers" depends on SERIAL_DEV_BUS - depends on ACPI + depends on ACPI && !RISCV select CRC_CCITT help The Surface System Aggregator Module (Surface SAM or SSAM) is an