Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6871036rdb; Fri, 15 Dec 2023 10:24:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFktWO6yVAYdVaBbqP6aL2W83/Un1e6jVtTl8Ashwa1tbXsxkCnbw8ZnkF5lWTpoQEI0oYh X-Received: by 2002:a05:620a:1258:b0:77f:5e41:d17d with SMTP id a24-20020a05620a125800b0077f5e41d17dmr12045244qkl.123.1702664668889; Fri, 15 Dec 2023 10:24:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702664668; cv=none; d=google.com; s=arc-20160816; b=dt2isa9+4yGjJY9EbHOdocTw73Uo93hByLsD7k4B3pZpz2e5RaubHG5EUmWxtrWy0Q lM8aEP2Uu9NO/u0cj+Yh8JoE4+VHPIzN3jFpbvmyU3dpPpJotn4mfdFTaHsAS+pcjr9c b/EJmNj9F4RgCG7JPmfhqA5pZ5sR/RkJxfLhKbiV8cdWWT5DGkc9Ef/kD0isMTeiWtsm QU5ayNT9uJ9VD7qE+TVPoC01SXsO0c59N/9o4NMJEuJAtQ1pT7HxNmon2SHFqvT8YmRk KMBdAOpsYLrD76Cky9TKFjS+SthT0jwFGocT2zQ0YCOqz4gd1j+LQ+8foT9Q124o19SV lXgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=dVW3SnfMl0mCJfi3oJkoPR9xq6Yf+K2lsGRlI93QcLg=; fh=VJo7JojLqW9JUweJYwWRTzlqyKUT2twsC7/FjF7eZK8=; b=SJHo1/oRhuMau92XvhORU8hNHWlOo+RuHHMO5XZcgQxnNrD9TkwODABdD+MEqSaMNO QnfdUQ5vlEQzK8lMKtgsHIShBZ25XgCZg7JmneNR1VIi9p06ClR1HkT9cX3wyXQB6RZL tqBkLYH3vv7ZY7rizCuhzUVwlTnp3yi5GDeh9Zm8klIdl1UFjFqIzOYdYylLYZSd/dDa d2LMjNK5R+IautFz2YT/Mczk5Hs8xnhezK1h+kljDxYxpgwmc+y3VclA5omM4N1A86Wr yPfHeme5zaQNX1D3QsgvXqMl87jRM92w7xPmLYNlSkobgNzJg19jZMLQMXqOOCuhSvYa Ad9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Tt8mXvCE; spf=pass (google.com: domain of linux-kernel+bounces-1522-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1522-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t21-20020a05620a451500b007740f66ad68si18435700qkp.314.2023.12.15.10.24.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 10:24:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1522-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Tt8mXvCE; spf=pass (google.com: domain of linux-kernel+bounces-1522-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1522-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8C6E21C23E43 for ; Fri, 15 Dec 2023 18:24:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00C683DBB2; Fri, 15 Dec 2023 18:24:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Tt8mXvCE" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7DBD3FB0B; Fri, 15 Dec 2023 18:24:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BFICaEs019649; Fri, 15 Dec 2023 18:23:45 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=dVW3SnfMl0mCJfi3oJkoPR9xq6Yf+K2lsGRlI93QcLg=; b=Tt 8mXvCEfCTwjl3pgVPOVK/+OT7XOu2YOQBzPdIuUe3MZ5licAb0gxu0IMBnb4yV85 jzKXXprHfUNKtz0RMAEdIO0JkC4wE02Uq68Nzmj+XEMf5SXIB5hdhX9hJTamEbTe 4DHXqMsHIyXub4Ts9S0zAEB4lkUcxolkhdo9qYy3786nqxmbGZ6rbyGDbA813C4+ x3mLTaYbEw2fBWc6GURTQcmjJpUNcsay/c8sag4VKjpEgHklZAptPSJFEIXNjF6X Ubb6aAgbkMFpUku2GYwd4FyJQO6pLo1H6UDzcD+QaozPjgguh1tVz0UIBy45sWmW UYKhzYqbN8Tv8jQGKWMA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v0p100xfu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 18:23:45 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BFINhRd026163 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 18:23:44 GMT Received: from [10.226.59.182] (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.40; Fri, 15 Dec 2023 10:23:43 -0800 Message-ID: <8aee3661-f04d-f9db-3513-2cd14b6fa67b@quicinc.com> Date: Fri, 15 Dec 2023 11:23:42 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH v5 1/2] bus: mhi: host: Add spinlock to protect WP access when queueing TREs Content-Language: en-US To: Qiang Yu , CC: , , , , , Bhaumik Bhatt , References: <1702276972-41296-1-git-send-email-quic_qianyu@quicinc.com> <1702276972-41296-2-git-send-email-quic_qianyu@quicinc.com> From: Jeffrey Hugo In-Reply-To: <1702276972-41296-2-git-send-email-quic_qianyu@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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: vIFhtdXyPc9OFpGAyf7fJHgL8XeBr0fA X-Proofpoint-ORIG-GUID: vIFhtdXyPc9OFpGAyf7fJHgL8XeBr0fA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 spamscore=0 bulkscore=0 mlxlogscore=715 lowpriorityscore=0 priorityscore=1501 phishscore=0 malwarescore=0 impostorscore=0 clxscore=1011 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312150129 On 12/10/2023 11:42 PM, Qiang Yu wrote: > From: Bhaumik Bhatt > > Protect WP accesses such that multiple threads queueing buffers for > incoming data do not race. > > Meanwhile, if CONFIG_TRACE_IRQFLAGS is enabled, irq will be enabled once > __local_bh_enable_ip is called as part of write_unlock_bh. Hence, let's > take irqsave lock after TRE is generated to avoid running write_unlock_bh > when irqsave lock is held. > > Cc: > Fixes: 189ff97cca53 ("bus: mhi: core: Add support for data transfer") > Signed-off-by: Bhaumik Bhatt > Signed-off-by: Qiang Yu Seems to work fine for AIC100 Reviewed-by: Jeffrey Hugo Tested-by: Jeffrey Hugo