From patchwork Thu Apr 28 12:26:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SmFuIETEhWJyb8Wb?= X-Patchwork-Id: 567364 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98540C433EF for ; Thu, 28 Apr 2022 12:27:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346227AbiD1Mao (ORCPT ); Thu, 28 Apr 2022 08:30:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346080AbiD1Mao (ORCPT ); Thu, 28 Apr 2022 08:30:44 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93CCCA6E27 for ; Thu, 28 Apr 2022 05:27:29 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id p12so8329150lfs.5 for ; Thu, 28 Apr 2022 05:27:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=D86VqWFsSM3Q2BxVORseBTMD8q1EWJ6nNtqyTRVzxzo=; b=m0Z2OtpFG7W1/JRCK1QHki2+nTLtGozvlTi+CEdYgSrcoC+gkJGA/Z5cpXEAHZnApd T2y4NjA2cdQPHZ0s3Bxtb+iGu4WvJAdiGJbvyVeya2YXiyPk0j7nf+LXpJfeROqWAXlf hAkL3jmYjJHAZlOkZh9TFXQNxzxla/mVgcW5zLiCkuKHiysb/h2hNOyY+jGIgPNCvVE8 VfvSBjvX7blFyifiwkBIB2+3YcovnTxxj4Jf+6o/JLHow3ilROL+4MAk6CZhlJsDT9Lg U2xAJPC1a/vS1wgds9M9xWG3zxvs9v53QZXEKMd3TQ4UdWLitMKneFHCB0WjHC8zaz85 yELA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=D86VqWFsSM3Q2BxVORseBTMD8q1EWJ6nNtqyTRVzxzo=; b=R3giU0EbubgdmU7i2OAKivULTzvlRq770F01P54O9oeYH7ak7xGA/F4oM1GEtz7ni3 EWUcIYroIZEXSRHYGADuEdtvwXYSFK4zLPzVXnKsNwfh20K7QxZYSnZ3bnSVNN7oZoli 2KbRNnUXMKyhMc990BYFgrs86Q3wvhJ9J3L4Og64xzyipDc4MsVeC8cS3QhAKZ5KD5xw PeW2C0whFwf8EQfbv4tSw5P71ZhQa68Qote68zWwDsbGmo3BmlTdgtGADaIwu0YOU4ex 2ooiSxlD1I5dK8IdyveGwhQoHg96VdzTDCDwkq+5uS2hz5dbZC4T7H/v4fnKGMRx+zxk gmGg== X-Gm-Message-State: AOAM533ZhVkQy86FIq9Gc0gHUPO05wPE5CuPNmwwDk5WslIYUFX6l4RG D35vh4ycrzQodH3vGKOb3v8lQ1hETm6mJA== X-Google-Smtp-Source: ABdhPJwVaLVWeZh7xSITy/Q++AcEKHxRKqg7clfLQNHY+c1uh7VRfE5Rhk7uUtS+kWH1nGV1BbWf9w== X-Received: by 2002:a05:6512:694:b0:471:8eae:8c13 with SMTP id t20-20020a056512069400b004718eae8c13mr23805009lfe.37.1651148847853; Thu, 28 Apr 2022 05:27:27 -0700 (PDT) Received: from dabros-l.wifi.semihalf.net ([185.157.14.92]) by smtp.gmail.com with ESMTPSA id s12-20020ac25fec000000b0044837422334sm2340475lfg.154.2022.04.28.05.27.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Apr 2022 05:27:27 -0700 (PDT) From: Jan Dabros To: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com Cc: mika.westerberg@linux.intel.com, rrangel@chromium.org, Nimesh.Easow@amd.com, upstream@semihalf.com, Jan Dabros Subject: [PATCH] i2c: designware: Modify timing parameters for amdpsp mailbox Date: Thu, 28 Apr 2022 14:26:51 +0200 Message-Id: <20220428122651.208575-1-jsd@semihalf.com> X-Mailer: git-send-email 2.36.0.rc2.479.g8af0fa9b8e-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Adjust retry period and timeout values for x86-PSP mailbox based on the typical I2C traffic generated by PSP. In order to limit the possibility of timeouts, x86 should reduce the interval between retries as well as increase overall time after which it gives up. Signed-off-by: Jan Dabros Acked-by: Jarkko Nikula --- drivers/i2c/busses/i2c-designware-amdpsp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-amdpsp.c b/drivers/i2c/busses/i2c-designware-amdpsp.c index 9b37f2b95abc..b624356c945f 100644 --- a/drivers/i2c/busses/i2c-designware-amdpsp.c +++ b/drivers/i2c/busses/i2c-designware-amdpsp.c @@ -16,8 +16,8 @@ #define PSP_CMD_TIMEOUT_US (500 * USEC_PER_MSEC) #define PSP_I2C_REQ_BUS_CMD 0x64 -#define PSP_I2C_REQ_RETRY_CNT 10 -#define PSP_I2C_REQ_RETRY_DELAY_US (50 * USEC_PER_MSEC) +#define PSP_I2C_REQ_RETRY_CNT 400 +#define PSP_I2C_REQ_RETRY_DELAY_US (25 * USEC_PER_MSEC) #define PSP_I2C_REQ_STS_OK 0x0 #define PSP_I2C_REQ_STS_BUS_BUSY 0x1 #define PSP_I2C_REQ_STS_INV_PARAM 0x3