Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp912585lqo; Fri, 10 May 2024 22:26:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVH/HxgLSAEhp8dIYhnl2V5SCcdcNlBl7o22079DmGRLrT6tGopqZN6f4LlUAV1PtHniYlfDDJNSQoaU7p4dfOsiLIBjHHT6aZ/AVouGw== X-Google-Smtp-Source: AGHT+IGLUdlymPBao8Z1vhjL/62rHrvXQBNzqwyDql37JqaOd9Dmbt304MboH74/c1A01fwtiiam X-Received: by 2002:a17:903:2343:b0:1e7:d482:9d96 with SMTP id d9443c01a7336-1ef43c094e4mr69703355ad.10.1715405205462; Fri, 10 May 2024 22:26:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715405205; cv=pass; d=google.com; s=arc-20160816; b=Tlz5KN1FKDdCQ1Vzm+TijVMMkhujrZhKPdDUTSHUOANagI/zBI+lbpoDlS5u6YjL7v T6Fcjs2QeFfN3gTvzfi0pVnjWRde1Oy4q5Nw8uOPAqcXjTOlFvWz669kT9sGecRkPUSA UKTCH9sZFzldBPH5YN2Hu9ERJStFeegNH2SQpI1QUwtTKx9v/i8eBZr/Ew78PtZvzeVp XXmmFIRP5dB60ePNdJju14HCdta8nSRqn1QNX2yGTIKuRuDYppC6QggYuEHAJQIqG+KM yN2tzpGHjm+IHNvlCt+nxZ9tmLSATZhzQ6ltw0DQqPSxHSEKQdCXLhrWx/QgG1kRVrQ4 pSKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Ohs0FbiFe7hjjqUNwje2viwMnjeoV4+OPmviz3t4DLM=; fh=Cldfs1o3Ak7wvlE2aFharc2IjqRFNTv+DAcRcsTApAs=; b=Tlccn5a7vm63q4Poyi4E5xcXXx2O8Ix/xA/ZV971093XiK6t1B/hfJ+zYKl8HPKmV7 K54Sjg2BSdRgaC/g8+iLZ7T/gfvgWUVb5k+z4ovgctEZvji/zTX8IGUlPW+TuG/HgMhv e0NIQWGB4jI32mX9G6z+dETNN3CESUBzagLGmZ/sGZ7sG+nRyFXdKvzr7jvlkdmrDF7o C3EMaKyi4ENPKXlhza+TjHxsqI07KNDmZOaWcOMOPd/8Bmz4wPA9Xunw01KlWX+SBY5P qm3b1wx858S5LLNBdSes8i4CquCgJ/whavzADhVWXbyk8xnmG/UIl49bixi5svjSZrbs SXmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NiMP0glW; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4526-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4526-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0b9d1442si52086025ad.70.2024.05.10.22.26.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 22:26:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4526-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NiMP0glW; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4526-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4526-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 30E45284A38 for ; Sat, 11 May 2024 05:26:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04AAC47A57; Sat, 11 May 2024 05:26:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NiMP0glW" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 413FC27452 for ; Sat, 11 May 2024 05:26:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715405197; cv=none; b=nDsKb0rITYBXb2NsvyAuZzd4+ItCmJ8A+yCzsnWlsk/aADRfxtj9A0erPvRd3o55FkTQPzocbQ/kzZmUmhDxXkbJaLcz5tr4qZ0D8SCWn04qejRfS/0b7kEIdswCi9ae9I9ehKLLsSvdNCkwVEVlIN3fo7jboYpoIdYtEdjJKWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715405197; c=relaxed/simple; bh=gAYMV0I35sAlJt0TBy6UeVu0g+hDAONZcwrOCc02+RQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HXNR8WHq3pT5nCyG7qxbA3J9frEHT3zB7Nc2wO0aUcs07SzIxSt2X4EaDclEu5AihFcWLu9t9i6e8yZye2sq4o/LpXHzEdYZiA+fn5zSqvyUf9Za/fOYeQ3WrxdrNnaJxHFGZjZ8FftpFAQMRY6P5XEI1Z+lXNPogMGTgXgN3rg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=NiMP0glW; arc=none smtp.client-ip=198.175.65.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715405196; x=1746941196; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gAYMV0I35sAlJt0TBy6UeVu0g+hDAONZcwrOCc02+RQ=; b=NiMP0glWROShEFgQQugRPhGexfzknDwFA6fXfgpGolyzTFInP+ki/huf bt5pzWJ6Y4CJ4Fo4C6XjvxyuZKfV4CPtVuokIvTTRs2vg4TouJowg9vf2 tmU93Ip4WO6j5d9Hm0fGmZlYeQnGsmWqghJsI5Ky8ua50CEnbe+VPKGbO qowZ0TJfGPDVbZn51ZOMdlXS6WJIU1zfrGuoZ+FEMH6eYfisRtRq8rJpo 9RTCUfHgIhBJu+KWXlPm5VCISB14LHV2y4PAsz49vERxTk9EclfR6whQK r9NCIYTIUairBPusgADQi5ZC0K/1YEan4H/0k+S3y0JEzqESJmMpcIxal w==; X-CSE-ConnectionGUID: 2L4W8UqkSfu/tsnB+G2jDg== X-CSE-MsgGUID: ySbXacfgSHe+1SojMYv5Ig== X-IronPort-AV: E=McAfee;i="6600,9927,11069"; a="33917272" X-IronPort-AV: E=Sophos;i="6.08,153,1712646000"; d="scan'208";a="33917272" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2024 22:26:35 -0700 X-CSE-ConnectionGUID: p+6e/cVuRMSwawpn3p1NOA== X-CSE-MsgGUID: i3rxvjHRTcGgtbQQoktEAw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,153,1712646000"; d="scan'208";a="29790245" Received: from intel-lenovo-legion-y540-15irh-pg0.iind.intel.com ([10.224.186.95]) by fmviesa007.fm.intel.com with ESMTP; 10 May 2024 22:26:33 -0700 From: Kiran K To: linux-bluetooth@vger.kernel.org Cc: ravishankar.srivatsa@intel.com, chethan.tumkur.narayan@intel.com, chandrashekar.devegowda@intel.com, Kiran K Subject: [PATCH v1 2/2] Bluetooth: btintel_pcie: Refactor and code cleanup Date: Sat, 11 May 2024 11:10:59 +0530 Message-Id: <20240511054059.349729-2-kiran.k@intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240511054059.349729-1-kiran.k@intel.com> References: <20240511054059.349729-1-kiran.k@intel.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Minor refactor and s/TX_WAIT_TIMEOUT_MS/BTINTEL_PCIE_TX_WAIT_TIMEOUT_MS/g. Fixes: 8b72a66f8a35 ("Bluetooth: btintel_pcie: Add *setup* function to download firmware") Signed-off-by: Kiran K --- drivers/bluetooth/btintel_pcie.c | 7 +++---- drivers/bluetooth/btintel_pcie.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c index 030a75e5d2a3..5b6805d87fcf 100644 --- a/drivers/bluetooth/btintel_pcie.c +++ b/drivers/bluetooth/btintel_pcie.c @@ -151,7 +151,7 @@ static int btintel_pcie_send_sync(struct btintel_pcie_data *data, /* Wait for the complete interrupt - URBD0 */ ret = wait_event_timeout(data->tx_wait_q, data->tx_wait_done, - msecs_to_jiffies(TX_WAIT_TIMEOUT_MS)); + msecs_to_jiffies(BTINTEL_PCIE_TX_WAIT_TIMEOUT_MS)); if (!ret) return -ETIME; @@ -1096,10 +1096,9 @@ static int btintel_pcie_send_frame(struct hci_dev *hdev, hdev->stat.err_tx++; bt_dev_err(hdev, "Failed to send frame (%d)", ret); goto exit_error; - } else { - hdev->stat.byte_tx += skb->len; - kfree_skb(skb); } + hdev->stat.byte_tx += skb->len; + kfree_skb(skb); exit_error: return ret; diff --git a/drivers/bluetooth/btintel_pcie.h b/drivers/bluetooth/btintel_pcie.h index 0e596e094f80..baaff70420f5 100644 --- a/drivers/bluetooth/btintel_pcie.h +++ b/drivers/bluetooth/btintel_pcie.h @@ -87,7 +87,7 @@ enum { /* DMA allocation alignment */ #define BTINTEL_PCIE_DMA_POOL_ALIGNMENT 256 -#define TX_WAIT_TIMEOUT_MS 500 +#define BTINTEL_PCIE_TX_WAIT_TIMEOUT_MS 500 /* Doorbell vector for TFD */ #define BTINTEL_PCIE_TX_DB_VEC 0 -- 2.40.1