Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1401175rwb; Fri, 28 Jul 2023 08:55:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlGNJ18W66EgeeNh6Yj5b+0a2hvM4XUmViWKQooAqV88vt5nm+ggYUsvwYpu9DqE/YKMFaek X-Received: by 2002:a05:6a20:1047:b0:138:2fb8:6aab with SMTP id gt7-20020a056a20104700b001382fb86aabmr1775444pzc.8.1690559749340; Fri, 28 Jul 2023 08:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690559749; cv=none; d=google.com; s=arc-20160816; b=kH2ugdwwAF/MVrNUUvRANni2gORydsoKeQGp95Pg+zinc+7bw7Px9oE44ZK1dQAeW1 ICCBF/ZJ3b0XNSCF9kdrFlLvVYvPI7qwIlJIWH9dB7wmlv48O/V1KSqAPmBZDfmwfriA GOEa7zo75SOdls/eQ/OiJURl5uxfeud15r1jM1VApTfCqt/wNf78Z5UUrgiB72HJYrBj b20DbUV55GQnH43ciOYFHbIQG4W+Rz77/M3S3MmQFFRrou6Q1VmoieVvPgvWutuEtUOB vWOlPJTHrwqbXjXJ6jX8oGuX+H4NoVljFzpH6/KLj9Ek8N7bIaWwscN31RyKTjJlh6Aa jBCA== 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=bUBmBxvu89wvMpi3zXZKnJsxmP2cM4hwo+HWKuK8Rfg=; fh=TT+aQ56RZL/kt9ia2A9g1040XCzUN5LsJPJoI9LxeU4=; b=hzsvmumAarsmKxjX0zdFUl7fBrqnWQdT36OARFrwVPiUKOH0AxwZiHqrA8UXehQA+B xZFiTD5YdL00NUbaoRf3qXObXR2kyqkcY5c6ZKjn0HN3mROmxl+lDr0EBo+nL9HIXwue G8qlZZXNoWfbVOCuREO2Aip8Ajqo091087GDi7FQgqBUyvIVjkWkKng1hTyPppOs/kj0 FzOnUEXqc7iG7kSRcyKLjTGrjd4JHRUckRgVrw72bR6MVaooNruxPFcT/X2uQZS68GFw 3XAl7oGh0kyecmKt83Gdw0BqXQkzq2GOajj+Yj+x/9K2XUVidOjNfFk9jl4EWatpxwGm S6Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VDY5OHK1; 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 l27-20020a63ba5b000000b00563e6387a54si340849pgu.258.2023.07.28.08.55.36; Fri, 28 Jul 2023 08:55:49 -0700 (PDT) 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=VDY5OHK1; 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 S236247AbjG1PgI (ORCPT + 99 others); Fri, 28 Jul 2023 11:36:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234637AbjG1PgG (ORCPT ); Fri, 28 Jul 2023 11:36:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDB14E4F; Fri, 28 Jul 2023 08:36:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8BF9662186; Fri, 28 Jul 2023 15:36:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41073C433C9; Fri, 28 Jul 2023 15:35:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690558564; bh=xlL7irx0XxMoQMLW110FKoqtUNnBYfDX+E4nKgTrbXw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VDY5OHK11AK6LgmgN7sPy1mHZvlmAHzAjbW7Pa7D8L9PUYcS/o2w3G0y3Mz4mgHRU TSGCcO4q6Uey1bT+c4kMGqX7PwRXP4soV8t+ExeNX6+C7TJYLuUKBPgpal8NZYj2Or XpZEy1wi65+UTRseDbg0ArfTYsWoEcCkLjD5jWPdw/TEaYGVNUIb57syFQtdcDQB8Y 5YWK75osKM3Gr6QwX/PVnuaTvet/pYCTwmdG/jUGN5SP2cqhX/YtDooWLh/A3GgMXl Hb6sGLt//+pzI2psyNDg7SHuwLz2PLDKu3FsBhDt6AN2uALzUSsJDcvY05IiiWbDq8 7UhTO2bvBTTPA== Date: Fri, 28 Jul 2023 21:05:55 +0530 From: Manivannan Sadhasivam To: Dan Carpenter Cc: Krishna chaitanya chundru , manivannan.sadhasivam@linaro.org, helgaas@kernel.org, linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, quic_vbadigan@quicinc.com, quic_nitegupt@quicinc.com, quic_skananth@quicinc.com, quic_ramkri@quicinc.com, krzysztof.kozlowski@linaro.org, Jeffrey Hugo , Greg Kroah-Hartman , Dan Carpenter , "Rafael J. Wysocki" , "open list:MHI BUS" Subject: Re: [PATCH v4 9/9] bus: mhi: ep: wake up host if the MHI state is in M3 Message-ID: <20230728153555.GA9129@thinkpad> References: <1689232218-28265-1-git-send-email-quic_krichai@quicinc.com> <1689232218-28265-10-git-send-email-quic_krichai@quicinc.com> <20230728043452.GI4433@thinkpad> <15a19a2d-d6e8-4fbc-a31d-561cff00b01a@kadam.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <15a19a2d-d6e8-4fbc-a31d-561cff00b01a@kadam.mountain> 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,T_SCC_BODY_TEXT_LINE 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 Fri, Jul 28, 2023 at 08:50:55AM +0300, Dan Carpenter wrote: > On Fri, Jul 28, 2023 at 10:04:52AM +0530, Manivannan Sadhasivam wrote: > > > @@ -464,6 +484,13 @@ int mhi_ep_queue_skb(struct mhi_ep_device *mhi_dev, struct sk_buff *skb) > > > buf_left = skb->len; > > > ring = &mhi_cntrl->mhi_chan[mhi_chan->chan].ring; > > > > > > + if (mhi_cntrl->mhi_state == MHI_STATE_M3) { > > > + if (mhi_ep_wake_host(mhi_cntrl)) { > > > > Don't you need lock here in the case of multiple queue requests? > > > > - Mani > > > > > + dev_err(dev, "Failed to wakeup host\n"); > > > + return -ENODEV; > > > + } > > > + } > > > + > > > mutex_lock(&mhi_chan->lock); > ^^^^^^^^^^^^^^^^^^^^^^^^^^ > This lock isn't enough? > The position of this lock won't prevent cocurrent access to mhi_ep_wake_host(). - Mani > regards, > dan carpenter -- மணிவண்ணன் சதாசிவம்