From patchwork Wed Sep 1 15:25:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 505427 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_NO_TEXT, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0558C432BE for ; Wed, 1 Sep 2021 15:19:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8A3156109E for ; Wed, 1 Sep 2021 15:19:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245479AbhIAPUH (ORCPT ); Wed, 1 Sep 2021 11:20:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343525AbhIAPUH (ORCPT ); Wed, 1 Sep 2021 11:20:07 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4683BC061575 for ; Wed, 1 Sep 2021 08:19:10 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so4938699pjr.1 for ; Wed, 01 Sep 2021 08:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:mime-version; bh=gXj5XgWgvL/dIf7EvaarhqvITErIu4AUt5qSxaTYLek=; b=QWOHKHsjhcBt0uBaao8pgALmhpZDXf5A0NXwCO7FMxW+Dx5bVrncTmQu3jSDeVlpGQ hTMa4lR87H6tf83Fym/rjvYXC0xhrHry0xXfzx5lDnIZI4M+7aGRGTZdsLIcNeiTB2Ll 8igNo+RSQGCUITNlSweb58JP+OZow9B//i2Qc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=gXj5XgWgvL/dIf7EvaarhqvITErIu4AUt5qSxaTYLek=; b=bFfZ+0mYfhAtRonWNAo9QbEJvXrxfs/1ShBj16zjQ2lYlUgUHKUXmkP0Nah7AK/Cqj UNWYO85Kmr4P0m0xv6B0d6OuVbTY0MsRYiNfaE9y36KEzAujkbzukjWLTU3rKNhsvJJg sMrqYasPUK7x0fkJsEg/CUXfH9BOQqyD6CzXK2V5euPRdFXGY2lLlIv8nf2kMOSciMsV 6qkKTFr+aeIfDWOzB6XzY00YqWno1fLJIrlHL6NaahU0Jov+FlAZQSs/dO5/LpvCuLm3 /2NgyM0/t7q7uh/2ayGFkodNOkb4W6hf4jqhzXYO3aHeSrFlfxyJ40MRAx32+uvqCX1A +FLQ== X-Gm-Message-State: AOAM533UAK8k38YrfOPQ6nuObnTOvWJtyk3XSnGFErvRBgJdzrbvdtfo PvOSFyLKiHCjkeYBRPXWf3QK0YYdKQklL3xyZ6Ihqr2d1SEHbK+lMI3q9jGtNmr9fFKSPHDLU55 wpfUAWYDCHcZx1ub/8shQHxqzHU6dPCdkSsb39X8V0JxTNe9UKsjqpsg18e1VwDIsf18L3T0EPB m6AqWVAjlO X-Google-Smtp-Source: ABdhPJymFiJLCToek8xSeXnoJTBIV2DbeW8GvuSzkrNE/OTRELm1gfRpLyRWHlZWA5gI090xs33PJA== X-Received: by 2002:a17:902:9889:b0:12c:fd88:530b with SMTP id s9-20020a170902988900b0012cfd88530bmr10073423plp.33.1630509549051; Wed, 01 Sep 2021 08:19:09 -0700 (PDT) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id r3sm266356pff.119.2021.09.01.08.19.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 08:19:08 -0700 (PDT) From: Sreekanth Reddy To: linux-scsi@vger.kernel.org, martin.petersen@oracle.com Cc: bvanassche@acm.org, Sreekanth Reddy Subject: [PATCH] mpt3sas: Call cpu_relax() before calling udelay() Date: Wed, 1 Sep 2021 20:55:42 +0530 Message-Id: <20210901152542.27866-1-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Call cpu_relax() API while waiting for the current blk-mq polling instance to complete. Signed-off-by: Sreekanth Reddy Reviewed-by: Bart Van Assche --- drivers/scsi/mpt3sas/mpt3sas_base.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 2528c4e7b0e0..c0d0d311d676 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -1582,8 +1582,10 @@ mpt3sas_base_pause_mq_polling(struct MPT3SAS_ADAPTER *ioc) * wait for current poll to complete. */ for (qid = 0; qid < iopoll_q_count; qid++) { - while (atomic_read(&ioc->io_uring_poll_queues[qid].busy)) + while (atomic_read(&ioc->io_uring_poll_queues[qid].busy)) { + cpu_relax(); udelay(500); + } } }