Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp151536pxj; Mon, 17 May 2021 23:39:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF0dBgt8A8/kzT1RdkTwisS2M1/BLpAfk8o5NnSDCSq7axTrl0Z1f6Sbo7zGStieVno2l4 X-Received: by 2002:a5e:a604:: with SMTP id q4mr3207825ioi.178.1621319977885; Mon, 17 May 2021 23:39:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621319977; cv=none; d=google.com; s=arc-20160816; b=ZCgWuB/geQkhA7Xwz39o5crLRhsTwUlEZuqOWn8nMcvizZwgeHixpubNRZYa8UnX3x W7JEa8aeYt5TKYan09Kc32QBTtoz0PZ4tEbuTeo5NxjXdbKNUpRW9WYvYPYOTyXzj7wL nyaNj4vrcMA198Kehn+mLQHFBTHApXF6/DRJ072N8jdCRD1NIUGlUQpGx1eu9db+icZ1 z1WqW0nMIz1vmzzW+YrOY+dy+JbRPKMIYukNuCAu+47h//zCyQBV+pD8zBmG62kQ3UjU f+koitWUxYPu7OTRaYgAekI50V/hEBIrMm5fcPfLjInH381R0qF1bmIcG2iq3PilN/zb nkJw== 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=hM1wyPOQUjpOxlqrCs3Q2+nVTX4pLxq9qDi+/C4E3N0fez8JfIbv6of58Cn9XWnNhk UFSkWOoOnGe3pYtWBk8b4QJX83W5vLJ5p1p5mCcEZOLfRoK8GheVz7YrkHwO3gFV3+Su db1yLva0KnPFpQYMfgcavgGri/J24pXAeWBDNkxS+xXTuS19TT/YPZKPsAdEmWw8ydhQ hT6ZX/owmxYUAb2vxGqYJ8rdOckGMBsYYGXBbzLB0BHg7+rsU6KudMki3+Dsv+e0TWqQ 82XhmwAGM7lc+7q00dIJmXL6ZdlIEKFbwlVj+G5mmgwu3yz8BJ5Dm/DhIVAzRVHXYxAI mcZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ed2Usc/R"; 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 v3si21229808jas.76.2021.05.17.23.39.13; Mon, 17 May 2021 23:39:37 -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="ed2Usc/R"; 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 S241383AbhEQOuz (ORCPT + 99 others); Mon, 17 May 2021 10:50:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:54268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240496AbhEQOnY (ORCPT ); Mon, 17 May 2021 10:43:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DCCDC613AE; Mon, 17 May 2021 14:19:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261190; bh=MBOQYnE2mOI5zp9tE0zlOseQc4zBVgAXWE1oPuGi4DU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ed2Usc/R4V06SdWH6Ei+zd9KZO6sRVAKpgccybShGZFfumTPYKuagwwBBRcTu1fh4 0e7+jKc12ozkNhNQhb7OdeL+xTZDjPN1kYV09GPW+ZWg4AixosrpUFF9HIUlapxsio 80VFBxJgRab++jLizZzk/V3ZJa8ahRVLXR03/JUY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marcel Hamer Subject: [PATCH 5.12 308/363] usb: dwc3: omap: improve extcon initialization Date: Mon, 17 May 2021 16:02:54 +0200 Message-Id: <20210517140313.011165535@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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; }