lkml.org 
[lkml]   [2021]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 1/4] usb: early: Avoid using DbC if already enabled
From
Date
On 14.05.2021 02:56, Connor Davis wrote:
> Check if the debug capability is enabled in early_xdbc_parse_parameter,
> and if it is, return with an error. This avoids collisions with whatever
> enabled the DbC prior to linux starting.

Doesn't this go too far and prevent use even if firmware (perhaps
mistakenly) left it enabled?

Jan

> Signed-off-by: Connor Davis <connojdavis@gmail.com>
> ---
> drivers/usb/early/xhci-dbc.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c
> index be4ecbabdd58..ca67fddc2d36 100644
> --- a/drivers/usb/early/xhci-dbc.c
> +++ b/drivers/usb/early/xhci-dbc.c
> @@ -642,6 +642,16 @@ int __init early_xdbc_parse_parameter(char *s)
> }
> xdbc.xdbc_reg = (struct xdbc_regs __iomem *)(xdbc.xhci_base + offset);
>
> + if (readl(&xdbc.xdbc_reg->control) & CTRL_DBC_ENABLE) {
> + pr_notice("xhci debug capability already in use\n");
> + early_iounmap(xdbc.xhci_base, xdbc.xhci_length);
> + xdbc.xdbc_reg = NULL;
> + xdbc.xhci_base = NULL;
> + xdbc.xhci_length = 0;
> +
> + return -ENODEV;
> + }
> +
> return 0;
> }
>
>

\
 
 \ /
  Last update: 2021-05-17 11:32    [W:0.724 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site