| Message ID | 20200702090504.36670-1-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBZGG633QKGQEBDCKPBY@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4C1D33F03F for <linux-amarula@patchwork.amarulasolutions.com>; Thu, 2 Jul 2020 11:05:42 +0200 (CEST) Received: by mail-io1-f71.google.com with SMTP id g11sf16598262ioc.20 for <linux-amarula@patchwork.amarulasolutions.com>; Thu, 02 Jul 2020 02:05:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1593680741; cv=pass; d=google.com; s=arc-20160816; b=JGX6jDaPmp5or3vjOUZeh+W8v03a6CczGJkRV7iLxJtZx1xuXIkh+iVFEmocJC0Wg0 5d1jHmNBkN2G+DuW7rISmIm6gk4iTLzyb1DyX78V0EEL1e6WKFOYHqrUuPTs3rDbqPmG YwCOXtxxRHg2Xw+L6CuRy4E4LBz+4Dd6yL9fe5qsy+NPyYsp5/z4oXrCbVw5l97x/geQ VOuGkHR3D2oH+obbwl7QcrifNNZMenzqH4ReZuYkYF9jgxRq2ewAy862Cfjd0Y4T+MI7 pjuOfEagIbuZrKkLhFXze7q9sqIlAlHwMMVkS8en0vKDhbEBQTI6hEpjvlrVhb2BL8VY o5uQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=Bla9StzBhQVTSAcAqb7uhI1ebIQIcuQsH6vl202Ca+A=; b=WHJMKMe+dGa0njl6D070yqe+D1xxM5V5MLBB7dgO3JqugzxiCN2Nhs80hIJVswn/2S d8vcTt+OtH+E7Yc2W4xFj1o/Ru/nYkWo1CaS9jc80QC9+N5b8o2XBu8tsWV6uYk8OSxQ x2DMzJC/1Yu4Q4X3oMTOEnvutmxJW1bGhUfVl2a8av8A5Q+dDUmAiQ4tVg/MqObWbLpL wYd+GfXx1uil3ZDrp6ug2hF3HuAT0je+Cti6CYpH/HhtsPG8juVpDNHWPv+/T17k7Hpt 9t28EY97xMsM3mdxAfkEXi5DNQzymPpBFbkZVmRFceR7qvI+fGpyO2+QcsTV55z0E2dN IwFQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=cCSDX1z1; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Bla9StzBhQVTSAcAqb7uhI1ebIQIcuQsH6vl202Ca+A=; b=fW6M8z7jm9lwnneIQv4fz2DdghVjdYj/Jh6dn1/p7YYj+wqxLeEs6nLJXe1t3n0oqp PYIZVbis7VD2l+y0d3Rywg2nH1ha7gtq7LnpggD/8JyPQR+sbR4NMTRy2AsYLTTD+/D5 EFqCPt66FmM8j+exfkSKsUYFXfp7EKKyEmQAc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=Bla9StzBhQVTSAcAqb7uhI1ebIQIcuQsH6vl202Ca+A=; b=lA8hOiyY5UBqvGHiu8SVZG/8yPJLr7VoFZqwN5axStfFSgx1ijgun/rzIMH2tpqw4i SfFCdBRRtEhOEEFBYPhhkaXse80/1fSXOsTRNVNVEEOQ8j2VlRlG+5Tlvib3W2iuf6c3 Z9Or/AnoFjNxbaqjvNT/coAPQTZ/XLFB6n3blu9o3q84wqc2lOLSSgHEtnB8rOqs1f2w a4jYqXmU5Lth4rIkNMvKL2Sv1rntQvxrQhByE6ts1IJJ71SdupAUPsekA9JmtuVAhZqA m6YU3nhGt3uvF3Str0OubabmYPpRlVpK+zavOv1LWLXHSuHy/H+zpExWRrvpa3DVlinq x8JA== X-Gm-Message-State: AOAM532MWwmLda9fsE+4ZZuoR5jknRIFWpDzwhR4MAaeC9Qqsyh3NZtc +PClvVKYpo91Fp5QbSA5XjiCidG2 X-Google-Smtp-Source: ABdhPJwPvCQyE5ehF/kQ12/ybeh1E+fuN3rHZtWomwaIQtDuEukNrkqEWIw3qcxpnVNGzRVX4Sw8TA== X-Received: by 2002:a92:ca8d:: with SMTP id t13mr11195265ilo.274.1593680740653; Thu, 02 Jul 2020 02:05:40 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6e02:1082:: with SMTP id r2ls1096372ilj.8.gmail; Thu, 02 Jul 2020 02:05:40 -0700 (PDT) X-Received: by 2002:a05:6e02:5aa:: with SMTP id k10mr12110282ils.113.1593680740217; Thu, 02 Jul 2020 02:05:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593680740; cv=none; d=google.com; s=arc-20160816; b=bJesT3/FhOp4HY0B8SrNWaT9vPEW7Z2b5eMRrMWls9W5jjjBKr4QnwnktwcMGXyndL +64TJ6XY8ZuUPMH9iwlqqqczWSLqnX3N3AzV3nbyLitDP0Jv68zR/IyMUhS0lCRP8jr8 hznfJuxjf60fOJU9mtk7Q0Wk+jBRrpgV2yI/cXQmrs1qozgnN1k6y6muYj115mxJu/jv FQUzyLQ2Z1olBNcKSRnBNaX+CIEeAuGgW3VlzR15gNR9AqYr1k1XxIIih6N/SSMRgifN O1Uiveaf1XbWj+PMsQbhCafuouaEN8uckwF8jjlDlBe4lfxyNo4GlxxB+XngHQsbeoEa 83+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=TZbrN1QKRJsubIaR01sjzTzcxQbWVstB3/I4RCr7c5k=; b=WaavH+5//E3QwxVlsc+2nk1l6vXr1edHh9nnU+W+kLxd0qOTEOYDf1Pb188U0//3TU K0SjWudKNzZwcEG/1RGwd5j9b84Mwt9bHavOBnLPzSV6d5h71C57aEkxcZswOKELyO+O VCvRY9FbleUnTpuAUXUNtfXNz5wDgTszuayW/AHfnyfHZf1+BOGXBlRCUKX93IPmODYo FRvf/l7mG118jNKb/NcREs6QQv4t7/IF9opmMoVLZ1hT+U+OhdufLNVvd9syc0+c3yb1 NhqCCPNSVhurlqPtjO1F5CWnOTkKe20erMHqUKdrc6B4DA5BL+8fvTW2OIqapYCwlLNS er0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=cCSDX1z1; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id r197sor9510441ior.69.2020.07.02.02.05.40 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Thu, 02 Jul 2020 02:05:40 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:c206:: with SMTP id 6mr12167247pll.268.1593680739615; Thu, 02 Jul 2020 02:05:39 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:a961:9b2e:1b93:8ca7]) by smtp.gmail.com with ESMTPSA id n19sm8308691pgb.0.2020.07.02.02.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2020 02:05:38 -0700 (PDT) From: Jagan Teki <jagan@amarulasolutions.com> To: Alan Stern <stern@rowland.harvard.edu>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Heiko Stuebner <heiko@sntech.de>, Rob Herring <robh+dt@kernel.org>, mylene.josserand@collabora.com Cc: Suniel Mahesh <sunil@amarulasolutions.com>, Michael Trimarchi <michael@amarulasolutions.com>, linux-usb@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula <linux-amarula@amarulasolutions.com>, Jagan Teki <jagan@amarulasolutions.com>, William Wu <william.wu@rock-chips.com> Subject: [PATCH] usb: host: ohci-platform: Disable ohci for rk3288 Date: Thu, 2 Jul 2020 14:35:04 +0530 Message-Id: <20200702090504.36670-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=cCSDX1z1; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
usb: host: ohci-platform: Disable ohci for rk3288
|
|
Commit Message
Jagan Teki
July 2, 2020, 9:05 a.m. UTC
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 <william.wu@rock-chips.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
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(-)
Comments
On Thu, Jul 02, 2020 at 02:35:04PM +0530, 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 <william.wu@rock-chips.com> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > --- > 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")) > return -ENODEV; > > /* > -- > 2.25.1 Acked-by: Alan Stern <stern@rowland.harvard.edu>
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 <william.wu@rock-chips.com> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > --- > 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. As soon as a DTB with a broken piece of hardware enabled gets passed to an OS, then the damage is already done. A driver patch in a future version of Linux that magically knows better and ignores it isn't going to help a user booting an older kernel image, or some other OS entirely. Robin. > return -ENODEV; > > /* >
On Thu, Jul 2, 2020 at 8:08 PM Robin Murphy <robin.murphy@arm.com> 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 <william.wu@rock-chips.com> > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > --- > > 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? Jagan.
On 2020-07-03 12:39, Jagan Teki wrote: > On Thu, Jul 2, 2020 at 8:08 PM Robin Murphy <robin.murphy@arm.com> 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 <william.wu@rock-chips.com> >>> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> >>> --- >>> 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.
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")) return -ENODEV; /*