Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3119650rwl; Mon, 27 Mar 2023 09:27:13 -0700 (PDT) X-Google-Smtp-Source: AKy350bzaerutU74T2Manv0U3TdcmOLttJ2x/WposymSdAm44LzVvUZAMM9Pl5skjqrMfhbFzxqW X-Received: by 2002:a17:906:209e:b0:8d3:be84:1cc6 with SMTP id 30-20020a170906209e00b008d3be841cc6mr10960339ejq.3.1679934433339; Mon, 27 Mar 2023 09:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679934433; cv=none; d=google.com; s=arc-20160816; b=F0q38H98h/p2VyIgqegxlbUlzMFhA7syvGeTa3Od+LJh8wzkQ4Up+gKbt1jtjLrFXx GheghgWvc3GQWj8Gmmn6Smssu/go5Z5gYISGkNiOW7Udl37gaNeCFCeBdamFK8pnO4z6 kks/WpFJu+fMG846TKlkRe1MbHi/Kb8UAnwSzdDtJ+dPsLYebLuIenaWjKv2oZNF3Eya 2dBh8JSKLf58DsXq0lg9aK4yR6TFMFWe4l4+y6TG3mIostEyGFuxknuarecaZuGJv1uE v7tRgeayPifKVdCP/1T4u3qzZiXLpurH2J4eDv7rL7VmQ1YFVbd0LjvA0/N8ZrbZWQVI VKfg== 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=STHUvTYbsFLxECkk6Ly3TGpifupwlelS3imRFFmcQ1g=; b=cWkZSMv3mMOfqdeSXiaWZq7oRtYyFtUeJouhQ05rQpTW7H5ituvSQiEeEQ6uMsB9wf h0KbksxC19MqlRRxoTVofE8uXwt4evhf1tUBXx7uHWi5mL+7YHB0t0xJ+tUy+9W4+ASb /MZxIB+Fb3rJd34lzmh53hZexTXvl1Idjao+jp5kberDQhYnSbXlcR/dGGp/RgKwcCfO Zzud+C3yemkasvRWfNRKs9YHqDsp4wSNZzrdA6HV8BXDvA35MoKeX04nM01WxplSxyhu BWRP4jbl8H5B0Wsz0FdMUmuqQhNPPLBQsa/m/426Hg5GeUlI4tlTpWFymgWuhs7/V7Cj w99Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=I3xcPyZz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ss26-20020a170907039a00b009334d784268si23026038ejb.212.2023.03.27.09.26.42; Mon, 27 Mar 2023 09:27:13 -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=@chromium.org header.s=google header.b=I3xcPyZz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230287AbjC0Q0e (ORCPT + 99 others); Mon, 27 Mar 2023 12:26:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjC0Q0c (ORCPT ); Mon, 27 Mar 2023 12:26:32 -0400 Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1829FB for ; Mon, 27 Mar 2023 09:26:31 -0700 (PDT) Received: by mail-vs1-xe30.google.com with SMTP id z17so1375122vsf.4 for ; Mon, 27 Mar 2023 09:26:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1679934391; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=STHUvTYbsFLxECkk6Ly3TGpifupwlelS3imRFFmcQ1g=; b=I3xcPyZz0Nt3ES4tHyCTFf23qez+BpAxS/rO/QjdDLM+z/s2hBidzFRiZcqntrPSDS Z5qWZK168IgAAc+Fusp+l//Mek01dRDhZivNtiPtvOiu5oj8hbbtcTJJiftgaiv7X0di hG59TxwL1YL/w5/hxH1Bd6LyaKXVxw+Ql4OO4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679934391; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=STHUvTYbsFLxECkk6Ly3TGpifupwlelS3imRFFmcQ1g=; b=rHgCnTd9wLqubsAMUzeL0H/+p1KWJuQucKZQwUyR1JqPtmwrcuKnnKByh++0rfOjuw nSmDswsBZDpsjRAiQv9xqLQYLz+MxAFio+GTjwW5vjlO8HdyNd5j8JZMoa0HDjzrGoHv kdWKLpFWZaL6IFnfEAQEuKRq0qCxU1ciikKxhcRd1U4UK9StBRzx+CpivH5nzmxE5VS+ 0OSg2JwOAKdqGfT2mePjxbzV0/St/tMiI8Dk8kw9XkpOCUvlzImeoPpbSJ6zKjje1sDI Dbz5+LJuDRZIkZY1bto0txZYpvrcSZ3PO1W0RzB45sZXN3ybJpVXtOf/ZbHUlhmlhJ2z dkNA== X-Gm-Message-State: AAQBX9fiFU2HR1m1pCIR95sHpiY2U/O4zqSrXT5BU5Jx0qK5OfG++g4s dAH4z/hlxckb5XcwBvGhVc0qoHw2XI4ia5lyo6zbLg== X-Received: by 2002:a67:c202:0:b0:425:d096:fd42 with SMTP id i2-20020a67c202000000b00425d096fd42mr6060497vsj.5.1679934390956; Mon, 27 Mar 2023 09:26:30 -0700 (PDT) MIME-Version: 1.0 References: <20230322210227.464-1-mario.limonciello@amd.com> <20230322210227.464-3-mario.limonciello@amd.com> In-Reply-To: <20230322210227.464-3-mario.limonciello@amd.com> From: Mark Hasemeyer Date: Mon, 27 Mar 2023 10:26:20 -0600 Message-ID: Subject: Re: [PATCH v6 2/4] crypto: ccp: Return doorbell status code as an argument To: Mario Limonciello Cc: =?UTF-8?B?SmFuIETEhWJyb8Wb?= , Grzegorz Bernacki , Tom Lendacky , John Allen , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,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 > -int psp_ring_platform_doorbell(int msg) > +int psp_ring_platform_doorbell(int msg, u32 *result) > { > struct psp_device *psp = psp_get_master_device(); > struct psp_platform_access_device *pa_dev; > @@ -184,6 +184,8 @@ int psp_ring_platform_doorbell(int msg) > > val = FIELD_GET(PSP_CMDRESP_STS, ioread32(cmd)); > if (val) { > + if (result) > + *result = val; > ret = -EIO; > goto unlock; > } The bitfields in the new mailbox architecture have changed, as it is now a dedicated mailbox for I2C arbitration. The 8 lsbs are used for command and response status, and bit 31 is the ready bit. Accounting for these changes, I was able to get the TPM contention test to pass locally. I also removed calls to "check_doorbell" and "check_recovery" as those steps weren't described in the design doc.