From nobody Sat Nov 30 00:53:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1620953876; cv=none; d=zohomail.com; s=zohoarc; b=T+jKMeY1MyB9WdmH1pgeXxJ11VZ7NXfjTPeFhEIo26xqD8k93C2ir67BwPZa+WJWYJw+Rmy4pmdzyPgYYJE6t41eJuAH4D7Av1mC0DZdUyYTbF1kbZqbyjAuLc36P5eb32aBUSZZyDCFe5gLT3kaWR9e23ojVZCUoIPPJAgwIeQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620953876; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=puac9P/1pH2gTjwWoFDjpCGPhH1RSMCtsgJsRORZsps=; b=Zdi/DNk4keSo2NzmeDSDd8F9JnBqh6BXuNuW78tKYGx3eK3B/o/MAjM0lSDY3pq08MbBaIu5phr/dJf8VCKMVTSKt/LyC0FL0lQqdRjV6ZRj/V6kvPlB3MEKVZ4SiCd4OGcaXYhNMUpXGhGxCC2n3Vdcq0ojubdt22Jy2+6NabY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 162095387641219.452009405529225; Thu, 13 May 2021 17:57:56 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.127117.238835 (Exim 4.92) (envelope-from ) id 1lhM8y-00055n-PD; Fri, 14 May 2021 00:57:32 +0000 Received: by outflank-mailman (output) from mailman id 127117.238835; Fri, 14 May 2021 00:57:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lhM8y-00055g-K3; Fri, 14 May 2021 00:57:32 +0000 Received: by outflank-mailman (input) for mailman id 127117; Fri, 14 May 2021 00:57:31 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lhM8x-0004or-7P for xen-devel@lists.xenproject.org; Fri, 14 May 2021 00:57:31 +0000 Received: from mail-io1-xd34.google.com (unknown [2607:f8b0:4864:20::d34]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0d522bf0-32e1-4d87-8967-518a75310e3d; Fri, 14 May 2021 00:57:28 +0000 (UTC) Received: by mail-io1-xd34.google.com with SMTP id k16so12586227ios.10 for ; Thu, 13 May 2021 17:57:28 -0700 (PDT) Received: from localhost.localdomain (142-79-211-230.starry-inc.net. [142.79.211.230]) by smtp.gmail.com with ESMTPSA id g25sm1981538ion.32.2021.05.13.17.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 May 2021 17:57:27 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0d522bf0-32e1-4d87-8967-518a75310e3d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=puac9P/1pH2gTjwWoFDjpCGPhH1RSMCtsgJsRORZsps=; b=uleaoi7pw6pKKSvyheVtu5WrdsRZupmmjo1QujTNyVGJQ8DgVhO7y4jFYpwCkJIhy2 68VKEMoj9rYzzCOBLGWHjXSfvisPps5OKm/Jqp9PN5IR9eHiG2WO3QCYVHXMwSzLNd9A O0uK2IdzmG6w6ZUgWg0XIor/h80j1JteyuNu5gj+cCHZ6YX9EGGAKryY0N7AcUPnQcIK vIdeab3oi0stWuXuAWdv1sQQaa2U/oM1C01bnoAVje+WPnbUZxDSwbt0jDrGDvqpwA1v tpqspuZUJ3yxTcLvPcN9YJEahK0dWjqgC/eQ8eTK/DAK7lEatlPwq4qb3xayS5RwgZXG 5QPQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=puac9P/1pH2gTjwWoFDjpCGPhH1RSMCtsgJsRORZsps=; b=hGQSuS5Ya6ZXoEbsfwfVaM1JLbuomZh9lYT8NVhfgsgS9/Vrcm5EoDKGjhl7GIaHWT MWHP++OThP9Z4ar3ua0wVp5GSAYIKTKbfZKDs05QLlhxVd+6hhJxEswt02xi6umpbhAD E2wRpqVaB0VyC3Go66hcl/Y53mY1r4YmUwRWbytc8x7vcJ1kDyJZN+EujH75dtX05zz/ VqdJYu+zWiELZf4a3aIa1VkR2StcMBpKyK8PTfJu7iB88TYORG+t6H0Sr+Cgnnq6UZ+1 vMGjgDtf3piuV4XM1AG4kOwgMuSjN4mOS9DOm98AgLZaeR2I5pXiHd2OvlId/uFV5BX5 Yqxg== X-Gm-Message-State: AOAM532h/dYTJhFxoJL6Yaka0zqCbQd/9MVyBYP1m2aXMCiQaar2jFKY rMhqo7g8TCLMJPjrwRucMKU= X-Google-Smtp-Source: ABdhPJwxVFI67Tc3W19dlbyZNc1e3oxlbpVUX3LqDmZg7zTCXURGdjpwQ/MpJv+vQ6Drwqm86KEn+w== X-Received: by 2002:a6b:7413:: with SMTP id s19mr32097168iog.151.1620953848097; Thu, 13 May 2021 17:57:28 -0700 (PDT) From: Connor Davis To: Greg Kroah-Hartman Cc: Connor Davis , Jann Horn , Lee Jones , Chunfeng Yun , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v2 1/4] usb: early: Avoid using DbC if already enabled Date: Thu, 13 May 2021 18:56:48 -0600 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Connor Davis --- 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 =3D (struct xdbc_regs __iomem *)(xdbc.xhci_base + offset); =20 + 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 =3D NULL; + xdbc.xhci_base =3D NULL; + xdbc.xhci_length =3D 0; + + return -ENODEV; + } + return 0; } =20 --=20 2.31.1