lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 099/563] crypto: qat - remove unnecessary collision prevention step in PFVF
    Date
    From: Marco Chiappero <marco.chiappero@intel.com>

    [ Upstream commit e17f49bb244a281fe39bfdad0306a38b3a02e7bf ]

    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 <marco.chiappero@intel.com>
    Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    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 e3da97286980e..d1dbf6216de57 100644
    --- a/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c
    +++ b/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c
    @@ -120,28 +120,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.34.1


    \
     
     \ /
      Last update: 2022-01-24 22:41    [W:4.016 / U:1.412 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site