Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2487174ybt; Fri, 3 Jul 2020 10:11:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4sLFMYFSe1lsptO7nZecLUBBQveYm0pw3MnHIQGLkG+iCXXF/6xpUg4FJjZVPvlNgcn9d X-Received: by 2002:a17:906:a1cc:: with SMTP id bx12mr31983771ejb.461.1593796286198; Fri, 03 Jul 2020 10:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593796286; cv=none; d=google.com; s=arc-20160816; b=B1u2fVokrPZAwhxIc81Utl4YWB6Taq2VOtyLNpvZ0+X2J08FZ4/QgBzCB4JRADdzAa PLtkpcTQ0CYahRskHyFfj/anmK2gH7KiFlBpjGi9+fLaT+ubCuumfuTxYhT8UhldfMFq OzAENlfDkc6ZoCHEcfFEY5dqkztzvYYpeBvawCUjOihku75PCTezA8oh3LSulyBGwyPy iecu3YqH11EE6xKu4tBj8DkwbNCjaSXVjz+JwdM4Zls7MTScwer8jY/uT5Fbn6Ly2EVZ MWnPKE/WxUDruhK5oTPuq3nAnXUxtnVnsX9R564smJPRyhDQk3jMSlR4pPGFSj9WN1nX iiRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=zz3K3ncG4SZXiqV60Pl0wm2eVrkflMLNF5/N6RBRxbM=; b=a+hX1H1k5ntX5hifl3qSG0OSfutGe1DRuI8G8iIWAoqS58C3StDf8JMdoxWC8djT71 97N6POczmGWH1YtFVO3/VmVWLYRuqAzwUJhBT2dUQt13ezKrMI7A1hkQlocpe/jy9w4m /xbu8ull5veXc3YdlBtSHOrR17LbKxVjDiCDy2I344bIBcCmc99YljcWTEn43BGhMRTl 8ZiT96GwkkBqnpB5IE2fjbiJUfHrfvBXzlojL8uASe9B6EVolv0wyKQLgj0PT0d4A9BU kohN5xkGRZtGvuU3+7E50LThwOBKnU3luJt7QtwEOzLbtyASYDoVXf2I15WEyWPZEtNW 3OKw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p7si8136446ejc.96.2020.07.03.10.11.03; Fri, 03 Jul 2020 10:11:26 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726806AbgGCRI5 (ORCPT + 99 others); Fri, 3 Jul 2020 13:08:57 -0400 Received: from foss.arm.com ([217.140.110.172]:53300 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726616AbgGCRI4 (ORCPT ); Fri, 3 Jul 2020 13:08:56 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0883431B; Fri, 3 Jul 2020 10:08:56 -0700 (PDT) Received: from [10.57.21.32] (unknown [10.57.21.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E8FBA3F73C; Fri, 3 Jul 2020 10:08:53 -0700 (PDT) Subject: Re: [PATCH] usb: host: ohci-platform: Disable ohci for rk3288 To: Jagan Teki Cc: Alan Stern , Greg Kroah-Hartman , Heiko Stuebner , Rob Herring , =?UTF-8?Q?Myl=c3=a8ne_Josserand?= , linux-usb@vger.kernel.org, linux-kernel , "open list:ARM/Rockchip SoC..." , Suniel Mahesh , William Wu , Michael Trimarchi , linux-amarula , Kever Yang References: <20200702090504.36670-1-jagan@amarulasolutions.com> From: Robin Murphy Message-ID: Date: Fri, 3 Jul 2020 18:08:52 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-07-03 12:39, Jagan Teki wrote: > On Thu, Jul 2, 2020 at 8:08 PM Robin Murphy wrote: >> >> On 2020-07-02 10:05, Jagan Teki wrote: >>> rk3288 has usb host0 ohci controller but doesn't actually work >>> on real hardware but it works with new revision chip rk3288w. >>> >>> So, disable ohci for rk3288. >>> >>> For rk3288w chips the compatible update code is handled by bootloader. >>> >>> Cc: William Wu >>> Signed-off-by: Jagan Teki >>> --- >>> Note: >>> - U-Boot patch for compatible update >>> https://patchwork.ozlabs.org/project/uboot/patch/20200702084820.35942-1-jagan@amarulasolutions.com/ >>> >>> drivers/usb/host/ohci-platform.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c >>> index 7addfc2cbadc..24655ed6a7e0 100644 >>> --- a/drivers/usb/host/ohci-platform.c >>> +++ b/drivers/usb/host/ohci-platform.c >>> @@ -96,7 +96,7 @@ static int ohci_platform_probe(struct platform_device *dev) >>> struct ohci_hcd *ohci; >>> int err, irq, clk = 0; >>> >>> - if (usb_disabled()) >>> + if (usb_disabled() || of_machine_is_compatible("rockchip,rk3288")) >> >> This seems unnecessary to me - if we've even started probing a driver >> for a broken piece of hardware to the point that we need magic checks to >> bail out again, then something is already fundamentally wrong. >> >> Old boards only sold with the original SoC variant have no reason to >> enable the OHCI (since it never worked originally), thus will never >> execute this check. >> >> New boards designed around the W variant to make use of the OHCI can >> freely enable it either way. >> >> The only relative-edge-case where it might matter is older board designs >> still in production which have shipped with both SoC variants. Enabling >> OHCI can't be *necessary* given that it's still broken on a lot of >> deployed boards, so at best it must be an opportunistic nice-to-have. >> Since we're already having to rely on the bootloader to patch up the >> devicetree for other low-level differences in this case, it should be >> part of that responsibility for it to only enable the OHCI on the >> appropriate SoC variant too. Statically enabling it in the DTS for a >> board where it may well not work is just bad. > > You mean enable OHCI by identifying revision W with dts status "okay"? > doesn't it complex for the bootloader to update all effecting changes? Well, on boards which may have either SoC it's already got to detect the difference and make at least a couple of other DT adjustments; a handful more lines to check for a specific node and flip its status wouldn't be too horrendous (although I suppose you'd also want to check whether the EHCI is enabled first, to guess at whether the port's even wired up at all). Or alternatively, as I said, simply don't bother doing anything - boards that only use RK3288W can enable OHCI in their DTS, and other boards that have been not using it for however many years can continue not using it even if it might technically be available on newer production runs. Robin.