From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04950C6379F for ; Mon, 20 Feb 2023 18:59:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232852AbjBTS73 (ORCPT ); Mon, 20 Feb 2023 13:59:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232712AbjBTS72 (ORCPT ); Mon, 20 Feb 2023 13:59:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AD251E29E; Mon, 20 Feb 2023 10:58:46 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0E764B80D64; Mon, 20 Feb 2023 18:58:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60D95C433D2; Mon, 20 Feb 2023 18:58:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1676919485; bh=t2FqwC4mnO9KNhIzOvwByC9aDVWOv6PC8suPlTmE4k4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vVbSD2Fn2WpfIOm2dnc8oZ8Psd0XhzG3xPHJk4nZAICje4S/bu5KnvT2hUMNB0kYa IcVVYEpMnUEp9+lxqZgTmLjAZWcaabegO8jRUSc+IT1W63HZ+/+iqZuDmAIP2eFNYd V/6czxDvu2QEqUS/v5644nrZp5XnrTJMHKbsD8Pg= Date: Mon, 20 Feb 2023 19:58:03 +0100 From: Greg KH To: hzy Cc: hminas@synopsys.com, fabrice.gasnier@foss.st.com, amelie.delaunay@foss.st.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: dwc2: drd: fix inconsistent mode if role-switch-default-mode="host" Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 21, 2023 at 02:05:35AM +0800, hzy wrote: > Some boards might use USB-A female connector for USB ports, however, > the port could be connected to a dual-mode USB controller, making it > also behaves as a peripheral device if male-to-male cable is connected. > > In this case, the dts looks like this: > > &usb0 { > status = "okay"; > dr_mode = "otg"; > usb-role-switch; > role-switch-default-mode = "host"; > }; > > After boot, dwc2_ovr_init() sets GOTGCTL to GOTGCTL_AVALOVAL and call > dwc2_force_mode() with parameter host=false, which causes inconsistent > mode - The hardware is in peripheral mode while the kernel status is > in host mode. > > What we can do now is to call dwc2_drd_role_sw_set() to switch to > device mode, and everything should work just fine now, even switching > back to none(default) mode afterwards. > > Fixes: e14acb876985 ("usb: dwc2: drd: add role-switch-default-node support") > Signed-off-by: hzy Signed-off-by does not match your "From:" line of your patch :( Please fix up and use the correct name here as our documentation asks for. thanks, greg k-h