Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4588746rwd; Tue, 30 May 2023 07:24:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ63QhNIFvZirV2h9bbK+n3nSMkHSIzmCjlBNMcpoymOeNVDlks/Q+MV5/hxzaY62spzbsDf X-Received: by 2002:a05:6a20:94ce:b0:10a:9f55:292b with SMTP id ht14-20020a056a2094ce00b0010a9f55292bmr2409321pzb.57.1685456677410; Tue, 30 May 2023 07:24:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685456677; cv=pass; d=google.com; s=arc-20160816; b=CuZcoAMhhgPlCRRnig/kWcwzXyX4lp5W0iElPlG/XDqUbVaXpOCzWz2XIHehhW73pg gZwKZ4LZyaDmv1wKxtnJcBMD9RV6qZAgL9DZHHEkJJfpc2ngiQcLG30EoSA48sBdY3T4 LdXkIqAlngP76jgnamVumD+j+Gm9j1OQY7phKF/uSY5xJkRrEH8pf++J9ebqZHKdWVzJ VhobMPHlSIqWCm4j3GMWQuJo5DVrFbOEQukufdTDmeYArxd7B+GCUxL3af99wO8p/doX 3CLEtaFYEz7gWwFBMSB5YYO6Ha86Fm7jPrGa4pw/JHlfdPKaVEL04AyKwI+TaqOQrfcF CnqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=YZN+4IQbcpu4hokTBEuLcpuyGJevCYRM7v+j7M2BGLs=; b=xnOsjQWr21p5iYT3aRAXxL3zbWH3IclNkqWiveXDgSKlSkYIcCxJVqzNS6CfuUcYh1 F9YhGksG4YICxgtS+9xk+sW/NqDdroNNTwGfhh1/4Y9JTRWaiy0+P++iB1S8X2Ka9w7d 2Ombu9RGPr3DfIlGwrQuIXxe5DIkT/gLOYqbh/pydVsozTaYVLJwBqUHL3JJKnEN4f4V irl5LL0cP9VhUlhpeRwW99N8lj/nTP/vZMoP83HCACDT9u2oWEgZ8cuBtKSI7bGP0d0T eqy8U+03SVsBYYcpl1DulK+J+X8NZaMWg5DHe7qpn6wzikhAzNcHBWMGnF0Ma8+vX4zT NMvg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b=Ub82OC0k; arc=pass (i=1 spf=pass spfdomain=kunbus.com dkim=pass dkdomain=kunbus.com dmarc=pass fromdomain=kunbus.com); 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kunbus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a63eb45000000b00519ffeb6d43si11225915pgk.188.2023.05.30.07.24.24; Tue, 30 May 2023 07:24:37 -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=@kunbus.com header.s=selector1 header.b=Ub82OC0k; arc=pass (i=1 spf=pass spfdomain=kunbus.com dkim=pass dkdomain=kunbus.com dmarc=pass fromdomain=kunbus.com); 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kunbus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232487AbjE3N6M (ORCPT + 99 others); Tue, 30 May 2023 09:58:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232475AbjE3N6K (ORCPT ); Tue, 30 May 2023 09:58:10 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2047.outbound.protection.outlook.com [40.107.14.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9978EC; Tue, 30 May 2023 06:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UxO4UMgcOLjk050mPUQhay6fOLmsBkGSsDwk/HAG652KzC37/Sx+W8dKapgc4TAtx/Y1vt2TgynKOZ+HCSk/0wqgHHheSxduqCTfhUaoGZUXy+Ur/e6NixTcfW9gNq9mtzLUsDLgjwPvAbiIYJdlPEhg9CNqrKMlvj0bJ6Y/S7XDpy/SPf6qMOBCHq58OZV9Fbw9xo+8Ry+o+4EKGsCimyySb4R8JAMzGH5qkQoG1iNgCQFHpGu1aZSu+R5SZNpzLq0/ymQgr/ZWhNM46XnKtN0geXNAox5v1USXTbXJciRrxsplJRtS5puATsjJHkMqUpg6fQ19abRFwG94Grlo2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YZN+4IQbcpu4hokTBEuLcpuyGJevCYRM7v+j7M2BGLs=; b=OnnANaY6HnuQSh7pi+p4fUV0GNOzW5CsH+aY6mab7HEHN99cql+D9fhc+beUghC0jbXzyFsiqJw+re0tgAj7vTwMnOHhXeJIbD9iw2hq/N4/eJLcJ/jvpgA66GwqRydm8fJAt7WKtoAgWCtw7R7rGn/1U1XPJo+v4w095KiPJ71nHqgQsTVvsVtYRxGbvRwCQP7PQKQQp/AQ7wrKa+aYO6YxlCNDKSQH/2BiRYXT/NafB7SyZxGTtMtFQmvPSSMXsGvUwwMOBDFclHeSKmg8U6Y+7LJp5sNWxlHs5/PR77rz79IYxoltXIJPYWduLMq5koT8Mh+1b1wLv0P/O+XKPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=kunbus.com; dmarc=pass action=none header.from=kunbus.com; dkim=pass header.d=kunbus.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kunbus.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YZN+4IQbcpu4hokTBEuLcpuyGJevCYRM7v+j7M2BGLs=; b=Ub82OC0knU9VrS8pEk/OkR1R638LyfTl6k5nGDVgz5yid/EIpKDzxW286X3jkNcnE6lSOykAH6BFb2NAKkTzOt9WCeYn48crYIZ0IlPrpYxXgwEv1yfvXSjWSlM5Ciwlzmw8gHBHGJ4uEudhp6f3rMV1v4AeUKMnOP93CiHNkr4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=kunbus.com; Received: from VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) by GV1P193MB2039.EURP193.PROD.OUTLOOK.COM (2603:10a6:150:2d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.21; Tue, 30 May 2023 13:58:04 +0000 Received: from VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::6727:e3fb:8fec:72a6]) by VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::6727:e3fb:8fec:72a6%7]) with mapi id 15.20.6455.020; Tue, 30 May 2023 13:58:03 +0000 Message-ID: <95bf627c-8bb4-bc11-79fd-f299e21f1530@kunbus.com> Date: Tue, 30 May 2023 15:58:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: Wrong/strange TPM patches was Re: [PATCH 6.1 000/119] 6.1.31-rc1 review Content-Language: en-US To: Greg Kroah-Hartman , Pavel Machek Cc: stable@vger.kernel.org, patches@lists.linux.dev, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, linux@roeck-us.net, shuah@kernel.org, patches@kernelci.org, lkft-triage@lists.linaro.org, jonathanh@nvidia.com, f.fainelli@gmail.com, sudipm.mukherjee@gmail.com, srw@sladewatkins.net, rwarsow@gmx.de, jarkko@kernel.org, Lukas Wunner , Philipp Rosenberger References: <20230528190835.386670951@linuxfoundation.org> <2023053014-sanctuary-attractor-13ed@gregkh> From: Lino Sanfilippo In-Reply-To: <2023053014-sanctuary-attractor-13ed@gregkh> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR3P281CA0048.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4a::20) To VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P193MB0413:EE_|GV1P193MB2039:EE_ X-MS-Office365-Filtering-Correlation-Id: 7619b5e1-a5fb-4901-6e52-08db6115e307 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NDmnSPRNS78LQ8e62KAivBRWPBFDMipJaLK210a1qD5QhSsipZ8vo91QW6xc4+vRDCaYr5V0NeYlhJ9lFZYFEkMqQjT39nuhrk6k8dSmkvCLMLuePZX6USmyI+1866d0kBEz2XRs6DVsWH1PYPjL+0icHjpCYPXDYZ3XmRU4G1uOkZilWhf06oa4kA8lO5to7nz9qlH3MtKroAPLif8noYPe7USB1GixeCRFS15Vstsg+Gysr1FYpKX9LqmBY1o9TJ4gmaaY2dG5X9sBS4znWXGLaT7pMtkYBiPXaVp9Ntgno6w9uMpn0f31UC/wv86NPER8FSf+awOxmq4hyCl+WVX+71HKunhPOZI7qeJ17ep2KmJMEgB7A9buzO2LfQ7Hp+vYYUwqyOXT20J+O3st6D0upFtfiv7AaWIXlT6fKwSzfYL91ANW9apTkdbvnNQjonsYpK4ZbkiI+/ug1wjOdPIrqNR8V53+IKUQ5OuKk6VONqYOR8BLM4LuYV1s3B9iLqJfEraDJMsZREl3gLb57d+xEo+4bYm+sMXMuZ45DkbvJMU1DHCs/8RY7x20B7gTPq+2hQhM0T2J20pIC2j0hSjn/tc08HT/2CmxPKlKtsSPSnmNR7CQUGl9xGK1hNiAeKXcd26vO3kjXtscW2GG/Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1P193MB0413.EURP193.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(39840400004)(376002)(136003)(396003)(366004)(451199021)(2906002)(53546011)(31686004)(186003)(6506007)(6512007)(54906003)(2616005)(110136005)(478600001)(83380400001)(6486002)(52116002)(8676002)(38100700002)(8936002)(31696002)(41300700001)(316002)(66946007)(36756003)(66476007)(66556008)(5660300002)(86362001)(107886003)(7416002)(4326008)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZnJUZytkN05obnpBeEdVYm1jVjBQS0Z3LzV2MnVIcDZpL0NLWUxyakVockRP?= =?utf-8?B?Ynd5MGlabGVhT1VDbVArcnFKUkw4MXh5TTJhcDQvRXAyM1pXNUZRc01HdGh6?= =?utf-8?B?YWtkd1BUSUZFV2I2VmJ2SklzelV5NzJNdHhoMElWTGZJenZmR2Q4Z1FHRXNQ?= =?utf-8?B?aUlqbloyaU1DVFZVVmUwN1l4YVpuM1dkR1dHRVBxTmxqeVQvSmdSRWVUSURW?= =?utf-8?B?ek1jMldxVWNXUmM4THdaY2VaUDF2MU5sSldQYWxaNlFOaEsrSVl6YnlGWnR0?= =?utf-8?B?bW9IMUoxY1pYbHg1OXBzTzRnTDlxL0dhRW5zMW55NnhzTzBZNFllNjRyK2NH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pIWW9JNENjZUtzdklCTzMzcWgvMUxvYzk0VzI4bE1RbE9VcDFU?= =?utf-8?B?TXhxQWZvOGNOQ09oZnV3OFJwWC9aaSs1RElBVVEvcHZveUEwQjBVdDRMbE04?= =?utf-8?B?T1ArR2lXMzkxMHRUQXkyOXV3QmJ3PT0=?= X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7619b5e1-a5fb-4901-6e52-08db6115e307 X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2023 13:58:03.6973 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: aaa4d814-e659-4b0a-9698-1c671f11520b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1dxhPz3QUDAh5CwIbkZ8qvQP/dx9GW22BJyK4f7HMqlLW3ueyzm9pC/a7ZipJdlQ0gBupODD1LAi29WnvYdoOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1P193MB2039 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham 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 Hi, On 30.05.23 15:02, Greg Kroah-Hartman wrote: > ATTENTION: This e-mail is from an external sender. Please check attachments and links before opening e.g. with mouseover. > > > On Tue, May 30, 2023 at 12:46:49PM +0200, Pavel Machek wrote: >> Hi! >> >>> This is the start of the stable review cycle for the 6.1.31 release. >>> There are 119 patches in this series, all will be posted as a response >>> to this one. If anyone has any issues with these being applied, please >>> let me know. >> >>> Lino Sanfilippo >>> tpm, tpm_tis: Avoid cache incoherency in test for interrupts >> >> Description on this one is wrong/confused. There's no cache problem in >> the code. Plus test_bit and friend already use bit number, so >> >> - bool itpm = priv->flags & TPM_TIS_ITPM_WORKAROUND; >> + bool itpm = test_bit(TPM_TIS_ITPM_WORKAROUND, &priv->flags); >> >> @@ -87,6 +87,7 @@ enum tpm_tis_flags { >> TPM_TIS_ITPM_WORKAROUND = BIT(0), >> TPM_TIS_INVALID_STATUS = BIT(1), >> TPM_TIS_DEFAULT_CANCELLATION = BIT(2), >> + TPM_TIS_IRQ_TESTED = BIT(3), >> }; >> >> this enum needs to go from BIT() to raw numbers. >> >> You can just do return tpm_pm_resume(); >> >>> Jarkko Sakkinen >>> tpm: Prevent hwrng from activating during resume >> >> @@ -429,6 +431,14 @@ int tpm_pm_resume(struct device *dev) >> if (chip == NULL) >> return -ENODEV; >> >> + chip->flags &= ~TPM_CHIP_FLAG_SUSPENDED; >> + >> + /* >> + * Guarantee that SUSPENDED is written last, so that hwrng does not >> + * activate before the chip has been fully resumed. >> + */ >> + wmb(); >> + >> return 0; >> } >> EXPORT_SYMBOL_GPL(tpm_pm_resume); >> >> This code is confused. First, either you don't need memory barriers >> here, or you need real locking. Second, if you want to guarantee flags >> are written last, you need to put the barrier before the >> assignment. (But ... get rid of that confusion, first). > > Care to submit patches to resolve this? It's this way in Linus's tree > now from what I can tell, and these changes were needed for another > stable-marked change, so I'll leave them in for now. > First, thanks for the review Pavel and for spotting this. I will send a patch to fix the enums. Regards, Lino