Received: by 10.192.165.148 with SMTP id m20csp2535226imm; Sun, 22 Apr 2018 09:03:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx49lbIjr4XeZQzL5yiShMYHqKZJMQuQxsOgyX5nOxh8iCo0U3YA7SF57H7wb6zoKsthvTuc1 X-Received: by 10.101.96.205 with SMTP id r13mr3029065pgv.22.1524413013916; Sun, 22 Apr 2018 09:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524413013; cv=none; d=google.com; s=arc-20160816; b=zvYlhVagtFj1ZncOO5EriankT6NmA31kKW8oCT5N4IhkVj8y98kUpvVsrHTLHA9FWA wTo+ktejMTRJZDwrTKfAMbv8N3UEW1vTHQXBDAlCI6uiwgYIgaiS0ltwJ/6wHRb/+ppz CV1xcoD0D7XkhXVyJS9gNVnrGChW7li0FDVuWyRDBj2EXQAJ6I4sFbOabtua5luSJl1s l7EPPJ1MZlj7XXs+m9BL1bBi75o5GMQ9EQaC/5bfEKB+P9FW0YBOa49XkGEXEYicThQI TH7iN+2gRNr9BI1NJ1kbCXa/QkK17hBxDHmLMxsUVdg/+n90YRDEafbR+KpvBScpiafs KLyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=THwanSNOX8vsaN52sCQ3OJUhZ8iv/+SjORYG7eLXLOo=; b=d4AzRFRht6M9zYwfySrH8Lxkq+i4hMmnzh58ZOIgtqREvKy3f1tCMe0f4lVcJo88Ap +xodh4viL4Yz4b8zmarPvil230nzqZpv+XDbr6M36sO79uRyYsgFCkhyzk71qTJGz/vh oNFkOKW9lo68T1SAdzqCSnbzw1xUKh69sKEWKTfFk0zClxccL9gNopGDdSoSMmxUy2Xv lOWBy773NuGpFWDnkhY4/Jgmw6UNvPBXTeYadgxnNNy/rCi6wHIEsMKGcVzh2ZxjLeJI 3uioiLrgIHpPoLrTY/oY/ts08xE9+zEgZ8p5ZrYaLpqa3x3ae6GO8YO5kPjDZvn1/ih6 z/Zg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l5-v6si4387304pli.409.2018.04.22.09.03.19; Sun, 22 Apr 2018 09:03:33 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754235AbeDVQCM (ORCPT + 99 others); Sun, 22 Apr 2018 12:02:12 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46164 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753829AbeDVN6S (ORCPT ); Sun, 22 Apr 2018 09:58:18 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C76A5CD8; Sun, 22 Apr 2018 13:58:16 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Roger Quadros , Felipe Balbi Subject: [PATCH 4.16 042/196] usb: dwc3: prevent setting PRTCAP to OTG from debugfs Date: Sun, 22 Apr 2018 15:51:02 +0200 Message-Id: <20180422135106.250936337@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Roger Quadros commit daaecc6541d014dca073473ec8a4120c0babbeb4 upstream. We don't support PRTCAP == OTG yet, so prevent user from setting it via debugfs. Fixes: 41ce1456e1db ("usb: dwc3: core: make dwc3_set_mode() work properly") Cc: # v4.12+ Signed-off-by: Roger Quadros Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/core.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -119,6 +119,9 @@ static void __dwc3_set_mode(struct work_ if (dwc->dr_mode != USB_DR_MODE_OTG) return; + if (dwc->desired_dr_role == DWC3_GCTL_PRTCAP_OTG) + return; + switch (dwc->current_dr_role) { case DWC3_GCTL_PRTCAP_HOST: dwc3_host_exit(dwc);