Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4087463rwb; Mon, 31 Jul 2023 00:37:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlGMkysqCVITLEbAIfO/TtDYmtgzHpVJQ12qXghSqH5S6wNCmjbOJOiqE7Ih8gUwKpcj2ZF4 X-Received: by 2002:a17:906:18:b0:994:4e16:d430 with SMTP id 24-20020a170906001800b009944e16d430mr7055197eja.20.1690789057572; Mon, 31 Jul 2023 00:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690789057; cv=none; d=google.com; s=arc-20160816; b=fZf5oHoPaVf6DAu4+QSdMT9+QyTkz6mvGoXPEFfSk8NcbIcnmzTkoQQVjVXldX7KII 4veVlB4m2kYKfsmF8s7UdLZVXmGMdPcwXYUrHhlbG++GKEjX7o8XpnZHmrYyLUFGhj4B E9enzIXxAAoC2SNzS8r7ZyAjFicWDee84E4i29dJIkCNyCCBzDibiv+IwZh9i9vDUTa7 WU4QiW/389w6I4RX3Tywen27gAMszT4ehO9jog064uAUeVm+MPoNDIruaNXblJ4TvKfN Af9yIIDB/TfUxmuychyeR99Xn7RecLHkguILaVoGnlm9gXKklztAes5e+7p5WhXYUOBL /gZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=XnRedSNdLIy2U5CPTQIase5ATOdy3by+d5UvM6ptBJw=; fh=1llaQi4pMbH1pEDQhgC9t+CVQPeyKvE86cOONqzXkyo=; b=ECNX44uI2GY85QI5CyJtd4myMITHuN2o1ZXpsEbOjGms0c960PCxkuy7xqGlSzIOKS egGEU8pcDtGCVTsmY1lnGP57H9otU4ux4388iavouKrNJephN9xBvAT4qXjWf2Wjt/QV w7zTb7qmYngHybVQmJ0wci8zHEg0SOvbfnQSmw5WGQ/xHpLv0umu80NoK/C8dUiucvHI eN1ZJwsFwOvRwZpGUjH87WNWbGVUzRNoIKrgt6LpMddiY+RIYXTkkH4UrUsNljerSKSM GT6z3lC1OWGUKXjIxENYQEVOiW5Szx+bowA0lrcy+WtCnov51wOUAeypZ0Xp4R9T+C7R Ojog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=k3r9uPsH; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id um26-20020a170906cf9a00b0099bd7b2663dsi6609971ejb.142.2023.07.31.00.37.12; Mon, 31 Jul 2023 00:37:37 -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=@quicinc.com header.s=qcppdkim1 header.b=k3r9uPsH; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229970AbjGaFio (ORCPT + 99 others); Mon, 31 Jul 2023 01:38:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbjGaFin (ORCPT ); Mon, 31 Jul 2023 01:38:43 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71F42199B; Sun, 30 Jul 2023 22:38:17 -0700 (PDT) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36V2K9i5008476; Mon, 31 Jul 2023 05:38:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=XnRedSNdLIy2U5CPTQIase5ATOdy3by+d5UvM6ptBJw=; b=k3r9uPsHGn8BF25HLLWjUn3L1SnCTcBYO31HyKX9PkaUKVqf2t0nSrYOe3rWKRE++7Ti WjYHd0lasKrb43mBb/T6txOWl5EWBw3DN4ztyZ+RG5YNoz7DNVMsZIMWWVH2QNNZyhyz h9gem0bJ3YpffC06RWNDcIavJTttvwygRggTKWWyP1c5AlCoRBTyrdeoKKi7JSScoAwH tZkQFNr+IWT0BXVAlHewOcT3vi1ag13P/VxrWl+xkSs//GdzDkR9ZizGn3TDSHuRs3cd OF47rtuNJ+l/d6HGPnd71WW4WC8h0XqbCf8bgS4s5BDASX6wp3gfwJHXPVHSj3BvPG90 nA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3s4ugsaqq2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 Jul 2023 05:38:04 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36V5c3BN004580 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 Jul 2023 05:38:03 GMT Received: from [10.217.219.216] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Sun, 30 Jul 2023 22:37:58 -0700 Message-ID: <1ac2154c-e74c-ebec-90d1-11ddf9b3ba1a@quicinc.com> Date: Mon, 31 Jul 2023 11:07:50 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH v4 9/9] bus: mhi: ep: wake up host if the MHI state is in M3 Content-Language: en-US To: Manivannan Sadhasivam , Dan Carpenter CC: , , , , , , , , , , Jeffrey Hugo , Greg Kroah-Hartman , Dan Carpenter , "Rafael J. Wysocki" , "open list:MHI BUS" 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> <20230728153555.GA9129@thinkpad> From: Krishna Chaitanya Chundru In-Reply-To: <20230728153555.GA9129@thinkpad> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: JfpkhWHcEX-ES-ZAM7CeEE3vRcPdrZXf X-Proofpoint-GUID: JfpkhWHcEX-ES-ZAM7CeEE3vRcPdrZXf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-27_10,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 phishscore=0 mlxlogscore=936 malwarescore=0 clxscore=1015 spamscore=0 priorityscore=1501 mlxscore=0 impostorscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307310050 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 7/28/2023 9:05 PM, Manivannan Sadhasivam wrote: > 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 I will add the lock in the next series. >> regards, >> dan carpenter