Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2362524rdg; Mon, 16 Oct 2023 01:49:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEF4k0VRQaTbP3d0dPIgwPhDyCYXu/uX0Ync3TA/G/e7aHWjO4rau06LynzOF6Hw6BoLB4W X-Received: by 2002:a17:903:41d2:b0:1ca:86a9:cace with SMTP id u18-20020a17090341d200b001ca86a9cacemr968522ple.2.1697446175831; Mon, 16 Oct 2023 01:49:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697446175; cv=none; d=google.com; s=arc-20160816; b=xgUlpY25EqdG3UEyHSg/LyQk78Ex3ooiJdeNgQyTf9QEDAxQKHWFsrt6r+NygP+7CK QV7RVfA9dohWssxBleH+gN59J0gJTkJmdErtzHLzzcBAguvYqqshH7tFgt3rHU02F7t8 7qIRTy8MbcG8bEmYS2r0cj6AopATTGD0wdEFRUXzfDZzpudrWXARd3C7ML3Sy8AXE8GC 6CDdY99918fda+gymefWjVBugcIgWkazWl6dqWSOOu/d6W3HzXTAk3JK/o0fz0StX6Y+ XZQHqGau5SVE/jG1u8h6yM8PNlZoDp23zAaNVOWwDK8vr46XiVn3b+7x/Wgq3x20X4la OKbw== 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=sifPsxCDn4LKFjq3zQSutNGMmtzyW892LXiRq2gikAk=; fh=l6vPNEpZQf9G1K6cuSEh6J6bG1Zik4fjj9qLc3E5xIQ=; b=YJLq9g8O+c7Suts2sxzew0QK51R9MeqFS1xWUyJ86B9bcgdC30/UtNNoeFnZtjkaDU aZxXpDUM06eHMoGuQv5S34PK4Nv8OBSEKjb69b9UovfGcDJsMTHtZ67Rtv5Emay3rr5s GKtayVE+HlSXZUZ30UppMIob/wJ2pi9OUVqvkEkIoJ2+ozaKHXMR4OndhOFMn692j9RK aW8QmjvjQHeUxqRsw/R86yxW76KfXfkesaBp5pFiKaSoMFfXpSUnKd72Xou8mz1z2hyR ps9DB0DYhgb0c1o2YB7YzQSJEZHxPWJBS6a6JsYHYSkeDTxhd2NA7veod1CY86nwOiA+ fWOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ormlZ5sE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id l18-20020a170902eb1200b001c9c8c4c6d0si9835991plb.26.2023.10.16.01.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 01:49:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ormlZ5sE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 74EAA8055574; Mon, 16 Oct 2023 01:49:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232785AbjJPIt0 (ORCPT + 99 others); Mon, 16 Oct 2023 04:49:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232912AbjJPItX (ORCPT ); Mon, 16 Oct 2023 04:49:23 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E9A2DE; Mon, 16 Oct 2023 01:49:21 -0700 (PDT) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39G7p7GH020067; Mon, 16 Oct 2023 08:49:15 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=sifPsxCDn4LKFjq3zQSutNGMmtzyW892LXiRq2gikAk=; b=ormlZ5sE1TuPDGINSyatOVS1KPTFMyKy3ZR2VUbwU8Rwy4IsYJQfblPedjKIWNujpHId xkBszs/ZP3Me7jev2ZODBNqLjwzNjOkTy76komnN8g0CD7EZegjYbO3xPSFzObElaQ+R IMmJH/9M0DrsC89minDyw4r4t1iq8JTICt3YZsKyQHuvm6x8TtQPX1g1oG56BToXs21B 0lZI1eXIijVk5v+qTsdlsQJCVtgQBW2GuTVR577mYvv4dMONn1V7J4Ey4ClLKDc5j4Pc FV4tGIYSRV8bEB4JZVkwTla2w0U9apQNx38S1FF2u39fqmR3xDQUM+feungwaZTJv3pG 8Q== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tqj0hkhae-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Oct 2023 08:49:14 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 39G8nDAs029099 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Oct 2023 08:49:13 GMT Received: from [10.253.8.47] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Mon, 16 Oct 2023 01:49:11 -0700 Message-ID: <10f05b5a-8046-4884-b375-007a14248e00@quicinc.com> Date: Mon, 16 Oct 2023 16:49:08 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/2] bus: mhi: host: Take irqsave lock after TRE is generated Content-Language: en-US To: Jeffrey Hugo , CC: , , , , , Hemant Kumar , "Lazarus Motha" References: <1694594861-12691-1-git-send-email-quic_qianyu@quicinc.com> <1694594861-12691-3-git-send-email-quic_qianyu@quicinc.com> <6b396b1a-58a7-bf7c-f644-f1bf298a31e0@quicinc.com> From: Qiang Yu In-Reply-To: <6b396b1a-58a7-bf7c-f644-f1bf298a31e0@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: jHtNlzqMbUmjkR8VBhuqH0hLk0LNKICW X-Proofpoint-GUID: jHtNlzqMbUmjkR8VBhuqH0hLk0LNKICW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-16_02,2023-10-12_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 mlxlogscore=766 phishscore=0 suspectscore=0 impostorscore=0 spamscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310160076 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 16 Oct 2023 01:49:33 -0700 (PDT) On 9/29/2023 11:25 PM, Jeffrey Hugo wrote: > On 9/24/2023 10:08 PM, Qiang Yu wrote: >> >> On 9/22/2023 10:50 PM, Jeffrey Hugo wrote: >>> On 9/13/2023 2:47 AM, Qiang Yu wrote: >>>> From: Hemant Kumar >>>> >>>> Take irqsave lock after TRE is generated to avoid deadlock due to core >>>> getting interrupts enabled as local_bh_enable must not be called with >>>> irqs disabled based on upstream patch. >>> >>> Where is local_bh_enable() being called?  What patch?  What is >>> upstream of the codebase you submitted this to?  Why is it safe to >>> call mhi_gen_tre() without the lock? >> >> This patch is to fix the issue included by  "[PATCH v2 1/2] bus: mhi: >> host: Add spinlock to protect WP access when queueing TREs". In that >> patch, we add write_lock_bh/write_unlock_bh in mhi_gen_tre(). >> >> However, before mhi_gen_tre() is invoked, mhi_cntrl->pm_lock is >> getted, line 1125, and it is a spin lock. So it becomes we want to >> get and release bh lock after spin lock. __local_bh_enable_ip is >> called as part of write_unlock_bh >> >> and local_bh_enable. When CONFIG_TRACE_IRQFLAGS is enabled, irq will >> be enabled once __local_bh_enable_ip is called. The commit message is >> not clear and confusing, will change it in [patch v3]. >> > > In addition to clarifying the commit message, I recommend looking at > adding this to the other patch.  It seems very odd to review a series > where one patch introduces a known issue, and a following patch > corrects that issue.  It would be better to not introduce the issue in > the first place. OK, will squash two patches into one patch after we achieve an agreement.