From patchwork Tue Jul 2 11:17:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Herrenschmidt, Benjamin" X-Patchwork-Id: 11027689 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D8A8414C0 for ; Tue, 2 Jul 2019 11:17:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA39328889 for ; Tue, 2 Jul 2019 11:17:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE1DB288AE; Tue, 2 Jul 2019 11:17:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8919E28889 for ; Tue, 2 Jul 2019 11:17:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726305AbfGBLRx (ORCPT ); Tue, 2 Jul 2019 07:17:53 -0400 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:57131 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbfGBLRw (ORCPT ); Tue, 2 Jul 2019 07:17:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1562066272; x=1593602272; h=from:to:cc:subject:date:message-id:content-id: content-transfer-encoding:mime-version; bh=Wzh+87SNrNniE5cY+Yyj2+/o/B2FALZLIME/Qh4E8Cw=; b=Z6+J+I9kkWnf7kpf7dRWAMmmOqfQLoYtT3z5ovmJnchjFjowaBGVHuuT Mzq5WNIYVGB/GzwzUHIjffudpqrLkuODYN0TGxuB5/j2g2VFzlVb60MoL mmdZakJg+8KkYhDTwsqq+Nxut7XKp0T3Wv4MS6H+WwWt2NsGHSOWVPtYC 0=; X-IronPort-AV: E=Sophos;i="5.62,443,1554768000"; d="scan'208";a="808906684" Received: from sea3-co-svc-lb6-vlan3.sea.amazon.com (HELO email-inbound-relay-2a-6e2fc477.us-west-2.amazon.com) ([10.47.22.38]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 02 Jul 2019 11:17:48 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2a-6e2fc477.us-west-2.amazon.com (Postfix) with ESMTPS id 3D1A7A1E2D; Tue, 2 Jul 2019 11:17:48 +0000 (UTC) Received: from EX13D21UWB001.ant.amazon.com (10.43.161.108) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 2 Jul 2019 11:17:47 +0000 Received: from EX13D21UWB003.ant.amazon.com (10.43.161.212) by EX13D21UWB001.ant.amazon.com (10.43.161.108) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 2 Jul 2019 11:17:47 +0000 Received: from EX13D21UWB003.ant.amazon.com ([10.43.161.212]) by EX13D21UWB003.ant.amazon.com ([10.43.161.212]) with mapi id 15.00.1367.000; Tue, 2 Jul 2019 11:17:47 +0000 From: "Herrenschmidt, Benjamin" To: "linux-usb@vger.kernel.org" CC: "balbi@kernel.org" , "joel@jms.id.au" Subject: [PATCH 1/2] usb: gadget: aspeed: Don't set port enable change bit on reset Thread-Topic: [PATCH 1/2] usb: gadget: aspeed: Don't set port enable change bit on reset Thread-Index: AQHVMMfH4Yzjd51Wsk6frikY23zeEg== Date: Tue, 2 Jul 2019 11:17:47 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.43.161.197] Content-ID: MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This bit should be only set when the port enable goes down, for example, on errors. Not when it gets set after a port reset. MacOS seems sensitive to this and fails enumeration. Signed-off-by: Benjamin Herrenschmidt --- drivers/usb/gadget/udc/aspeed-vhub/hub.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/aspeed-vhub/hub.c b/drivers/usb/gadget/udc/aspeed-vhub/hub.c index 7c040f56100e..0755115fd90d 100644 --- a/drivers/usb/gadget/udc/aspeed-vhub/hub.c +++ b/drivers/usb/gadget/udc/aspeed-vhub/hub.c @@ -449,8 +449,15 @@ static void ast_vhub_change_port_stat(struct ast_vhub *vhub, USB_PORT_STAT_C_OVERCURRENT | USB_PORT_STAT_C_RESET | USB_PORT_STAT_C_L1; - p->change |= chg; + /* + * We only set USB_PORT_STAT_C_ENABLE if we are disabling + * the port as per USB spec, otherwise MacOS gets upset + */ + if (p->status & USB_PORT_STAT_ENABLE) + chg &= ~USB_PORT_STAT_C_ENABLE; + + p->change = chg; ast_vhub_update_hub_ep1(vhub, port); } }