Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4602324ybl; Mon, 9 Dec 2019 13:44:48 -0800 (PST) X-Google-Smtp-Source: APXvYqwD+50qHE8UNOR/X4uwB3DkNDjTN0VbN5wA6AzRFjjFuZSc3Po18jY4QbwtpCyLShcH9D6t X-Received: by 2002:a9d:6d06:: with SMTP id o6mr23517017otp.239.1575927888616; Mon, 09 Dec 2019 13:44:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575927888; cv=none; d=google.com; s=arc-20160816; b=EFyVkwVwA8LMo5tNXoIJ2B2RFin0qLg51SvZDlVDQz+z5kCHbV/sNRsRVdeRYuf/0P 83acqf4ML2q9y0zRUILoJxO+jhiJJqmbfSat01mJTN9SNMTMvkxznTJhgUjlijEIKfUP tyXSl24R9enQbqXpjJ8Ab85ZKueVAaXtl6fm7dOOS3Jw64oKiD8YwQ2iBXoFf7VhijJj RnwiUDBstpcHYU2C7/RNwcrSLsu3Cz7MBJ7/2O6BL3WKeM74Q1m7fWdp6NTFAfXj05to aqLfFbsHer4YzFI/GcAv45EVyiBGJcsfRFH4uYsl5GtjdN50hXg2KH5ENAx6cIWeqzkC NnuA== 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=z4v4wVl3s1hArrGKDQlCf3SAy+2jZtyPSY8RHpRjW/c=; b=tAVyHhA+Unx9n2/NAoNYqWhLRJ0MAqOYrmeMKb6/J6qf/r4cwL7q6r3pKAUixobJLe jaiAx1lr9zQEBI4MVUg2JNUcjASAyl6iLcZeyhQ312bYiPCH3Ko/Sr+VPZqg7ClBXd9P P6m980QhcGNMz6AXjxO6s6SZ8Mqp68fxJybxYmfR4ZIdeZFbaCxC9t7m156wVwqcd5Fa K042K4xdhvdsdEujjjtij9qnww18FZRl18FCWQKxC+JSA/jXC2Mj7JQKX1AXoKKFfgmT 1yGu5d+IUeTG177RU88Bc9VEdNKtDmwqikWyd7vvWefPgp0jhnJ8wL17yJDP+Sk6ECbx naRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AwCtSsGg; 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 j18si638937otq.275.2019.12.09.13.44.36; Mon, 09 Dec 2019 13:44:48 -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=AwCtSsGg; 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 S1726917AbfLIVoB (ORCPT + 99 others); Mon, 9 Dec 2019 16:44:01 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35802 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726678AbfLIVn5 (ORCPT ); Mon, 9 Dec 2019 16:43:57 -0500 Received: by mail-wr1-f68.google.com with SMTP id g17so17857669wro.2; Mon, 09 Dec 2019 13:43:56 -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=z4v4wVl3s1hArrGKDQlCf3SAy+2jZtyPSY8RHpRjW/c=; b=AwCtSsGgaxa2dIWV1nmq65YJ25iDf9OXOxia9MHl012H1+fXikG+cajj+8mIDBCP+F baCRUDfv/t96NstrQSw6iu9J82D0O5VNRgOdzWt1iq4TvXRcXNiICHcpUqCNj+uN7Nyn qtPogoAZAeJbITVUF1wMmPLgK6YqXSOyF/RbkCOvH0dt1ZbyDHz8kYuvoQ7q1/U5hugZ xjiPaYz7TaRn7P2HM4eKS9GO8msrpQfRlROMuHyv0nolEaN4q3OXVgZjgNUsGh4hDEG/ vNWPJPfnIdqPDEEZRXbc80uEmFZfgq8+GyEYHFmQ9ZqM324qxbBdX7ZWMJgT1E1FPS5U jaEQ== 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=z4v4wVl3s1hArrGKDQlCf3SAy+2jZtyPSY8RHpRjW/c=; b=uieSVSsHeDf1QSa3AvUHxeiYb8uaOTsq6QkRyA28+Tw/SvKPEY9vsRNTWTiqq9/d8F DcSbekP3BSzdvdSyrldiQoBH+JlBX8wxgEd918sjrt7aRfk0pC2yw51iEZF+kk1n8PaI gDshuzj7TYjtL7k4m6R2uSwFwJkxyoow2REK/1Typ3U4+N6bU976QqgjSYRpx5hxWg+Q G03cT3m1RABs89Hz2dGwn11b4Lg9DNA+spjnFFFU3ZtncNA+c3H81GtHc307vs1npAnO vRjg+g6j1E916pWxH492JFUiynSnaJJ/WhdHbvikfif7swPU+YOTaVJRyfd/xdPDXTvn PLNQ== X-Gm-Message-State: APjAAAWYaCUn4cyNAipEMf7GfzuL+Q9z8+rDyTvpXVGMsIohg9PF7ik/ W/yio9kLiOBDDGMJvyghH1t3VskjdHo= X-Received: by 2002:a05:6000:11c3:: with SMTP id i3mr4336383wrx.244.1575927835229; Mon, 09 Dec 2019 13:43:55 -0800 (PST) Received: from stbsrv-and-01.and.broadcom.net ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id z6sm757714wmz.12.2019.12.09.13.43.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2019 13:43:54 -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 v2 resend 01/13] phy: usb: EHCI DMA may lose a burst of DMA data for 7255xA0 family Date: Mon, 9 Dec 2019 16:42:37 -0500 Message-Id: <20191209214249.41137-2-alcooperx@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191209214249.41137-1-alcooperx@gmail.com> References: <20191209214249.41137-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 3c53625f8bc2..56d9b314a8d0 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