Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2017744pxj; Sat, 19 Jun 2021 00:11:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxO39QBimxGWcIsNPruqKH4V+tW1MBPGbh7eszvzIlT1qHB9+W+usx16EbIsIA9n2R90OeI X-Received: by 2002:a17:906:b0c4:: with SMTP id bk4mr14744149ejb.422.1624086719134; Sat, 19 Jun 2021 00:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624086719; cv=none; d=google.com; s=arc-20160816; b=T/mOXvAvdGazkOownLq7vyHWrzDM85E35F/+nf+qtwNA8TmlmW5mxXL3MwQDV0KGIn rr+5wXRI8F52Q0ygRtB2/OhOck5Da2q+yHeNKYMK4cqs23LtXNXh4dOZKUVlxZObA5um xooDtl/oECWrsKsvUp3qt6exXphg5VDPSYc0FE1nhbChI2YjbhmrYTl674yFQCepWJqL pHSWo9x5//yoQFgOC1HzU9fw3S/vTwgMkSU4fF/5+/Ol/ZzhGKiZ0QvKiozikUOHkKwm M6ayobluaO0xkEUCSFOnFyA6yEFWwnwU/iTueq82tPkAVAK/ZTXB+DSOwKUwPlTiMX6L hZQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dmarc-filter:sender:dkim-signature; bh=TASDdCAuTLzpjOUv0B88DHj8D0grvdgek7WAhCsp5F0=; b=fJ0qmwTGOYGodgUTAD60ARu+47VAXcdBn2V25aFmOXqwcTnT6NGYIVuu/9aXkcdLLq XNz2Wop0V6Vzsfl07vMuXcT3oFXkYffLpV04t5H+twb3g214XSp0IGHxmvQsYCfGDhKA 05Ocw30PpwK+wC7NMoNs0yWpdRaHIoAY5TkBfz3HMyXPn5u63cQJm1V0p1SIweLSn6OW 94t2uw4+i4bBRcV+PxLzAY5wSshAWgH9bcvzxoRGjEx3rAYk0+rMR+WfzcmI7VeWwgXz 8t2wfRNhLjPc9wY/CXdlYYpzFWMRDcrPddZGP0yHb9J/Sj64GFH+eqz62+8WN3nh4LQR rp9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=s9uD26X3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si1437647edr.77.2021.06.19.00.11.36; Sat, 19 Jun 2021 00:11:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@mg.codeaurora.org header.s=smtp header.b=s9uD26X3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234823AbhFRWH2 (ORCPT + 99 others); Fri, 18 Jun 2021 18:07:28 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:52906 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234821AbhFRWH2 (ORCPT ); Fri, 18 Jun 2021 18:07:28 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1624053918; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=TASDdCAuTLzpjOUv0B88DHj8D0grvdgek7WAhCsp5F0=; b=s9uD26X3GK2nVJNQmjMmqnQ737Q2uVp6HxEs/SamDFws+Zb9eh9ap6B5aIjX9LRyun2izBf4 dFEACJ34x8LMa684LXM/O7UTrJCYiXNuXgvBV93BWDwswMficsKj5D1Cd1zFrc8laP5diLTJ N0766EiiN3EHyTu+o1b0xoNlC1U= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-west-2.postgun.com with SMTP id 60cd189dea2aacd7290e0ed9 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 18 Jun 2021 22:05:17 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id BD216C43460; Fri, 18 Jun 2021 22:05:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from malabar-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: bbhatt) by smtp.codeaurora.org (Postfix) with ESMTPSA id D7899C433F1; Fri, 18 Jun 2021 22:05:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D7899C433F1 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=bbhatt@codeaurora.org From: Bhaumik Bhatt To: manivannan.sadhasivam@linaro.org Cc: linux-arm-msm@vger.kernel.org, hemantk@codeaurora.org, jhugo@codeaurora.org, linux-kernel@vger.kernel.org, loic.poulain@linaro.org, Bhaumik Bhatt Subject: [PATCH v2] bus: mhi: core: Add support for processing priority of event ring Date: Fri, 18 Jun 2021 15:05:03 -0700 Message-Id: <1624053903-24653-2-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1624053903-24653-1-git-send-email-bbhatt@codeaurora.org> References: <1624053903-24653-1-git-send-email-bbhatt@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- 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(-) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index c81b377..4446760 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 8ac73f9..3775c77 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 86cea52..bf23c21 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 -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project