From patchwork Mon Jun 21 16:16:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 464525 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp2738421jao; Mon, 21 Jun 2021 09:17:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUYEkF9ftinQLfP3hjMHupyNcu7dioDtChyeEusqWko8Qt5ruY5HjRr+4ewimuZ35ZdBwO X-Received: by 2002:a05:6402:50cc:: with SMTP id h12mr22117143edb.129.1624292220771; Mon, 21 Jun 2021 09:17:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624292220; cv=none; d=google.com; s=arc-20160816; b=ptNC4By0rrdhVBL/1y5698Bd1e/SPOG0OV3G882yCdxS6PJ41UAV3YoAWPN0MqxUNe O2JFGCFUhEFnL4EO/AfoVcjBYMkWpGPkVMZr8V6X0Z31YPK73n00F4x9vgx/lI1T3KFi KMe3B6INhzKcs8Aon/Mclp0i/hqsLJqzUdkBrRv7tZ0DL6NOWxlB2l+5Pi4VLPaDAXAS jxLxeCNnRDHjtfaxWai6xxiYOjwArjT6AyJe/n0HMddioYDIoWsi3lauieZSsIYjKvVW oSixrCeu3Xht8YfobmBUpBpqGnutc9Ov1s2BpVlIbZqBHqI88owNFzJHVBkPgtH0SnCI Gbig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0Uhb6Dl104+SVeWfUYIDljsfUA96kt40BSvW1m9j8Pw=; b=GEsQNv/5MpOHDNsNU2NgKkue13vRdZduOUba0eSteoS+oQqATjIFY0HiAh3jtrzw5d Vp6TXWGKksq2IrD0egiuiGWIgicrxYIRvJYbtE2wEl7xmd9DajG9BnYLhHzA1RFeVtNm scLaZRtjzbqIrwwD8wlsTpgd5510swxudAlvUrYDV5T3hXYPwbz0nSgdOEmD+/ErQW5T Q4CxCMR5ybrSpYU3xhhchSSjYw+WO3fYEKgLUx+TbKGc4a7oQSHrsBh1+RW5D50jqsQb qFX15HaO0kCn2iqNeUJ9wdiYR9MWvbROsrfMUIjmZ7dUu6GXCJahW2TFSf/8tvXu7bWn mZVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=piGZuAP1; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m13si18028443edr.209.2021.06.21.09.17.00; Mon, 21 Jun 2021 09:17:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=piGZuAP1; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230411AbhFUQTK (ORCPT + 17 others); Mon, 21 Jun 2021 12:19:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230415AbhFUQTJ (ORCPT ); Mon, 21 Jun 2021 12:19:09 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 075F6C061756 for ; Mon, 21 Jun 2021 09:16:54 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id u2so126213plf.3 for ; Mon, 21 Jun 2021 09:16:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0Uhb6Dl104+SVeWfUYIDljsfUA96kt40BSvW1m9j8Pw=; b=piGZuAP13MpYkgXbR6nandmXTXTWQbPNRx6IGwKYsJgLYfWPGM7X+s3qV/Dje6VUaf RvB1UulfCMbyLzonrjzITTlASjM4ru3CAs8Uf10leKSHYtK/9LzMd51GmReX9RJZl3gD ScgOW59/W8JRHzCZfjdgFK65qKpy1X2dD0hpoel0v+ohviSavMzJz8Dp1cq5lHPOt5r+ 0Bgn+Bi6hyXSpao9jJKWonjEM3RDVUW56Nq6NnEtV+1v/p6sF2101hizL8zq7NDFC47a xiaSIUm5cgNeJduSrbVITdC8OS7QQmu85aJmLXaoJrDdB9rTjP3aGfHSkRUkr2wzAN79 41jg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=0Uhb6Dl104+SVeWfUYIDljsfUA96kt40BSvW1m9j8Pw=; b=XfryjjbfNYTlcEg4tT2ZG+IIW8a8loMnmzcGHWT9voeCtwKLyqsD1O4N9dBU0pW/Sn bsAwBkB1gxGPs6dOvd8/VUOmC/e9oija5OXU8N3yf0Zfq9x1lFPKGIXiTEN5wQhrGcPr i6To5Ep2po8yPDdHPdFue1DBmMg/BgYjat6F6TNIWLO/Q74aqol7TfQcC5EApvhELZLU ITZFgkIfsLUIPowK209n8fnT8ibBEdYckq4t+A6Urkg4ZdmZFWIO9xS5dpPThgQLimd3 ZKNq8/Yn7rd4Bfj6YFDKuvLDfgyZfa4HAHRpIXkSkxHgd3zERrVKvssK7a2WbeWIYpVn Nz2A== X-Gm-Message-State: AOAM530jPYqmLS3IPDFqYltBtUBG+5M7DvaAzu03xHWETXmw5qoQ/AWC yRwGSj1UBhzF/WoFrTtMgVUU X-Received: by 2002:a17:90a:de16:: with SMTP id m22mr37819350pjv.60.1624292213503; Mon, 21 Jun 2021 09:16:53 -0700 (PDT) Received: from localhost.localdomain ([120.138.13.116]) by smtp.gmail.com with ESMTPSA id k88sm10734730pjk.15.2021.06.21.09.16.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 09:16:52 -0700 (PDT) From: Manivannan Sadhasivam To: gregkh@linuxfoundation.org Cc: hemantk@codeaurora.org, bbhatt@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, loic.poulain@linaro.org, Manivannan Sadhasivam Subject: [PATCH 6/8] bus: mhi: core: Add support for processing priority of event ring Date: Mon, 21 Jun 2021 21:46:14 +0530 Message-Id: <20210621161616.77524-7-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210621161616.77524-1-manivannan.sadhasivam@linaro.org> References: <20210621161616.77524-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Hemant Kumar Event ring priorities are currently set to 1 and are unused. Default processing priority for event rings is set to regular tasklet. Controllers can choose to use high priority tasklet scheduling for certain event rings critical for processing such as ones transporting control information if they wish to avoid system scheduling delays for those packets. In order to support these use cases, allow controllers to set event ring priority to high. Signed-off-by: Hemant Kumar Signed-off-by: Bhaumik Bhatt Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/1624053903-24653-2-git-send-email-bbhatt@codeaurora.org Signed-off-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/init.c | 3 +-- drivers/bus/mhi/core/main.c | 9 +++++++-- include/linux/mhi.h | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) -- 2.25.1 diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index c81b377fca8f..444676034bf0 100644 --- a/drivers/bus/mhi/core/init.c +++ b/drivers/bus/mhi/core/init.c @@ -673,8 +673,7 @@ static int parse_ev_cfg(struct mhi_controller *mhi_cntrl, &mhi_cntrl->mhi_chan[mhi_event->chan]; } - /* Priority is fixed to 1 for now */ - mhi_event->priority = 1; + mhi_event->priority = event_cfg->priority; mhi_event->db_cfg.brstmode = event_cfg->mode; if (MHI_INVALID_BRSTMODE(mhi_event->db_cfg.brstmode)) diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c index 8ac73f9e92a6..3775c77dec63 100644 --- a/drivers/bus/mhi/core/main.c +++ b/drivers/bus/mhi/core/main.c @@ -454,10 +454,15 @@ irqreturn_t mhi_irq_handler(int irq_number, void *dev) if (mhi_dev) mhi_notify(mhi_dev, MHI_CB_PENDING_DATA); - } else { - tasklet_schedule(&mhi_event->task); + + return IRQ_HANDLED; } + if (!mhi_event->priority) + tasklet_hi_schedule(&mhi_event->task); + else + tasklet_schedule(&mhi_event->task); + return IRQ_HANDLED; } diff --git a/include/linux/mhi.h b/include/linux/mhi.h index 86cea5256e3c..bf23c213429c 100644 --- a/include/linux/mhi.h +++ b/include/linux/mhi.h @@ -250,7 +250,7 @@ struct mhi_channel_config { * @irq_moderation_ms: Delay irq for additional events to be aggregated * @irq: IRQ associated with this ring * @channel: Dedicated channel number. U32_MAX indicates a non-dedicated ring - * @priority: Priority of this ring. Use 1 for now + * @priority: Processing priority of this ring. 0 is high and 1 is regular * @mode: Doorbell mode * @data_type: Type of data this ring will process * @hardware_event: This ring is associated with hardware channels