Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp829934rdb; Fri, 23 Feb 2024 00:54:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWIIj+9shWDG9lLTdiRFfxEh9TITnCcQeYyT5PQhb2hAie8wnfGM+4+LGOnl27yOBrLdrvxjGKluLCE9i2o18yQJ8eCDpznFmhMZwqm6g== X-Google-Smtp-Source: AGHT+IG2r5mACc4B9r+qPyZO0rvCniux8PHWkLVFeZJ0woyviGibp3O5O01lD3HRspf7zhZoySFL X-Received: by 2002:a05:690c:3384:b0:607:f536:58ac with SMTP id fl4-20020a05690c338400b00607f53658acmr1622476ywb.21.1708678444640; Fri, 23 Feb 2024 00:54:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708678444; cv=pass; d=google.com; s=arc-20160816; b=aIsYPX79Ln0mfRJJc4d/jtsax+aozTTyPjDQcHc2KB98cuhW/oUG2VJNqKi4adjomH S9arAAprFFzlm5HZEGpfwcBVT87SiSRk2NEw6FyZyn1kUMSDXcoj8O7ZP3ryNVYMoaOo lxHDSzlSoT82TQwtINLZx9/eOPjE+M1slCdiGg9Qp3AlTDRJsmiR9bUXN1RehnaYeAva bKguW+BgiFfVpSnOfIdbY939uV4QJFu+nmH9JDMn9xWPOKUBMSxbM7ktHpr7KNCmzTWm 6CUE7EBksgy4OiQk+eo10WDKz5+RjwsKdspjmld8MKROQQpwV9/ykrWuJik0SAKYY9j1 xUbA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=Rj1UnjwW5MY1y+1XNzdWS7I7b/rCvuHtA2QHcA5h7V4=; fh=ZRkUIO8LWyPFLfKSho3ZFvVP4ewdRHwiDEY3cFXu+ZM=; b=My8H1tcHjdyw6clPNNUMZl1t9L5jgzcEp9GDwSoGx4cbDfsmK4JcmjHo4f5VQNiaUE vf2tkfC38bsxFbpM1ppkWSRHUbx/A8qY2TVCfCEmzjlTjFvgfalqRajawoZ0zc7L8JGn VaNysH9W8ZumRmNNt5S0OSvt5WmAmlSDyW9K7Tui6iqKTHZ1KrrdEUcPneuMFKbp94QS 3FGfht2RgyGUVr0QTth0Y+jqAnCufJo8zgfF5uJ+9AYEN8PrgSeLvLkDjqHGoFHbgveG GWojpWFiO58QQxaL9XJmmBjbDbVlP/80GIPwGZtHJlJhEcurUo1A+sZbVm8O7liDB8yG S9Fw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=PifSMHst; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-bluetooth+bounces-2091-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2091-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 w2-20020ac843c2000000b0042e3d122afcsi4465172qtn.614.2024.02.23.00.54.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 00:54:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-2091-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=PifSMHst; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-bluetooth+bounces-2091-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2091-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 3E8FD1C24147 for ; Fri, 23 Feb 2024 08:54:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BEFA0288DB; Fri, 23 Feb 2024 08:53:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="PifSMHst" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 71571286A6 for ; Fri, 23 Feb 2024 08:53:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708678393; cv=none; b=TvmXoWgaKiohfpCqa2gRAcjGI5xPhrTLfLhgfMnCevqvwUFhudI5pe0dki5zHPjhF8djaYSIrJGu7I945sotcvU/eV69+1t2KZFd8IZLKyE9IX3ur3KFqVotB7OvP1KRgOmRK98c+WV0C1914aWErVo5ZWUqe4IqLyTnArSbDKQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708678393; c=relaxed/simple; bh=XSz0jKNH1n8eCBx82g0+ys+wamiiwRqJhcoAIM5tyhQ=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=AN7eCXP/td4Aly4Gg64jkMaRBq5mI8t4RyIC14klWA7fGOIEng9T9dyoOMoMkvMweLRsTGQF0EiOi+9sdGtCYSzSl8q7KDXpSKs406AwyEPn8aH3+JdGBfCsOPDsEVo+9KH+VE1GdE3QDlHmJleAg2Aige5FTy8B/i/1AIbX8nU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=PifSMHst; arc=none smtp.client-ip=205.220.168.131 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 (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41N6vRhI021242; Fri, 23 Feb 2024 08:53:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version:content-type; s= qcppdkim1; bh=Rj1UnjwW5MY1y+1XNzdWS7I7b/rCvuHtA2QHcA5h7V4=; b=Pi fSMHstYnKlbIbx1kG0g0QDWgXc+MgKYZJ3M+G2ok8pTrrEzkNkdpC2V5CHAsDtW1 I/dH0KEtoK30pEQ13dXPbm1EXfOfl9eCAT4lLVw2KJ6JJojzNwDfy21bT/r3yrZF uaLQN2DKkOSxsiAD/3D7og+QVphGsinD8+f5Faz4E2GR0kPwieQZORPyrJX7/QDk byXvlHsEB2OmW+pKqrFjGQ2DTFYOrfvyRLOOLSTR9Wr+ad64eCETkGspLMMe0dCR 4yx62LWAjau53Bh+P/6OuoJHsBDpzjbhLZf6C8hX3Eo4/ZMtTzo/BwzZaSeEZiB7 to+u8wGqL9jRA2vG6PNg== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3weg88ryk6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Feb 2024 08:53:07 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41N8r6nQ023436 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Feb 2024 08:53:06 GMT Received: from zijuhu-gv.qualcomm.com (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.40; Fri, 23 Feb 2024 00:53:04 -0800 From: Zijun Hu To: , CC: , Zijun Hu Subject: [PATCH] Bluetooth: btusb: Correct timeout macro argument used to receive control message Date: Fri, 23 Feb 2024 16:53:01 +0800 Message-ID: <1708678381-29622-1-git-send-email-quic_zijuhu@quicinc.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: KjptUf8xzf_QzZab7cyr66BxS9Mq0d_Z X-Proofpoint-GUID: KjptUf8xzf_QzZab7cyr66BxS9Mq0d_Z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_15,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 malwarescore=0 suspectscore=0 impostorscore=0 clxscore=1015 adultscore=0 phishscore=0 priorityscore=1501 bulkscore=0 mlxscore=0 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402230062 USB driver defines macro @USB_CTRL_SET_TIMEOUT for sending control message timeout and @USB_CTRL_GET_TIMEOUT for receiving, but usb_control_msg() uses wrong macro @USB_CTRL_SET_TIMEOUT as argument to receive control message, fixed by using @USB_CTRL_GET_TIMEOUT to receive message. Signed-off-by: Zijun Hu --- drivers/bluetooth/btusb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index edfb49bbaa28..07935751e4c7 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2949,7 +2949,7 @@ static int btusb_mtk_uhw_reg_read(struct btusb_data *data, u32 reg, u32 *val) err = usb_control_msg(data->udev, pipe, 0x01, 0xDE, reg >> 16, reg & 0xffff, - buf, 4, USB_CTRL_SET_TIMEOUT); + buf, 4, USB_CTRL_GET_TIMEOUT); if (err < 0) { bt_dev_err(hdev, "Failed to read uhw reg(%d)", err); goto err_free_buf; @@ -2977,7 +2977,7 @@ static int btusb_mtk_reg_read(struct btusb_data *data, u32 reg, u32 *val) err = usb_control_msg(data->udev, pipe, 0x63, USB_TYPE_VENDOR | USB_DIR_IN, reg >> 16, reg & 0xffff, - buf, size, USB_CTRL_SET_TIMEOUT); + buf, size, USB_CTRL_GET_TIMEOUT); if (err < 0) goto err_free_buf; @@ -3681,7 +3681,7 @@ static int btusb_qca_send_vendor_req(struct usb_device *udev, u8 request, */ pipe = usb_rcvctrlpipe(udev, 0); err = usb_control_msg(udev, pipe, request, USB_TYPE_VENDOR | USB_DIR_IN, - 0, 0, buf, size, USB_CTRL_SET_TIMEOUT); + 0, 0, buf, size, USB_CTRL_GET_TIMEOUT); if (err < 0) { dev_err(&udev->dev, "Failed to access otp area (%d)", err); goto done; -- 2.7.4