Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp603594pxj; Tue, 18 May 2021 10:04:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyj8GtPYtUS281ZWDM5X9oExVVaH/Oar45UsiTAWuNfuOKl12lqSLlRkZLmw+xDw1PaZbkz X-Received: by 2002:a05:6e02:1bce:: with SMTP id x14mr2081963ilv.287.1621357463346; Tue, 18 May 2021 10:04:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621357463; cv=none; d=google.com; s=arc-20160816; b=qmOLDurAIgJzUapSmGWu88dj5CGrj71hQgrih3te0ie6OT+vB+OYvQYX+xC6Gd9H4T yWd1lLhuWg+4QgHFJ187KiNtr4bGi6584rIZP3gaoUu/SJTtI7KQfxQElySniHRiKVbh 33vNbanFndbf1ZHm4doOt3rG7srzTiDqpNKsODX13c3kugFudBUSsP80y9lXiNSonRFF JD/RcuF/qpvCjPqr3ImU7uFJd/oW1wf4KUfIdSTNuqwEq31KNBkMMW75j3gO/DSzqnx8 W6u0IBrdesv7YhZkEjPPFaQAFZHOXBKRrxTXnBhuXlAd8wXDMHTqCWbEM3wXqJvNe1Hx Mhnw== 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=oFVVnjBrMhRz+Fthzjzk4loyTnm6Jioh+h4a4vl0n0E=; b=XO/PghArd4/QuS0flTwIpBvGubFFm6gH4JV/9z3mO5YNT/t6ibbWU66FHecxGUwjpQ vC/Tcg2uKX6eedUSau0jseCD+f/Jprotm9jH9Sjk24+OBqdgI13NI+idwBwIMCnFo3V/ vllLWPzWnwaqeRvVU89GUJwNBgyk46cYUgBcjYHMpMOQS8g36DTK/89wyblkvU1lxnKJ K37kRXZx2qMfwVQoDCiMTQRllV7iCjYoJ3D0RlfIPNIPRnerqmouANzjqPGX/2nN6s8T 9WWIUIhbYpRpyU0H5JeeRmV0d8Cs6XrE/t02l3S6H3vbRUD36R8UaYG/Wznfos2aRZHL Tr0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mThUfNtT; 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 j11si22551033ila.145.2021.05.18.10.03.47; Tue, 18 May 2021 10:04:23 -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=mThUfNtT; 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 S1344088AbhEQQI0 (ORCPT + 99 others); Mon, 17 May 2021 12:08:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:36652 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344757AbhEQPph (ORCPT ); Mon, 17 May 2021 11:45:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 52A776135B; Mon, 17 May 2021 14:43:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262633; bh=MBOQYnE2mOI5zp9tE0zlOseQc4zBVgAXWE1oPuGi4DU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mThUfNtTUf6MfeVdKKkqwW1iBRHzjp6KFMYvH4pt3fftyt7RF+m8wsjBmR2JzkJ9x OHw6azSgNZZWI/063GaArPunCUiFrqQWYSBcFZQ9cqtjRBC/X3o4J7N0XRvlq1xD08 eYHt7zH4RezTeNMQWF6qmISkZHr87DgAV9R01d1I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marcel Hamer Subject: [PATCH 5.10 240/289] usb: dwc3: omap: improve extcon initialization Date: Mon, 17 May 2021 16:02:45 +0200 Message-Id: <20210517140313.243962395@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@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 @@ -437,8 +437,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; }