Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp382678pxj; Thu, 20 May 2021 11:30:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ0ALnG1vb7POpFq5khN2Yh7IcMLWMmipAqDzQNIpIsyY3bQHStywWZt56PWH8A4NTNsQK X-Received: by 2002:a05:6402:42cd:: with SMTP id i13mr6396228edc.34.1621535442174; Thu, 20 May 2021 11:30:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621535442; cv=none; d=google.com; s=arc-20160816; b=wr1H4PxlzmEzJc9CNO/ghmRXigK6tXzdzQDhzgRaqAG4mLVV+Dqj6h+6ZMXvq9AGr0 iKmE6Mc7uHZ4BRDIfFVS0o5eyxn5JOZsZEBNsxrxuuUCeEqfyHWMLdyC+ROOKgWfHC8q eOFYt7Mie7nwemCCIN6xjQp9Z7L42pe90T54Q5ETcHPMyrnWDViUPJZMAMGuT58IPf/m IiviPUWCfPvi0827V095R2eDaA1Q222DPaPl713QqfUX2PsodZ+ANazFjLcx8QXN+I54 RcSvBsh8ZW8PDqP9VkYZEzC1nOyfj1GlBsxjoSqKdespye3ua5C78U/VoiCvzLyJ8uTe ifzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xeKMtcZeZZztFXCkrAyOu9cMwhomDh0PnDmYwavRKZE=; b=xmgPfi8AUI55qFwgoYek4kVEkrsOTXQmJ47UUStTalCqzjoAtuJ28buxMOt7VYgxWV oSfIXFb2GYGX5d6pcHAIbSAAxfOq0uKsdhs9ZRRestIKKSQh6f5+7c3zFdjJyuTPV5K1 205/h5DZ4RLsSJ91fPNOjKWNWYsjEJEMUK1iowb6Do6Fpm7GapCOWzcQDqH7gO6kawn0 vkx9URFLF0p/lHurSTHMHXgdiiYajFM8F0Z9/7BqAwJF/9Z7TSpbamKr9994iD51Spnr bx/LQ7Iw/6T+zsBo/r54agdBOMlUzEOci2+bMYnndOOaHu4lBEIlT8JC8U9/Xxz2mVEl Hlsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OYh5fhzf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b8si3129390edd.8.2021.05.20.11.30.18; Thu, 20 May 2021 11:30:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OYh5fhzf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235438AbhETKTO (ORCPT + 99 others); Thu, 20 May 2021 06:19:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:44532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235915AbhETKJz (ORCPT ); Thu, 20 May 2021 06:09:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2789B613E5; Thu, 20 May 2021 09:42:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503771; bh=9V1luIm3k87Q1BjTKeRYCHMIMXZBYAg12mLF1VVXX90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OYh5fhzfGoxpnfNkFAuWE+fdfimgdaxRDAkNkVaZmwmp4/Y2cRCRtZ066vRMLRfxS QuVXGHG5vxWF1sjnWmnWi9lZ00HCICIkAsXOFAyh83CT/o0gU12I0tLxmgtHlfDPTx eL7iMUONR7zcGee2q3MvEaLR5OVWDVR7kbmCkNBc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marcel Hamer Subject: [PATCH 4.19 373/425] usb: dwc3: omap: improve extcon initialization Date: Thu, 20 May 2021 11:22:22 +0200 Message-Id: <20210520092143.658037631@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marcel Hamer commit e17b02d4970913233d543c79c9c66e72cac05bdd upstream. When extcon is used in combination with dwc3, it is assumed that the dwc3 registers are untouched and as such are only configured if VBUS is valid or ID is tied to ground. In case VBUS is not valid or ID is floating, the registers are not configured as such during driver initialization, causing a wrong default state during boot. If the registers are not in a default state, because they are for instance touched by a boot loader, this can cause for a kernel error. Signed-off-by: Marcel Hamer Link: https://lore.kernel.org/r/20210427122118.1948340-1-marcel@solidxs.se Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/dwc3-omap.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -432,8 +432,13 @@ static int dwc3_omap_extcon_register(str if (extcon_get_state(edev, EXTCON_USB) == true) dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_VALID); + else + dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_OFF); + if (extcon_get_state(edev, EXTCON_USB_HOST) == true) dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_GROUND); + else + dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_FLOAT); omap->edev = edev; }