From patchwork Fri Aug 7 07:15:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 6966491 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E35D7C05AC for ; Fri, 7 Aug 2015 08:30:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A318F20657 for ; Fri, 7 Aug 2015 08:30:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 23C6520658 for ; Fri, 7 Aug 2015 08:30:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZNczZ-0003jT-Co; Fri, 07 Aug 2015 08:27:05 +0000 Received: from mail-bn1bbn0109.outbound.protection.outlook.com ([157.56.111.109] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZNczG-0003VJ-Rw for linux-arm-kernel@lists.infradead.org; Fri, 07 Aug 2015 08:26:51 +0000 Received: from CO2PR03CA0046.namprd03.prod.outlook.com (10.141.194.173) by BY1PR0301MB0854.namprd03.prod.outlook.com (10.160.193.148) with Microsoft SMTP Server (TLS) id 15.1.225.19; Fri, 7 Aug 2015 08:26:23 +0000 Received: from BL2FFO11FD056.protection.gbl (2a01:111:f400:7c09::141) by CO2PR03CA0046.outlook.office365.com (2a01:111:e400:1414::45) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Fri, 7 Aug 2015 08:26:23 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD056.mail.protection.outlook.com (10.173.161.184) with Microsoft SMTP Server (TLS) id 15.1.243.9 via Frontend Transport; Fri, 7 Aug 2015 08:26:22 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t778Q8l3019852; Fri, 7 Aug 2015 01:26:18 -0700 From: Peter Chen To: , Subject: [PATCH v3 02/10] usb: chipidea: define stream mode disable for both roles Date: Fri, 7 Aug 2015 15:15:39 +0800 Message-ID: <1438931747-25209-3-git-send-email-peter.chen@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438931747-25209-1-git-send-email-peter.chen@freescale.com> References: <1438931747-25209-1-git-send-email-peter.chen@freescale.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD056; 1:/8SjQwVlBca05fntTJPbNqeXxgvLbVGQ+V1gXOqWZBKJIe5u8z2vJtOhapa4YF/cq6hfTGW28oev/W8PEOviO/CJdcIjQwrAZfJw9Sl83s7VZrVUK6iUsXrb8IBaAfqYBSEcGbg+T8TOSC78mNz4JbmzbkgJWoXMU1qxuOFv6iZkRheI8u6ydKQEgOHXCt6s45v/bEeELSS3FNx0m0pXZOdO7GQT6q49NNIRUH8wMHwpAX32L5HRDInFrKFpbPcrLI7CJDhZNbpaMAFxFtDEQEbPH7DgQE/9vJa8+4vKSUOK9O/etAAkg3WMsqsdiKCoVkR6muaVrfPdvxu7pP2L6g== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(50944005)(189002)(199003)(229853001)(2950100001)(62966003)(68736005)(77156002)(77096005)(106466001)(86362001)(6806004)(19580405001)(105606002)(19580395003)(81156007)(97736004)(4001540100001)(36756003)(5001770100001)(189998001)(5820100001)(23676002)(5001960100002)(107886002)(92566002)(5001830100001)(5001860100001)(69596002)(87936001)(104016003)(85426001)(50226001)(50466002)(50986999)(33646002)(76176999)(551934003)(46102003)(64706001)(47776003)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR0301MB0854; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0854; 2:QIT1YBsQyN7tfIcpjXD6JBtJXMI+BY2cUon/Xid2OFgWKFlFV5ha28IhYQyj1DjLPP/6s5gz8Ii4y4vab0Lqu6IOBzellcEMO8aOyimecrRIwQKa+8+m+zBdhJ7gvvDOHuWrcLjMbFwAzTFIBo596YDXb10dnSMWW+lHJuPS35k=; 3:mx6z+N4V+3ceaU/8bzMmHXhGaWCIOF8sSWHdfdUqtbAbb8etWVIZ1WxYUM4r2333aFWHJrWaP9/k9yeB9BLkP5JmHvhp/V9Rb8tEX9jsdJFLLwzRiTbiPbsDmaQ0KnSX42HAF41r1URLQxjK1AO8bhNYJy1Hvxo/smSarg092Qw/liqlknazND4dAHGEni7VYZJjxrExob84O8KU0/WQF19455iP+49gQVhvRhgsiPY=; 25:f6nRKu46ZQWGo/5t4Siert5KlZUNNW1TUYm/5hmmDscCo2/gsk+dicqdVPKGsVTyHRo2plYQuj9E38xINQEIM8ZyT7B7QYEUAxP3hXa0fSxjWOvmExN2hQN7wtW+1g7NCD4QIidKufoAS5+hgyOv/zxxi64gEFvFpeJr6ieGZ1doVKKt6zjZnN1wai6mttn6myrJYs+Ajaiovq9Uk/bIAb/QDw7jxIA7/sOilm39KwZLgXqw3Gywr/4TCo2Vy3Xuf5fNBLbDvVxbtSo4Wpr3lA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0301MB0854; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0854; 20:A/hCulwfTu0SCmyyg1McATf6HXsNkECqj8fErSL1/2XZXcOThZpqFiVfucbvqbXvtJyaVIilJPm5Jj1iqgbqadBIP7TZK7ZAy//eeeXIlOoFEeA1oKTyJMeZZ+GDZ99aLwRh6BrbRhtWF1CQXVSO5fSuNRx1PTW8bmEVeTaQswr59dJyB20Eg16Dm2w0O3w9lYjqP5W/htFHB0OvnZFIqejU+zEZqtTgjfHNBWEfkaELePylljE/EVA6NKxYl+8YGGHm00FRn0mo+hC4Ih5u1rYr4wn+fcVP+dkkKlIVg495+h/eBNSoQRGnBAa/tZN96WH+NPfna4KyAGS+EYwMVhjkowEZJ9+YtT+aqzZTehw=; 4:pBeesUNALdonos8cGZvjhWo15LHdx2PbtAZqtwEM3be+B1JQ6kAOYeCQjaZo5UTirQxMBZZDvWts/OO7G8np49LdBVjy1RLcO3Oh2Di6cpWrYR7sbFZxBMhzxGhKp8rE2jDJ4ByckWNGe9aupaqNiesm8AHBK2j7E6ZzdNWmS/SQiZ/0a/9hA/Ao9P/ZR/xEjmwBFgLFxmI6Xnsf0Ar3aUrJ6cSbzKDo4TlF963rRBITS/oUyKAPqXMd73pH6PD/1oE+D9G6CwVbdIVMu1idhHfoyZ+UgYAUvv3DT1mYYLY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BY1PR0301MB0854; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0301MB0854; X-Forefront-PRVS: 066153096A X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTFQUjAzMDFNQjA4NTQ7MjM6MWRnWjBCL1hmY1VuTUJPRHBVbmhQ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fuCvgQ30nzlYGQeZySZLz1n16WgKfiau4DSaeiaQWO9nC19cLY0V8CyYzcvozApI4=; 20:V7xD0kQNe8yqQh15O8FxvuxHG/jNfimP3VyBDScMiI6cCxt0B1+WOYjsX2UHZYkEcbf6Ll1uNEU68abc7naTRg== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2015 08:26:22.4446 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0301MB0854 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150807_012647_386538_3D67A71E X-CRM114-Status: GOOD ( 22.94 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, pawel.moll@arm.com, gregkh@linuxfoundation.org, s.hauer@pengutronix.de, jun.li@freescale.com, Peter Chen , kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The system bus and chipidea IP have different limitations for both host and device mode. For example, with below errata, we need to enable SDIS(Stream Disable Mode) at host mode. But we don't want it for device mode at the same system. TAR 9000378958 Title: Non-Double Word Aligned Buffer Address Sometimes Causes Host to Hang on OUT Retry Impacted Configuration: Host mode, all transfer types Description: The host core operating in streaming mode may under run while sending the data packet of an OUT transaction. This under run can occur if there are unexpected system delays in fetching the remaining packet data from memory. The host forces a bad CRC on the packet, the device detects the error and discards the packet. The host then retries a Bulk, Interrupt, or Control transfer if an under run occurs according to the USB specification. During simulations, it was found that the host does not issue the retry of the failed bulk OUT. It does not issue any other transactions except SOF packets that have incorrect frame numbers. The second failure mode occurs if the under run occurs on an ISO OUT transaction and the next ISO transaction is a zero byte packet. The host does not issue any transactions (including SOFs). The device detects a Suspend condition, reverts to full speed, and waits for resume signaling. A third failure mode occurs when the host under runs on an ISO OUT and the next ISO in the schedule is an ISO OUT with two max packets of 1024 bytes each. The host should issue MDATA for the first OUT followed by DATA1 for the second. However, it drops the MDATA transaction, and issues the DATA1 transaction. The system impact of this bug is the same regardless of the failure mode observed. The host core hangs, the ehci_ctrl state machine waits for the protocol engine to send the completion status for the corrupted transaction, which never occurs. No indication is sent to the host controller driver, no register bits change and no interrupts occur. Eventually the requesting application times out. Detailed internal behavior: The EHCI control state machine (ehci_ctrl) in the DMA block is responsible for parsing the schedules and initiating all transactions. The ehci_ctrl state machine passes the transaction details to the protocol block by writing the transaction information in to the TxFIFO. It then asserts the pe_hst_run_pkt signal to inform the host protocol state machine (pe_hst_state) that there is a packet in the TxFIFO. A tag of 0x0 indicates a start of packet with the data providing the following information: 35:32 Tag 31:30 Reserved 29:23 Endpoint (lowest 4 bits) 22:16 Address 15:10 Reserved 9:8 Endpoint speed 7:6 Endpoint type 5:6 Data Toggle 3:0 PID The pe_hst_state reads the packet information and constructs the packet and issues it to the PHY interface. The ehci_ctrl state machine writes the start transaction information in to the TxFIFO as 0x03002910c for the OUT packet that had the under run error. However, it writes 0xC3002910C for the retry of the Out transaction, which is incorrect. The pe_hst_state enters a bus timeout state after sending the bad CRC for the packet that under ran. It then purges any data that was back filled in to the TxFIFO for the packet that under ran. The pe_hst_state machine stops purging the TxFIFO when it is empty or if it reads a location that has a tag of 0x0, indicating a start of packet command. The pe_hst_state reads 0xC3002910C and discards it as it does not decode to a start of packet command. It continues to purge the OUT data that has been pre-buffered for the OUT retry . The pe_hst_state detects the hst_packet_run signal and attempts to read the PID and address information from the TxFIFO. This location has packet data and so does not decode to a valid PID and so falls through to the PE_HST_SOF_LOAD state where the frame_num_counter is updated. The frame_num_counter is updated with the data in the TxFIFO. In this case, the data is incorrect as the ehci_ctrl state machine did not initiate the load. The hst_pe_state machine detects the SOF request signal and sends an SOF with the bad frame number. Meanwhile, the ehci_ctrl state machine waits indefinitely in the run_pkt state waiting for the completion status from pe_hst_state machine, which will never happen. The ISO failure case is similar except that there is no retry for ISO. The ehci_ctrl state machine moves to the next transfer in the periodic schedule. If the under run occurs on the last entry of the periodic list then it moves to the Async schedule. In the case of ISO OUT simulations, the next ISO is a zero byte OUT and again the start of packet command gets corrupted. The TxFIFO is empty when the hst_pe_state attempts to read the Address and PID information as the transaction is a zero byte packet. This results in the hst_pe_state machine staying in the GET_PID state, which means that it does not issue any transactions (including SOFs). The device detects a Suspend condition and reverts to full speed mode and waits for a Resume or Reset signal. The EHCI specification allows a Non-DoubleWord (32 bits) offset to be used as a current offset for Buffer Pointer Page 0 of the qTD. In Non-DoubleWord aligned cases, the core reads the packet data from the AHB memory, performs the alignment operation before writing it in to the TxFIFO as a 32 bit data word. An End Of Packet tag (EOP) is written to the TxFIFO after all the packet data has been written in to the TxFIFO. The alignment function is reset to Idle by the EOP tag. The corruption of the start of packet command arises because the packet buffer for the OUT transaction that under ran is not aligned to a DoubleWord, and hence no EOP tag is written to the TxFIFO. The alignment function is still active when the start packet information is written in to the TxFIFO for the retry of the bulk packet or for the next transaction in the case of an under run on an ISO. This results in the corruption of the start tag and the transaction information. Click for waveform showing the command 0x 0000300291 being written in to the TX FIFO for the Out that under ran. Click for waveform showing the command 0xC3002910C written to the TxFIFO instead of 0x 0000300291 Versions affected: Versions 2.10a and previous versions How discovered: Customer simulation Workaround: 1- The EHCI specification allows a non-DoubleWord offset to be used as a current offset for Buffer Pointer Page 0 of the qTD. However, if a DoubleWord offset is used then this issue does not arise. 2- Use non streaming mode to eliminate under runs. Resolution: The fix involves changes to the traffic state machine in the vusb_hs_dma_traf block. The ehci_ctrl state machine updates the context information by encoding the transaction results on the hst_op_context_update signals at the end of a transaction. The signal hst_op_context_update is added to the traffic state machine, and the tx_fifo_under_ran_r signal is generated if the transaction results in an under run error. Click for waveform The traffic state machine then traverses to the do_eop states if the tx_fifo_under_ran error is asserted. Thus an EOP tag is written in to the TxFIFO as shown in this waveform . The EOP tag resets the align state machine to the Idle state ensuring that the next command written by the echi_ctrl state machine does not get corrupted. File(s) modified: RTL code fixed: ….. Method of reproducing: This failure cannot be reproduced in the current test bench. Date Found: March 2010 Date Fixed: June 2010 Update information: Added the RTL code fix Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c | 13 ++++++++++++- include/linux/usb/chipidea.h | 5 ++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 1a1b889..97f937f 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -64,6 +64,7 @@ #include #include #include +#include #include "ci.h" #include "udc.h" @@ -412,7 +413,17 @@ static int ci_usb_phy_init(struct ci_hdrc *ci) */ void ci_platform_configure(struct ci_hdrc *ci) { - if (ci->platdata->flags & CI_HDRC_DISABLE_STREAMING) + bool is_device_mode, is_host_mode; + + is_device_mode = hw_read(ci, OP_USBMODE, USBMODE_CM) == USBMODE_CM_DC; + is_host_mode = hw_read(ci, OP_USBMODE, USBMODE_CM) == USBMODE_CM_HC; + + if (is_device_mode && + (ci->platdata->flags & CI_HDRC_DISABLE_DEVICE_STREAMING)) + hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS); + + if (is_host_mode && + (ci->platdata->flags & CI_HDRC_DISABLE_HOST_STREAMING)) hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS); if (ci->platdata->flags & CI_HDRC_FORCE_FULLSPEED) { diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index aa49177..034f7e1 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h @@ -19,8 +19,11 @@ struct ci_hdrc_platform_data { enum usb_phy_interface phy_mode; unsigned long flags; #define CI_HDRC_REGS_SHARED BIT(0) +#define CI_HDRC_DISABLE_DEVICE_STREAMING BIT(1) #define CI_HDRC_SUPPORTS_RUNTIME_PM BIT(2) -#define CI_HDRC_DISABLE_STREAMING BIT(3) +#define CI_HDRC_DISABLE_HOST_STREAMING BIT(3) +#define CI_HDRC_DISABLE_STREAMING (CI_HDRC_DISABLE_DEVICE_STREAMING | \ + CI_HDRC_DISABLE_HOST_STREAMING) /* * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1, * but otg is not supported (no register otgsc).