Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1631364rwb; Mon, 7 Nov 2022 04:06:14 -0800 (PST) X-Google-Smtp-Source: AMsMyM5fLXIePHUWSpBJsOq8+NcXffvY7BxTC8n8yW/H+yI747yL2YIL/e+p8tatjQ2VUQXa27l8 X-Received: by 2002:a17:907:3fa7:b0:7ad:e0cf:417d with SMTP id hr39-20020a1709073fa700b007ade0cf417dmr35033869ejc.577.1667822774295; Mon, 07 Nov 2022 04:06:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667822774; cv=none; d=google.com; s=arc-20160816; b=WTgW0l1LlJR7Szr2co275Cpilw+OqMfEYw8EUN21bUt6cOn3a70kyugCxjPi4ovPu4 Y1FziCRGLgHy9m0QUS88wHFNml5cBHCsl6SeEhEA2ND6RmlIfyCkU5deSt0oYotNHKWA eiuqsXvkS99ZUtVGYALr/nhxjbdiERBmE8iQrvbGEwDfNxko2RBvIpakPOhawjAJQmyt 3s0mkf4CSjlfXsu8+NSmJ1FsSMIdDY9rSpaEhjGf1Zo5/SyHX4JOSYHtca3WVoi1+Wz8 n/s9n/G8MNHMAr7WUwHK2aifNaNmHzJIrYhy46mHeI9u0jvDhjGuTUiPHv2EYiC8OMFR /iHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9MId61SAl5WPCjTgNJrtMDGT689TkvHd72UaaI8c8cU=; b=DJySm/0SaXEDDSLud5rhTmdJwoNQat1lLsy/OeDsNnZh3vgw0pd2AGtX3XKnYmsZUk Q48JdBNnv8xY5xH3eWuTnGt4SxVaV/sQgDaZEOAArfZizCxsStq2P1ELtzU3RMwvvzDP yngkgrbxYSS6tDYh3J+IDMiLCvsoyn/YeE99R4UXbqVvMhA+UrnlUYk2ZjfKI4aopgcd juGaEX0o+yg1Ej/wLI+ExKFt8AnNykrga+XgbbNtj82+RTi3rZie95dx2S2Z1WZ/nrPy OLcKwN01FcGebb4DftvlQ+CMvMXynAGvyUoIkDYOSfirUbaboiO9OkJFGVW2IUNoouMS GCPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WVIz9iZw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f20-20020a056402195400b00461c9edc3a5si9056710edz.77.2022.11.07.04.05.50; Mon, 07 Nov 2022 04:06:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WVIz9iZw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231411AbiKGLXB (ORCPT + 93 others); Mon, 7 Nov 2022 06:23:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231494AbiKGLW4 (ORCPT ); Mon, 7 Nov 2022 06:22:56 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63322183B9; Mon, 7 Nov 2022 03:22:56 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DD4A460FD8; Mon, 7 Nov 2022 11:22:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BBA1C433C1; Mon, 7 Nov 2022 11:22:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667820175; bh=yUKZRtowNMMbVtTq5rXqMDPbXb2eaKZkJ8OtKwKaqY4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WVIz9iZwbx1D1kS7/XKaNX8EVf5/TIRnYJDlbh8dWbof4KT5/xb79iMi9dMWCu0kE q/kfoU6uOSe/7IaF077huJ47i0IIwTqYp82F/jeTlJ7C5W0O6ejGpEsFvRhHXsNkfw Caff0Ts5H3gJOtklaH2yB9YTlPD7b3CS14mhuw4/3EDTm/vaZaSUrAtPJWVbdUOmYL Ba457wQCA96L7z9UFe6f496PJErZ0A/L+tdZmeTbSjl5clmXEZdLOxTvMMuUom8B9i HDtqXGZ2wDPi4r5Mju2oyZCVBfQ4SqNaGPAvXRRKaEqEqMM9DiaQjmChS1B0Ux/zKJ i2iojShGSt9mg== Date: Mon, 7 Nov 2022 16:52:43 +0530 From: Manivannan Sadhasivam To: Qiang Yu Cc: mani@kernel.org, loic.poulain@linaro.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, quic_cang@quicinc.com, mrana@quicinc.com Subject: Re: [PATCH] bus: mhi: host: Disable preemption while processing data events Message-ID: <20221107112243.GA2220@thinkpad> References: <1667462111-55496-1-git-send-email-quic_qianyu@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1667462111-55496-1-git-send-email-quic_qianyu@quicinc.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 03, 2022 at 03:55:11PM +0800, Qiang Yu wrote: > If data processing of an event is scheduled out because core > is busy handling multiple irqs, this can starves the processing s/starves/starve > of MHI M0 state change event on another core. Fix this issue by > disabling irq on the core processing data events. > > Signed-off-by: Qiang Yu > --- > drivers/bus/mhi/host/main.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/bus/mhi/host/main.c b/drivers/bus/mhi/host/main.c > index f3aef77a..b58698d 100644 > --- a/drivers/bus/mhi/host/main.c > +++ b/drivers/bus/mhi/host/main.c > @@ -1027,13 +1027,14 @@ int mhi_process_data_event_ring(struct mhi_controller *mhi_cntrl, > > void mhi_ev_task(unsigned long data) > { > + unsigned long flags; > struct mhi_event *mhi_event = (struct mhi_event *)data; > struct mhi_controller *mhi_cntrl = mhi_event->mhi_cntrl; > > /* process all pending events */ > - spin_lock_bh(&mhi_event->lock); > + spin_lock_irqsave(&mhi_event->lock, flags); Please add a comment stating why we are disabling local IRQs here. This will help in understanding the code better. Thanks, Mani > mhi_event->process_event(mhi_cntrl, mhi_event, U32_MAX); > - spin_unlock_bh(&mhi_event->lock); > + spin_unlock_irqrestore(&mhi_event->lock, flags); > } > > void mhi_ctrl_ev_task(unsigned long data) > -- > 2.7.4 > > -- மணிவண்ணன் சதாசிவம்