Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8035211rwr; Wed, 10 May 2023 16:59:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6zidPSraKnymYdI0uPJBzJbvJaaqf3aPsbi6YB3TFaEghiAAxrAwK5GbEJQMlHS3oNENoT X-Received: by 2002:a17:902:ec88:b0:1aa:fbaa:ee09 with SMTP id x8-20020a170902ec8800b001aafbaaee09mr26757153plg.49.1683763199644; Wed, 10 May 2023 16:59:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683763199; cv=none; d=google.com; s=arc-20160816; b=QnTNsa3sThu3yWpHpUwwmVuBQtVHlhQQccv6vN+6bguLZRDSgBk/SvTxzo/+WmW3ad F77kkqeYMvqpjx3rCI6cTgrfopFmku99DykgnETaLns0GmN9lAPmTFh1hR14470eOuxq 7ge6rPXFi9kjBA34W+2OimL2PyDP5FA7astXSn+mfb8H2JXicPVDIP6fmKjkXIlvScmn 7D51b/l5cnrNbc4+Q0A+/A30YWUkBg48meHO5lsxO4ZpFirxllkqWU2m7WeyPCPXHM2r 4F7fhcYkUxTfmDDbVgRUko+4gLg6yn3nQ8OEDfFLJTCs8/ak7HQDejnyZu5zLPX1rQU8 /1RQ== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=xXC3x0ghD/GK5dky7enjJf95Js0sCp6TmUasomsHc+g=; b=P0whKPbJb1UGrUTofLbD+c1LIGeKJ0FGP0uGlP7vJ3J1GV9bXPI/6EiOAUsuh7mXpY b2CPCmKoGKtYzUZLwwjmJz7gBIusMbKljMnYzS1XTZuJV3CQq7LCwtbeeEMfAb7tEcsh asbWvJBvimy9zEAUfxVm0yjA6B280u7Vi6ycFbcNb4J3w8uIPS+5N/eSrXac6fr+LTOU rr+tDxTzCviNnjCg3seMnFrhku4ZGiQoKhUnqW3fUX6IHLinsz6iCQcDsX2yXURi9T3a FNC4bq5Gp2Pa7wMnLTfZfM3aK5N2Kd+dTO5udBf/p8RMsq0lnotS7xC043Xgi7bahccB DhTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=eXhLELdG; 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 u69-20020a638548000000b0050beec2c6cdsi5405071pgd.238.2023.05.10.16.59.45; Wed, 10 May 2023 16:59:59 -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=eXhLELdG; 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 S236373AbjEJXUC (ORCPT + 99 others); Wed, 10 May 2023 19:20:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231468AbjEJXUB (ORCPT ); Wed, 10 May 2023 19:20:01 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7006135A7; Wed, 10 May 2023 16:20:00 -0700 (PDT) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34ANDB71006548; Wed, 10 May 2023 23:19:49 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=xXC3x0ghD/GK5dky7enjJf95Js0sCp6TmUasomsHc+g=; b=eXhLELdGkjh7S3sf6R3VLh5RGwngulFXlzXxuC2xQ75Qxz9cWpRWTbFDB0LSBAp5iy+j 47MYrCGsGZs/Ba2eQK7xZ6v+kMdL3EE26vE3B+kqHLsIIn3NQDRhO/OPI6fiJmLIrT9X p6GAGjGPHGwhy/OUL245ds8aKsyraIb5jsDVKZpur7pkxLdldMitjWpbCqR3O0ZHrAoV O821TMBae/JuWhGHNj8Iygd4Zy3+d6+Gaz4140dwzmzNyFFcNoxsUF9zGlJtgj21QgCR xv49LWdB/ehFklVhe+ySiiKYd4dbNa82za8Cbi1VVQ5963Ls7Rd9SNNTaQ286vmefu3H Dw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qgj14093q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 May 2023 23:19:49 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 34ANJmJe013930 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 May 2023 23:19:48 GMT Received: from [10.71.110.189] (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.986.42; Wed, 10 May 2023 16:19:48 -0700 Message-ID: <6721cc2c-6988-948c-65d6-f50edb925ded@quicinc.com> Date: Wed, 10 May 2023 16:19:29 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v1 2/2] drm/msm/dp: add mutex to protect internal_hpd against race condition between different threads To: Abhinav Kumar , Stephen Boyd , , , , , , , , , , CC: , , , , , References: <1683750665-8764-1-git-send-email-quic_khsieh@quicinc.com> <1683750665-8764-3-git-send-email-quic_khsieh@quicinc.com> <74ae5514-2b04-9363-902e-cb4d7cbe1128@quicinc.com> Content-Language: en-US From: Kuogee Hsieh In-Reply-To: <74ae5514-2b04-9363-902e-cb4d7cbe1128@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit 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-GUID: sw_gn0kObOohdSe9sK1qDz9q7NyshaKK X-Proofpoint-ORIG-GUID: sw_gn0kObOohdSe9sK1qDz9q7NyshaKK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-10_04,2023-05-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 suspectscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 mlxlogscore=604 clxscore=1015 impostorscore=0 priorityscore=1501 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305100192 X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 internal_hpd is referenced at both plug and unplug handle. The majority purpose of  mutext is try to serialize internal_hpd between dp_bridge_hpd_disable() and either plug or unplug handle. On 5/10/2023 4:11 PM, Abhinav Kumar wrote: > > > On 5/10/2023 3:46 PM, Stephen Boyd wrote: >> Quoting Kuogee Hsieh (2023-05-10 13:31:05) >>> Intrenal_hpd is referenced by event thread but set by drm bridge >>> callback >>> context. Add mutex to protect internal_hpd to avoid conflicts between >>> threads. >>> >>> Signed-off-by: Kuogee Hsieh >>> --- >> >> This patch looks completely unnecessary. How can dp_bridge_hpd_enable() >> be called at the same time that dp_bridge_hpd_disable() is called or >> dp_bridge_hpd_notify() is called? Isn't there locking or ordering at a >> higher layer? > > Ack. We can drop this patch because we are protected by > bridge->hpd_mutex in drm_bridge_hpd_enable() / drm_bridge_hpd_disable > () and drm_bridge_hpd_notify().