Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4809358pxb; Tue, 28 Sep 2021 04:45:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtn4RXSPRf4vrd1id87mSMvPK0BgQoizlvhBd13FUeZwtS0Ohjz/nyYMZX6G/fSas6hxf9 X-Received: by 2002:a17:90a:540a:: with SMTP id z10mr5056708pjh.115.1632829521964; Tue, 28 Sep 2021 04:45:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632829521; cv=none; d=google.com; s=arc-20160816; b=WNEwDFqBxdCie6chXFrLgKtyfpQ2+E6NT2VfQiKPbOsCi8zmk6q0tU/y5RocYQTKWl nlsaBXIOsa6iYu/XRKhY/4N41nkQmgcioj7OIavXf2ZfCxCpT/rPlmQvih1FZYtfFTVw dGQFQxpVy/NXnYcdhatn0w1toqEnkzBS83wo9T3DpZvxX9VIXEAPXM/fPARf9/GlKC5x mM4VjP3rcpFwmwGaOe9Kieum9pdvIvcZkbHXov250S6BTSw6wzQibopJWjsdt9EDSCzF trqww5FsjN54MmOiDz1xj2Zzg7pw+2AQ3nGbuvP4qi5NH/tdXKs475eakpz1gN0LGJS0 SXeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=zlpRLfv/pePFdjhCRdpLn1Hj8LZForNHBFGQsFXmDY4=; b=CvZrEQgck53URZpxu3EW6o3ziKdPAxnHdksNKuBI15IpPTOn6bp4EqL5iw8Quhn7Es tkRP+SIlko4EIgrSE6Ou01EyacAJgrHCXpd0/+yzTEhtZBeOK5sv62+tqU7iEr8MD3Lo Ltb4Q+jOOz0w9CJc7/CA77tk506ir7aRmC5Qa3Qd1PRnIms8V5NjNg41JPgmLDaoXP6v kWpGpnrtK5SVlBa27T6yYO9kGBDwD9995TTFSn90kh6kSNANBMYs9tJZI/fRzQEVqze2 adI7ZGUYw0FEmBwg9s+s1K4LmAEawIlMKpHVJF03gzAoLXd3uaHcR4XFafilVYk+RqCQ BVjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x4si2871477pju.103.2021.09.28.04.45.08; Tue, 28 Sep 2021 04:45:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240392AbhI1Lqf (ORCPT + 99 others); Tue, 28 Sep 2021 07:46:35 -0400 Received: from mga07.intel.com ([134.134.136.100]:37909 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240395AbhI1Lqe (ORCPT ); Tue, 28 Sep 2021 07:46:34 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10120"; a="288339047" X-IronPort-AV: E=Sophos;i="5.85,329,1624345200"; d="scan'208";a="288339047" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2021 04:44:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,329,1624345200"; d="scan'208";a="562224649" Received: from silpixa00400314.ir.intel.com (HELO silpixa00400314.ger.corp.intel.com) ([10.237.222.51]) by fmsmga002.fm.intel.com with ESMTP; 28 Sep 2021 04:44:53 -0700 From: Giovanni Cabiddu To: herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, qat-linux@intel.com, Marco Chiappero , Giovanni Cabiddu Subject: [PATCH 03/12] crypto: qat - remove unnecessary collision prevention step in PFVF Date: Tue, 28 Sep 2021 12:44:31 +0100 Message-Id: <20210928114440.355368-4-giovanni.cabiddu@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210928114440.355368-1-giovanni.cabiddu@intel.com> References: <20210928114440.355368-1-giovanni.cabiddu@intel.com> MIME-Version: 1.0 Organization: Intel Research and Development Ireland Ltd - Co. Reg. #308263 - Collinstown Industrial Park, Leixlip, County Kildare - Ireland Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Marco Chiappero The initial version of the PFVF protocol included an initial "carrier sensing" to get ownership of the channel. Collisions can happen anyway, the extra wait and test does not prevent collisions, it instead slows the communication down, so remove it. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_common/adf_pf2vf_msg.c | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c b/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c index 5a41beb8f20f..d3f6ff68d45d 100644 --- a/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c +++ b/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c @@ -126,28 +126,10 @@ static int __adf_iov_putmsg(struct adf_accel_dev *accel_dev, u32 msg, u8 vf_nr) goto out; } - /* Attempt to get ownership of PF2VF CSR */ msg &= ~local_in_use_mask; msg |= local_in_use_pattern; - ADF_CSR_WR(pmisc_bar_addr, pf2vf_offset, msg); - /* Wait in case remote func also attempting to get ownership */ - msleep(ADF_IOV_MSG_COLLISION_DETECT_DELAY); - - val = ADF_CSR_RD(pmisc_bar_addr, pf2vf_offset); - if ((val & local_in_use_mask) != local_in_use_pattern) { - dev_dbg(&GET_DEV(accel_dev), - "PF2VF CSR in use by remote - collision detected\n"); - ret = -EBUSY; - goto out; - } - - /* - * This function now owns the PV2VF CSR. The IN_USE_BY pattern must - * remain in the PF2VF CSR for all writes including ACK from remote - * until this local function relinquishes the CSR. Send the message - * by interrupting the remote. - */ + /* Attempt to get ownership of the PF2VF CSR */ ADF_CSR_WR(pmisc_bar_addr, pf2vf_offset, msg | int_bit); /* Wait for confirmation from remote func it received the message */ -- 2.31.1