Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp830644imw; Mon, 4 Jul 2022 21:46:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uS8SGZV3xyj6OlUkMYhTiQpvhh7aFybzKO/v8j8dFnD5imwACyKlCIucpVFBSUm4uzrNrQ X-Received: by 2002:a63:4343:0:b0:411:e30c:fad8 with SMTP id q64-20020a634343000000b00411e30cfad8mr18149111pga.278.1656996399563; Mon, 04 Jul 2022 21:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656996399; cv=none; d=google.com; s=arc-20160816; b=IWTdr/0WGV5XbzoJYoEZKsThXN0Cf4UHaI0yWc+3YYMI0KD5PQ9kj9vaw6UkVwwuTT dcIoysGUvUY01KLQIxpte8y3c0Gko2lFb7REOe6mQs8dXdch4rIdBrERY67K5zO7jLzR 7ncTRyCYVmwyYz6erAPTckNwvmWVZ+WeGlu1iaXJQtf9hxRVeCY8gI2bZpvcbi/VB9Lf AjNlBP166qKW9fDAi+FLLK+DwS2rZtY9bgkJ30QxPtHAUkYGJ4NHv8QjZcKKbEenZGdE ry5t08SNITuqw0tM6rzxRFkknQX8LRLWHEcvtlGruSYTVjhygi6QgjfKj5YwHVmUmLHA fnbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:feedback-id:dkim-signature:dkim-signature; bh=qhjLmKoG8hTiptIGjmMn/wFrRLHB9qodKyUm0n1oZog=; b=IxBFEANdhdDpNLrTlBh2CP2kIZPk3kH174dPnq9ve8tD1NDm2K7Usm9SouoveE5X7s tJZemArOInK4HCbr1JHnKttSlT91TNkXhVXhM0x1r+obVhGKIIvETjCWMo4ouora7Qjr 6/zHZsdT1KTPLqYY/lcmynnyMUaoLn4dIixHGnDiL2biSOJrFJplcg0kha1Wj+0PKa/O MQdPMpQHmLfUH0Y+dcBQIyMZRgpD5v2NVsfLpiVrh+DBVdI31QCZt+s4LFLtFU3hgacR nKNBbWLrHuyBMz3qKqIdLlG2dLEhmgdKsBmd1Wm2RzNgAkKA24b9lvSgYWtZr+xTcqb0 AyDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=SPz2MI7Z; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=uaszrMyt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020a170902c40d00b0016a417b06c9si12817339plk.591.2022.07.04.21.46.28; Mon, 04 Jul 2022 21:46:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=SPz2MI7Z; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=uaszrMyt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234350AbiGEEFh (ORCPT + 99 others); Tue, 5 Jul 2022 00:05:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230004AbiGEEFf (ORCPT ); Tue, 5 Jul 2022 00:05:35 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B74BB13CD6; Mon, 4 Jul 2022 21:05:34 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id EB76C5C007A; Tue, 5 Jul 2022 00:05:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 05 Jul 2022 00:05:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1656993933; x= 1657080333; bh=qhjLmKoG8hTiptIGjmMn/wFrRLHB9qodKyUm0n1oZog=; b=S Pz2MI7ZjHtpd4TStxeQDoUcITpTFrMRN3QFNZrPFZLrGJYwCHnbqe6WsoqVXJ8/o +iIEf92Dkuk8TqOkvZ29UcYYn+QDyxXyHgLZMorkveEdAttq94asK8zboUQCsSNJ /uNBgl3MkZYckqDtMbXUMc8edQmGqjnhbyqZt8CVp8lJ47fX3fP+xavBGm4znTcY r3lPGYfcKgIRr92NK5pzfGIZIr/G9iTGcijyAb5hrPiV1SzvCfkwSWSg/MlXBVaI AxGLsbZLcog3tQ1thyqzJMZ+J1mQjcQ3yFrYUnJ/dPfdjT1ZPR9Pbv5kzSbTa9BU lFPFuvW2mGp809QkBIIcQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1656993933; x= 1657080333; bh=qhjLmKoG8hTiptIGjmMn/wFrRLHB9qodKyUm0n1oZog=; b=u aszrMytuhV3J9vLkPVQExTkpZuD81j8LSEaxUjLuuHGcBgrodPNtH/qKgbPxERm/ deaTB3QziIXKEgOzxDjZ4mRHYjbU5jlghE2hUyniRUPCwyuBtNyM4awqR4I/Llwa HCoLzqapI4GRQgqJ4DhNhF+l/Bt7KXvpXrhr1paMj3apP4fQzEndjCeZOAIFIDlj jDJ/grkaEz9f4BAKkGD+WNTQ8aEXZdKl4b0uIQbomt+1pLdXrkoNXT6Qatxx0noV 4vX0yufnBrJz4nS9I4I0cpc3jg4aAoaywIVGPsC3/VTOrIXgAGUmoKQPgcr/UvF0 vALLrcdQgW8/stYzdnMiw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeitddgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvvehfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpefurghm uhgvlhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenuc ggtffrrghtthgvrhhnpedtvddvudelveeuleegveduiefggeegheffgefhjeduhfeigfei vedthfduleegueenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhl rghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Jul 2022 00:05:32 -0400 (EDT) Subject: Re: [PATCH v4 0/2] ARM: sun8i-r40: Enable usb otg support To: Evgeny Boger , qianfan Cc: andre.przywara@arm.com, devicetree@vger.kernel.org, jernej.skrabec@gmail.com, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, robh+dt@kernel.org, wens@csie.org References: <264cb004-677a-13df-cc68-676ef3c2e7d8@163.com> <0936de49-a349-8fd4-2598-2a8995b01c86@163.com> <21a659db-f64c-fbea-b3e7-ccc27aec29a0@wirenboard.com> From: Samuel Holland Message-ID: Date: Mon, 4 Jul 2022 23:05:32 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <21a659db-f64c-fbea-b3e7-ccc27aec29a0@wirenboard.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Evgeny, Qianfan, On 5/21/22 6:10 AM, Evgeny Boger wrote: > my point is not that your patch is good enough. > > My point is that it would be very difficult to maintain backward compatibility > with this device tree once proper driver support is implemented. Any solution to the problems below will have to maintain backward compatibility with the current bindings anyway, for all of the other SoCs that are affected. It is no more difficult to apply that same solution to R40. So I do not see a benefit to delaying this series. > On 5/21/22 07:26, qianfan wrote: >> >> >> 在 2022/5/20 4:54, Evgeny Boger 写道: >>> Hi qianfan, >>> >>> As Allwinner A40i user, let me first thank you for your effort for making >>> better upstream support for R40! >>> >>> However, I would strongly suggest *not* to add USB support to one more >>> Allwinner SoC in this particular way. >>> The problem is, this approach consists of a number of carefully crafted hacks >>> in device tree to make current drivers work on Allwinner hardware without >>> modification to the drivers. >>> >>> a few examples: >>> >>> 1) please notice how ohci0 and ehci0 nodes do not contain reference to usb >>> phy. It is done intentionally, otherwise EHCI will reset musb mode. >>> Of course omitting phy reference here is also completely breaking power >>> cycling in case of usb error and otherwise messes with a power management. >>> >>> 2) one must always enable ohci, ehci and usb_otg nodes at the same time. If >>> one forgets to enable ohci/ehci nodes while enabling usb_otg node, the system >>> will silently fail to work as USB host. >>> >>> 3) For host-only mode we still have to enable usb_otg node despite no role >>> switching is needed. That's because phy reference is missing in ehci/ohci, so >>> the ehci/ohci driver won't enable the PHY. >>> Also I might be wrong, but I think phy won't be routed to ehci/ohci >>> controllers is this case. >>> >>> 4) musb host controller is initialized and present to hardware though never >>> actually used >>> >>> To summarize, not only the resulting device tree is not describing the >>> hardware properly, it is creating device tree configuration which will be >>> very hard to support in future, once proper driver support is in place. All of these issues can be fixed either with no DT changes, or with only backward-compatible changes like adding PHY references. >> PHY setting is did in MUSB driver, so we need enable MUSB regardless of host >> mode. >> >> I know your's point, OHCI/EHCI need do more works to init USBPHY, it shoule be >> able to work >> in dependently, but I don't have the ability to deal with these things right >> now, I need >> learn more things about OHCI/EHCI, that's a long-term goal. >> >> So now I need to make the whole usb work and do some tests as much as possible, >> hoping to merge this patch into master. Some other optimizations can be made >> later. I am fine with merging this series, with the existing binding, and without increasing the scope of the changes. It is still an improvement over the current situation. Regards, Samuel >> Thanks for yours guide. >>> >>> >>> At Wiren Board kernel tree we tried to untangle this issue [1-6]. >>> Unfortunately I didn't have time to prepare it for kernel submission yet, but >>> I think I better submit it as RFC to get a feedback from you and others. >>> >>> >>> [1] >>> https://github.com/wirenboard/linux/commit/359abbbd86ddff4d3c61179c882c286de32bb089 >>> >>> [2] >>> https://github.com/wirenboard/linux/commit/6327f9d7972c21b229fb83457fdde643b31553f9 >>> >>> [3] >>> https://github.com/wirenboard/linux/commit/f01f4c66758bde460a4d8c5b54ecee3b585c0232 >>> >>> [4] >>> https://github.com/wirenboard/linux/commit/c27598ad601e5a46f624b73412a531d6f1f63d37 >>> >>> [5] >>> https://github.com/wirenboard/linux/commit/5796d6eebb86b32a3751b2038b63af46f94954b3 >>> >>> [6] >>> https://github.com/wirenboard/linux/commit/0928a675d875f9c2849fd3a9888f718bbb673bda >>> >>> >>> >> > >