Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5392690ybl; Tue, 10 Dec 2019 05:24:17 -0800 (PST) X-Google-Smtp-Source: APXvYqysyyBueWeu5igDtJdZwKAJCUOB72+nMtpOPZNkpZIfEOpV8k0zdJ+rwsZ/h91ayI8oxSvo X-Received: by 2002:aca:4c87:: with SMTP id z129mr4048455oia.72.1575984257017; Tue, 10 Dec 2019 05:24:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575984257; cv=none; d=google.com; s=arc-20160816; b=dZ2W0NtjAWJrcBn8Uvj+kIvXqGYu0Eoh8CwwLFja2br54apMdYPRoiyHJ53+Xxcf4U Qpi8oJW965Qm1V6U4wR/AcShwi1338Ez38JQ91yd4pQWOBgz0RU1PYBtYuP5To7UpYE6 LhvXOgmEmQnNu7CRqFIvZLIcDZK4rMTCcOMcjzrQOsxLQykIvX8+K4YaZ1aL/lMYsaMu ZEY+wowEZHgcoulKSqH0dixCxlir6RegpWVOR8WVf6pyc/IIG5xBB3uJ5IU11mgjwiCb 6eY9MI2SlghiIV86zlWtuhK7y6tYqCAXDwegqGtvSb783e8kx7BPNsoi2bLaQEHMIDCS SQUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=tYlVqZ98Bu0+Zyby+yVvjjOxtu1K1h5EceYqcDfe5rc=; b=NJKUmh/WqISirboqUvw8D8qol6SGrZTzRW00VFNQumOdiJ4C5Ydld0W9V91U32HBdf BJsiLnOWNClv7CkpSdZFwUHqfpxELDNh15a1kLAFBJCG7NKRQw1yaVKHqL+QvioOuz56 xbOfoFHZhgb6sh67IRwuHLA6BbaOi7BU2LQsz9gVKCml8WcUFyyreQ8xvVdAaeZqTZWp bwNDJvgvRuiqBFgRTuPfF1bEcvtD6V3WM1xqa8makTVYzQCZPU+yEysHY63DIifkRfuO z2DLBMicI27GDHufZTgSCut+t8lHCQs77XrpCUGImroWEm3+DecVM2HJVN6XIxg1F6QD ZnTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jZzB5gqP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c66si1843000oig.265.2019.12.10.05.24.04; Tue, 10 Dec 2019 05:24:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jZzB5gqP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727412AbfLJNXc (ORCPT + 99 others); Tue, 10 Dec 2019 08:23:32 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34200 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727007AbfLJNXc (ORCPT ); Tue, 10 Dec 2019 08:23:32 -0500 Received: by mail-wr1-f67.google.com with SMTP id t2so20121166wrr.1; Tue, 10 Dec 2019 05:23:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tYlVqZ98Bu0+Zyby+yVvjjOxtu1K1h5EceYqcDfe5rc=; b=jZzB5gqPUI3Hj70GjZNHqyyRNK9JThh41oK5NzYRbAVSm2j+Dd6sheZHpPU/n3jCS5 ZfUKfNC8F8C3S82L/y5j825tPX504MV8WMZbd6mL6UJzvXwsPllBSXBXT//9yc+qaT05 imcx3vmWIlQ/YZyYqZwK5Oztyyebp+3d4tC6MgEYX1Ki5Uqc1+rrR3p6qEE0BbCZk2YS Ua+n+g87LCAwOqF95+/Y0u4hGFGmVYLt+7HUS07/UA9bXNlSPL7FkEoPKhudv0oj5HS7 WR3ur9BLlE0fjKWJTBRMdJj/Vn9TL5HRTKfvLRFraqgoiMdlSCVGtgVrtWcIalyly6gs A6HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tYlVqZ98Bu0+Zyby+yVvjjOxtu1K1h5EceYqcDfe5rc=; b=HM0FfDxEHRNLDGI/QUOt0nvlp3Vv/BDAW92sSmuNeVb+1adjovliDH7uy6y2RZlxOX 7HCQDO5arjMx49B4lIEly17LX+Co7cy463xnXF3n8qEu4Viv8gtpc7FnKRGju7c+5lWD Ul0eJXZc45smsuAv4WM1wywXOb6y9GEXXvkvstH2Rqv1dDVrSSwliwSYw64Z+xRIv7Ig ZsKvdx//W7I0UeVrMR8gCjkEX1DhLykOfI0mV65RjItqswJAEuwgEpAd0Nqfs5h7s07D F/PUZ7CJeyq6z9wWmIWXrTpcDHqJmanux3J5D24jh42ysPXGm/lm121W+kdkyj+86M71 CPmA== X-Gm-Message-State: APjAAAVOT23RMgXLvPJlnL49zGRI9QXQ6KxYvxZvXQadG53z5zAUlxmm ja0zSme/jNm/qH8PW9hpmYc+KW/8nvc= X-Received: by 2002:a5d:5491:: with SMTP id h17mr3409334wrv.374.1575984209868; Tue, 10 Dec 2019 05:23:29 -0800 (PST) Received: from stbsrv-and-01.and.broadcom.net ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id s82sm3101680wms.28.2019.12.10.05.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 05:23:29 -0800 (PST) From: Al Cooper To: linux-kernel@vger.kernel.org Cc: Al Cooper , bcm-kernel-feedback-list@broadcom.com, devicetree@vger.kernel.org, Florian Fainelli , Kishon Vijay Abraham I , linux-arm-kernel@lists.infradead.org, Mark Rutland , Rob Herring , Srinath Mannam Subject: [PATCH v3 01/13] phy: usb: EHCI DMA may lose a burst of DMA data for 7255xA0 family Date: Tue, 10 Dec 2019 08:21:20 -0500 Message-Id: <20191210132132.41509-2-alcooperx@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191210132132.41509-1-alcooperx@gmail.com> References: <20191210132132.41509-1-alcooperx@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the EHCI controller received a 512 byte USB packet that had to be broken into 2 256 byte bursts across the SCB bus AND there was a following 512 byte USB packet, the second burst of data from the first packet was sometimes being lost. If the burst size was changed to 128 bytes via the EBR_SCB_SIZE field in the USB_CTRL_EBRIDGE register we'd see the 4th 128 byte burst of the first packet being lost. This problem became much worse if other threads were running that accessed memory, like a memcpy test. Setting the EBR_SCB_SIZE to 512, which prevents breaking the EHCI USB packet (max size of 512 bytes) into bursts, fixed the problem. Signed-off-by: Al Cooper --- drivers/phy/broadcom/phy-brcm-usb-init.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/phy/broadcom/phy-brcm-usb-init.c b/drivers/phy/broadcom/phy-brcm-usb-init.c index 91b5b09589d6..bd473d12ab28 100644 --- a/drivers/phy/broadcom/phy-brcm-usb-init.c +++ b/drivers/phy/broadcom/phy-brcm-usb-init.c @@ -42,6 +42,7 @@ #define USB_CTRL_PLL_CTL_PLL_IDDQ_PWRDN_MASK 0x80000000 /* option */ #define USB_CTRL_EBRIDGE 0x0c #define USB_CTRL_EBRIDGE_ESTOP_SCB_REQ_MASK 0x00020000 /* option */ +#define USB_CTRL_EBRIDGE_EBR_SCB_SIZE_MASK 0x00000f80 /* option */ #define USB_CTRL_OBRIDGE 0x10 #define USB_CTRL_OBRIDGE_LS_KEEP_ALIVE_MASK 0x08000000 #define USB_CTRL_MDIO 0x14 @@ -176,6 +177,7 @@ static const struct id_to_type id_to_type_table[] = { { 0x33900000, BRCM_FAMILY_3390A0 }, { 0x72500010, BRCM_FAMILY_7250B0 }, { 0x72600000, BRCM_FAMILY_7260A0 }, + { 0x72550000, BRCM_FAMILY_7260A0 }, { 0x72680000, BRCM_FAMILY_7271A0 }, { 0x72710000, BRCM_FAMILY_7271A0 }, { 0x73640000, BRCM_FAMILY_7364A0 }, @@ -948,6 +950,17 @@ void brcm_usb_init_eohci(struct brcm_usb_init_params *params) if (params->selected_family == BRCM_FAMILY_7271A0) /* Enable LS keep alive fix for certain keyboards */ USB_CTRL_SET(ctrl, OBRIDGE, LS_KEEP_ALIVE); + + if (params->family_id == 0x72550000) { + /* + * Make the burst size 512 bytes to fix a hardware bug + * on the 7255a0. See HW7255-24. + */ + reg = brcmusb_readl(USB_CTRL_REG(ctrl, EBRIDGE)); + reg &= ~USB_CTRL_MASK(EBRIDGE, EBR_SCB_SIZE); + reg |= 0x800; + brcmusb_writel(reg, USB_CTRL_REG(ctrl, EBRIDGE)); + } } void brcm_usb_init_xhci(struct brcm_usb_init_params *params) -- 2.17.1