Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp33931pxj; Thu, 20 May 2021 03:59:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/9vYdl3ZhSIdvHcBsLABrhJS1V6LDkHqyFFNWkN7eF8CUUyzzoVkSc73zCVgy59ZRZEZS X-Received: by 2002:a05:6402:128f:: with SMTP id w15mr4452103edv.354.1621508383533; Thu, 20 May 2021 03:59:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621508383; cv=none; d=google.com; s=arc-20160816; b=GU56n0olqo7foJrGsslZt1bo4AoK514+wIUnCRoV82DwNVSkkgm7iItSCCw/yD0iib 7/VE8SGLvLDJA7hwBW/CHXtZg15m5fnuYTC9eaee5qdyd1Mz3ff3AogV/srH1++Qwdy1 QLY95iRni66CjYU6i86PA+DRskc1leJdY8cQBtCU/XBNR3JxdLpH0gH6Clakj9Fj0I+S SE6B9VwsQlJO9He73bAW/ynDaRsNTFqHdp4DmxinukLtVlrnZ4BlkULbfaNIPsK8lQ+P jLWEYUuWMBgXLLokmLC25bmRg9kulJJ8+3AXAGRY2n+kIwKSVmZ3HNm35yEOgxBcT2nQ qmDA== 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=ktRImhBjDRc7r/V0xcI1kKkrw1M5n7Klsnd6OXodTIc=; b=Co5cbIBfOwU4Z/db/sQ+5KsVRprw3rj+oLpM8J6nFJnc+sgET467bi3PtykvKkOGYQ MWYsCdtPMF8EBNIqheJeH168iFCjOcwkHWNnQ1063JLmkozPXbyXlxZ4WGHLMfaOPW5x R4vHyz/3NsKOw0KHBthZsu/JrWF21F+IWZW9E3zcBVcG8BmCydnB9g7b7aOg8WbHtbbG 6LRYAKWXzQ7zcDJrN+b7SwpsF7DLql7aQI6aJcYrFyhU6iw0e/0cw2a2maJ1sWwKm/Rf gdue85AyXBG4orOUd1heZ0vZV8qJXxJLFVyN+fYZGenh9bY59e4A5hVO0ZYk5WBBPH5Q b3Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vitaxhoW; 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 p5si2239325edt.116.2021.05.20.03.59.08; Thu, 20 May 2021 03:59:43 -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=vitaxhoW; 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 S238741AbhETKzU (ORCPT + 99 others); Thu, 20 May 2021 06:55:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:40014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238322AbhETKjp (ORCPT ); Thu, 20 May 2021 06:39:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2CE1D613E2; Thu, 20 May 2021 09:55:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504525; bh=1rV6bTo8+MSqkosykBa/BVfO+1KSswGChwij4PbyuI0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vitaxhoWSpNsWXHGeGJGP7eUmmLur+1P1i/7+0c06AwJ79VifG/l+VRYL7SPWJ69e 7JRjOUn2bgqfDcoSdGNh6iGJWwG4/jsjGcevycJ9NrEE5Hk5cqigbFDhAqP3GIbTdP rleeGesCQg4qX32DTRcOTKkzFwGRgCNP1sADc9UQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marcel Hamer Subject: [PATCH 4.14 286/323] usb: dwc3: omap: improve extcon initialization Date: Thu, 20 May 2021 11:22:58 +0200 Message-Id: <20210520092130.022895967@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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 @@ -440,8 +440,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; }