Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp544520rwl; Wed, 5 Apr 2023 04:39:43 -0700 (PDT) X-Google-Smtp-Source: AKy350Z+TROdkMLfdplh9Azf64ytpgmWBT4HjO459QQF15Wx2ouxrhl7Ut1Hf2gsU2rqT6hqQ1Mw X-Received: by 2002:a17:902:fb8b:b0:1a0:563e:b0c4 with SMTP id lg11-20020a170902fb8b00b001a0563eb0c4mr1555748plb.2.1680694783251; Wed, 05 Apr 2023 04:39:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680694783; cv=none; d=google.com; s=arc-20160816; b=lW/0WTk3V+x/Bsu74wRnZd544q3t+Np7k7M++8TmroN6y2nCCKwcriaQRgsFvQcIIC vXU7AtrsjHv4O43BKP0kxFkq+2R4AKtNQSkTc+aic/FNgjZwk10VcjVDIXaJcailOu0B WLrjNFTSmooZs71RkKGjJlOypy+FuQTU5+JbNH9QYODkhE4zrbSR1Xe98Lp3p1s0j+kM /DCXWZcfLI5jL4CC3lqJs3wA1wlVlkCPXl5GQOABnW1z/509coMvrtrk8qqvd/rZZHMU 2RR4WuwEMNCTajh6brb6DIHuUJCwkfAhJP0KSFzBbyxU8X9huL0H5Yz/eCRVIsv47QPA 2HFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=D4c1T5yq9j98I4xqzpkXy98H9NvOxhgZzRxqtRXXoJ8=; b=eZwaB9V/fg1XDcz+OznRe9aY0OlC2HzcH9Pr6EVA7qDe4qSGcwoWk19/khm2QslZNE KC7W2SzUgYomOgPLDD5tva2DonvMpptbFHnxfTwS0AX+cm3BatovXzTQHA9gygb5khto A6C1ZT1L5SBVIBkkGVs9jRoiEG7n4V8z2F378GW2gtelgUnwHRTHHmlYcIlED9TNl2uO gC6bqLl7rx+HxTnzTgoGyOektE5iK26JQgWu3uhoHNpvBFUe16ZtkyKScn0GJblVdayM cca+lIrrT6EaJEDGj+Imq6Qe2srblwfVtHxVWNaOYeatbeFO80l5LsiCmWQ9I0Kfhg0Y ZAAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=gEdmzXz0; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d6-20020a170903230600b0019e9e57f92esi12498947plh.571.2023.04.05.04.39.09; Wed, 05 Apr 2023 04:39:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=gEdmzXz0; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237734AbjDEL3m (ORCPT + 99 others); Wed, 5 Apr 2023 07:29:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237413AbjDEL3h (ORCPT ); Wed, 5 Apr 2023 07:29:37 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AC4D527F for ; Wed, 5 Apr 2023 04:29:31 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id h12-20020a17090aea8c00b0023d1311fab3so36934200pjz.1 for ; Wed, 05 Apr 2023 04:29:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1680694171; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=D4c1T5yq9j98I4xqzpkXy98H9NvOxhgZzRxqtRXXoJ8=; b=gEdmzXz0VIfLxJ35ejE+hqigBd3ZlAebMNBtkV6vu61mKZHcpX9p2jnF1isA21YZIM 3kDnX+jNcaPCNXXmKITQmBn/dZKyUNwjEqTd/EwtALeGgF/kSEnRpv+ERLYe1z/Sfq4G u4HXyAkV0wvl89N1Pjd6gFnwZvqzskXqusycuN4RQZWWBu3GWsrLGlxlt/kmUslAQhzo LZDC0KFmqiBC7ClzCjU/BA5Meb1jEsNvGHJNi6UCZe/+6l7JHXYHv+W4reUxuL9NXVYv QZq4/aMSdFAAiIXiYz/5PEJ0TZ2UhjoODy4m3WsAztl7rAOs2Wo2M77aSaZtWBQpSM6T zQvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680694171; h=in-reply-to:content-transfer-encoding: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=D4c1T5yq9j98I4xqzpkXy98H9NvOxhgZzRxqtRXXoJ8=; b=qp6WmCPlMitPZUomYgZoTj9SmS+jY5WTDx4xv88kJmxoHHWKHsvJDkqEOciHBVAuj6 ebeMNjaYOp0WcsPeOcPl7EhYP/SyUZX/DLNS2JihSy69Eo43VBTg5ep35zwGLwzpWiBV g7FXywYNg2lhDw+nb1jWyfyeBruwMMWQW7RQpb5+GOjA1VJSyNOLxgiIhTTJs2j10YW6 X0ZZcZBcLh27h2pgwnmTNtvGFyxUZfW5xMLHWgIu6ijxZjEP3Wiu48Dp0vuqxIk6NKh2 BcVaPiu+0X58OAXNtJoT+XDERgx2tj3UeJI2C8Pq2Zr0Kv8L2THgGhYsq2GNzCmeIe2c mYdw== X-Gm-Message-State: AAQBX9fX+8H9Fx41r//hyK1dBfFYsjmG3Vib1R25I+pXCgMnLh9OSzsD cWjtigVkP688n92KxtWZQ9cwjQ== X-Received: by 2002:a17:903:244b:b0:1a0:7425:4b73 with SMTP id l11-20020a170903244b00b001a074254b73mr2119520pls.4.1680694170755; Wed, 05 Apr 2023 04:29:30 -0700 (PDT) Received: from sunil-laptop ([106.51.184.50]) by smtp.gmail.com with ESMTPSA id m10-20020a170902bb8a00b001a1d553de0fsm9852768pls.271.2023.04.05.04.29.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 04:29:30 -0700 (PDT) Date: Wed, 5 Apr 2023 16:59:18 +0530 From: Sunil V L To: Jessica Clarke Cc: linux-doc@vger.kernel.org, Linux Kernel Mailing List , linux-riscv , linux-acpi@vger.kernel.org, linux-crypto@vger.kernel.org, platform-driver-x86@vger.kernel.org, llvm@lists.linux.dev, Weili Qian , Albert Ou , Herbert Xu , Tom Rix , Jonathan Corbet , Marc Zyngier , Daniel Lezcano , Nick Desaulniers , Mark Gross , Hans de Goede , Zhou Wang , Palmer Dabbelt , Paul Walmsley , "Rafael J . Wysocki" , Nathan Chancellor , Thomas Gleixner , Maximilian Luz , "David S . Miller" , Len Brown Subject: Re: [PATCH V4 22/23] platform/surface: Disable for RISC-V Message-ID: References: <20230404182037.863533-1-sunilvl@ventanamicro.com> <20230404182037.863533-23-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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: X-Mailing-List: linux-crypto@vger.kernel.org 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 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 > > --- > > 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