Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2894578pxb; Tue, 24 Aug 2021 10:03:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwE6X0dL8Ru0NXzbOC/e7EJHLSIWRrUNxJdSFgB6qip9qwuVKPdBDWFjQ6161Lmi+JoFoKb X-Received: by 2002:a17:906:8517:: with SMTP id i23mr13356024ejx.367.1629824600826; Tue, 24 Aug 2021 10:03:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629824600; cv=none; d=google.com; s=arc-20160816; b=vjoHzj/oLqKfgoy/KpU7a1jI63KEslpEjObNFbedUOZWZ9m/ubODABQGfQ/4CdGFAe p5kn3+/fFKlPKjpDDzYxTTvJW8SF9dPoT0CkgGOSl4/KHL48LDYpIyGQDpG2aNI2pO5V t2cVjdsndtEg2mWJZiu6OMtrLFN9G4DTlzIYKzvDG6o2jVy02Km+8bRsvMoJV/TMTgh6 nvR3JKv+2/4rInpbTEZDSUbbXzICnKvvOVoyA5Oc2Pi0ODPL6uIzeEHwaxR7ip4Ssv8l h6tArqhXmtsYDm0Y3secQFiyOT1O4xY8vfkxPr4dT8uJwjRmvfPfdgDTSQfiDAReawjn Gziw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=W8sJheg+cCcJ4PCEx3J0dsSUQU1NVv7miOsTSQ0RuF8=; b=jCWO2v9+uwGtTVSiwSMOI9LTFzRB8jne5jxDwCBtj1mfWLWRzA6B/u7R2fJ+/h3fK6 LrEQx+TZHBjYcHYqRvO1XkMYRSr7NW7bGK84gTvlMyl3eN+U91BKwEU4WhPp0FIiCya3 ZJIbjUUS+wSS5F8iWAvJ7aA+BliemwgNsCYpatwKvw8NrjNkpcV6aKXS+Hj4zKq/zDK2 GYLzMuBFF0eTTMgiPGkuhFKjAHzP/YccrqRR9S4Nxs0uFjDKQ9txoWvjrBOANYPlyXXr Tl5RbSAFhPrWUn5NvPNf8+zk9ftbq+2K7XTDTcehk4ZAvh2iTlWwwZ369SdgF6KLWK3a gsdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JpsnhkNK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hk18si17908669ejb.238.2021.08.24.10.02.43; Tue, 24 Aug 2021 10:03:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JpsnhkNK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239218AbhHXRCJ (ORCPT + 99 others); Tue, 24 Aug 2021 13:02:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:39206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238843AbhHXQ7G (ORCPT ); Tue, 24 Aug 2021 12:59:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DB42B61407; Tue, 24 Aug 2021 16:57:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824246; bh=qOpZ2WkZCrX1yf1K35+6Pi3teojoh/oXtDy65VxztZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JpsnhkNKiSSJ/cmHMEzis95ooXxMfqti1U2MBvS4DcjVRxWHs2KLkte06Z4NMl312 BO45nleTJILoO4TIbIOdFb+YUCNIpj4fS2/P6gHQaKY2kHWZuo0YFzGC8n9+24rHqh XA4wMQRF5RstCcTK0H9hUZOR29qURrKhWqFkcfBH8MRX4w1vIQ1EHbX50sbfXGSMng RdSwvPuuvOrsGfTPeanP+wTTuVfsiP/mIjn8Sc3TBEFBYTqrAlLSztgL0apYQWQtZj 9lKuY5OY2gOZSjT/ZsmzROUp90ZBujAEba1p0V21BjZ8jJHjPySumgaqitIDciHTVk KK9iExH3bzuJg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hayes Wang , "David S . Miller" , Sasha Levin Subject: [PATCH 5.13 079/127] r8152: fix the maximum number of PLA bp for RTL8153C Date: Tue, 24 Aug 2021 12:55:19 -0400 Message-Id: <20210824165607.709387-80-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824165607.709387-1-sashal@kernel.org> References: <20210824165607.709387-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.13.13-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.13.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.13.13-rc1 X-KernelTest-Deadline: 2021-08-26T16:55+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hayes Wang [ Upstream commit 6633fb83f1faddbfcac09e35edcae96bd0468335 ] The maximum PLA bp number of RTL8153C is 16, not 8. That is, the bp 0 ~ 15 are at 0xfc28 ~ 0xfc46, and the bp_en is at 0xfc48. Fixes: 195aae321c82 ("r8152: support new chips") Signed-off-by: Hayes Wang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/r8152.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index b2b77edf72b8..a044f37e87ae 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -3953,13 +3953,24 @@ static void rtl_clear_bp(struct r8152 *tp, u16 type) case RTL_VER_06: ocp_write_byte(tp, type, PLA_BP_EN, 0); break; + case RTL_VER_14: + ocp_write_word(tp, type, USB_BP2_EN, 0); + + ocp_write_word(tp, type, USB_BP_8, 0); + ocp_write_word(tp, type, USB_BP_9, 0); + ocp_write_word(tp, type, USB_BP_10, 0); + ocp_write_word(tp, type, USB_BP_11, 0); + ocp_write_word(tp, type, USB_BP_12, 0); + ocp_write_word(tp, type, USB_BP_13, 0); + ocp_write_word(tp, type, USB_BP_14, 0); + ocp_write_word(tp, type, USB_BP_15, 0); + break; case RTL_VER_08: case RTL_VER_09: case RTL_VER_10: case RTL_VER_11: case RTL_VER_12: case RTL_VER_13: - case RTL_VER_14: case RTL_VER_15: default: if (type == MCU_TYPE_USB) { @@ -4329,7 +4340,6 @@ static bool rtl8152_is_fw_mac_ok(struct r8152 *tp, struct fw_mac *mac) case RTL_VER_11: case RTL_VER_12: case RTL_VER_13: - case RTL_VER_14: case RTL_VER_15: fw_reg = 0xf800; bp_ba_addr = PLA_BP_BA; @@ -4337,6 +4347,13 @@ static bool rtl8152_is_fw_mac_ok(struct r8152 *tp, struct fw_mac *mac) bp_start = PLA_BP_0; max_bp = 8; break; + case RTL_VER_14: + fw_reg = 0xf800; + bp_ba_addr = PLA_BP_BA; + bp_en_addr = USB_BP2_EN; + bp_start = PLA_BP_0; + max_bp = 16; + break; default: goto out; } -- 2.30.2