Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6399665rwl; Wed, 22 Mar 2023 10:05:04 -0700 (PDT) X-Google-Smtp-Source: AK7set8vIAcRSdVe73axLiyklSNomacPfQaIP3ZktH84f3FZhv3I0Oqi+JjGXQJIrhLfvg25sGZL X-Received: by 2002:a17:90a:195a:b0:23d:3057:12a3 with SMTP id 26-20020a17090a195a00b0023d305712a3mr4549180pjh.27.1679504704534; Wed, 22 Mar 2023 10:05:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679504704; cv=none; d=google.com; s=arc-20160816; b=mpl5mpEi4V9ee7xOE8KnI8LAqX/BFa3mxNv5ToeU3kWBt8l2IpQm8Q/gNS5qHUitt5 Kz0pCvimqTOVu8ce1hSyY+O5lj2Zg9XMlxdD99S4JCad0Q9hEhbWOGCZDlJ5WCPbWToA 1qf2AsLIk/xAxnIA+ztZAfuCHIVQWQlbnBqv33cHumz77R0KsOOsXn3Bh9sns8Yj+/Bp UTZRLWm5sjSaMgjQAral/kX6Kj4lwgcbHPdE7MbgUjsa7/CJgBxnqAS5o4WpTqCedbpO ufIWlDcX5mXtv6iUDJCO/QumeGEm3hzWJx9JHIy5WziySbL73m0+kvHeH0TYasu6+z9A PY4Q== 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=yS/9N+AwBllIqXlokv2Xx7Y2kyB9tDNA/jGFzKjANCg=; b=G07RAKlnG1os6qRi4Ff7dPgDa+zxubW9mIlfgEKVQcCnoHIRDSC1bgf3e6RWEWgnrA gJ05mlnFUZtVKqa9iX5uKlFDobgZe+oNC+Y3Y/8kp5xZwtDtTw+pxJ6ZLELZFaDAL1/q qJajN97gaSAdP+sdScgK+0bsT6Qm4REJTm2uwJEC+TYTrPBokthRWln7yUsXOstWPYzZ sSGs1/uSZZN04RDGWGuvTf2WWhtbKD54mze3Tgg71i9WiyUiUewmJvYphfJd3/f2yfZL LZhSKqxlMfGL1/Rltjf49m1rZuKwONJRD7wkl6/y2T2phHzyTz1I1sF2UEv4mNFPviH/ pUhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mW2WtieZ; 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=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 o93-20020a17090a0a6600b00231041254cdsi17009474pjo.31.2023.03.22.10.04.51; Wed, 22 Mar 2023 10:05:04 -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=@chromium.org header.s=google header.b=mW2WtieZ; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229497AbjCVRC1 (ORCPT + 99 others); Wed, 22 Mar 2023 13:02:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229863AbjCVRCY (ORCPT ); Wed, 22 Mar 2023 13:02:24 -0400 Received: from mail-ua1-x92f.google.com (mail-ua1-x92f.google.com [IPv6:2607:f8b0:4864:20::92f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57E8334C34 for ; Wed, 22 Mar 2023 10:01:59 -0700 (PDT) Received: by mail-ua1-x92f.google.com with SMTP id e12so8214961uaa.3 for ; Wed, 22 Mar 2023 10:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1679504515; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yS/9N+AwBllIqXlokv2Xx7Y2kyB9tDNA/jGFzKjANCg=; b=mW2WtieZf51QiA7C2qYiyhqafWdEew+rgGMoPwgDiraQIfknm5W23/Zm4uuSjZR8RJ 2II8inYioRr6KA5Qe52A1cDUPKGRb16lcZJB/vnY2QHi2o1JKiuDNT8GTy8O4e4UDExT GsNtUoPziCykWHBM5NJxSkTCmF7t+XZLe4YYM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679504515; 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=yS/9N+AwBllIqXlokv2Xx7Y2kyB9tDNA/jGFzKjANCg=; b=g1xB/mOcigbEzd2t2byFB3jiF5JeJlZkUkUtparsrlmXLaMDP5dnf3q08PmDlpWCy/ 5PMEdrWCSCqn7YT6yZ1+qGlBrV59ZBzmi4iLH0QHWyN5hdMxV6EHlDf5KCr7zI5K3gCX KBIPBiG68qPigW2OpBKx3RkPaoMs8eIQNuWz7IP3zWMyGeLbabNkcH7gq+K3UpcJAB2O 0tnwHpuFjntuOWl6rzVnVG9wgPkN1cV8Y2a0gTFqfgF0D+C2ynL9lDwTrg9ZTt/C0XKv llRjYGtolcmj9o5j8vF3MIsOEtfVhT4RSE0/x3pzBMI4MieXA99zO2B5VuRVYrKty2zL vbIA== X-Gm-Message-State: AAQBX9dM/iPd74k68CqtMecziIfn88wiv+U7p3FrKCB4CA2cN/p7n2Uh eqGjOi/Ft7YQ3bsHHDDtUPQ67Ac5DrUHHVJPQyqdDQ== X-Received: by 2002:ab0:3c8c:0:b0:68a:8f33:9567 with SMTP id a12-20020ab03c8c000000b0068a8f339567mr4186778uax.2.1679504515355; Wed, 22 Mar 2023 10:01:55 -0700 (PDT) MIME-Version: 1.0 References: <20230321212822.5714-1-mario.limonciello@amd.com> <20230321212822.5714-4-mario.limonciello@amd.com> In-Reply-To: <20230321212822.5714-4-mario.limonciello@amd.com> From: Mark Hasemeyer Date: Wed, 22 Mar 2023 11:01:44 -0600 Message-ID: Subject: Re: [PATCH v5 3/3] i2c: designware: Add doorbell support for Mendocino To: Mario Limonciello Cc: Grzegorz Bernacki , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Jan Dabros , Held Felix , linux-i2c@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,URIBL_BLOCKED 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 > +static int psp_send_i2c_req_mendocino(enum psp_i2c_req_type i2c_req_type) > +{ > + int status, ret; > + > + ret = read_poll_timeout(psp_ring_platform_doorbell, status, > + (status != -EBUSY), > + PSP_I2C_REQ_RETRY_DELAY_US, > + PSP_I2C_REQ_RETRY_CNT * PSP_I2C_REQ_RETRY_DELAY_US, > + 0, i2c_req_type); > + if (ret) > + dev_err(psp_i2c_dev, "Timed out waiting for PSP to %s I2C bus\n", > + (i2c_req_type == PSP_I2C_REQ_ACQUIRE) ? > + "release" : "acquire"); > + > + return ret ? ret : status; > +} I think we need the value of the PSP_CMDRESP_STS field returned to the caller and its status checked like in psp_send_i2c_req_cezanne. Otherwise the function won't continue to poll when the PSP_I2C_REQ_STS_BUS_BUSY bit is set. FYI - there's a test on ChromeOS to stress test I2C bus arbitration: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/tast-tests/src/chromiumos/tast/local/bundles/cros/hwsec/tpm_contest.go I can try to run it assuming the ToT kernel runs on skyrim.