From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C659C07E99 for ; Mon, 5 Jul 2021 08:05:05 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D672F613BD for ; Mon, 5 Jul 2021 08:05:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D672F613BD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 21D5F82B36; Mon, 5 Jul 2021 10:05:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FK8AjDzm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4F27A82B66; Mon, 5 Jul 2021 10:04:59 +0200 (CEST) Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 44D4A82B36 for ; Mon, 5 Jul 2021 10:04:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-yb1-xb2e.google.com with SMTP id m9so27767029ybo.5 for ; Mon, 05 Jul 2021 01:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6Fz9Xa0HrS0lvMlvT+dpkbTHv9apUxOrCWkAXgg18mw=; b=FK8AjDzmXPWfYfWNBkqPSEXAACqR9bgwKJSeEmeEWcY98ko5EiAK2n0IuEu5QKr2m1 rkkAcGKiEAkupUWF/JbaBKPpSN9lJ/RAvWW8iFfr5gT7cVPvcO9/qoXEhcDHpcsaFFx2 Gjcv/KRqxuV7DGNjW+yQd5WiARJaCmGtncYG2tEMd6X59EAijuQ0UwtR1Fbm5rxccHQ9 1zI0WSdExSSaoQuEU3DY2CVS1FkqslPCsTjpWswwVIzT9icWniJWvjJ44L7ccaRXtyF3 L2sc++AVcsohVixQDE4oOaNWGmc+4xBXlFIXamrhTXOSS9+GLmIgb9TkONwT70GsoBpE glkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6Fz9Xa0HrS0lvMlvT+dpkbTHv9apUxOrCWkAXgg18mw=; b=h7O661A85wMswF3z6Nc22lnoj0BfvuFh9rsI23+NC0bbknsGN0xXAyPVJyTo/SR+PP w/RoxyxXVBHd6YLbVuoighttQtGgA/CEBXAovToHekDWdizn6H724Cnkl98xzHj6fo1/ 0sa/NlxocsuLzH8fg1qeBAqqyivaPfuam+3MdcR6kImEM6J5vnF+oNa9uDo3zaPLlriS rC1Dra0d4vbXY9hTmn3QwFASxIvU82+2T5gF331zSwAPC3sr99hkZvLeNNn5GclHAAnM P6p7bXZ1rJWxfCboMlxCg2IROQsqAgPLj5GAyuj5wOvzWL+Iqy8Q+RxhPMe6X2MmLl8D gIFw== X-Gm-Message-State: AOAM5300FGjOxgdej+LiOTEicdcEv7+Jgu2Gjzd4Ksd6jyNaZnd0oO8L VZrWfk+VS5mNnounV/GhV+TcQDvk/gTIqMsY4HU= X-Google-Smtp-Source: ABdhPJzalcQtd16xbZy8SgBdCv9U8EgVub7ES8L1N8iebItqb8JzWXeJBxww9CcyZqne18P6exwomOdZwvFuDHO2L0U= X-Received: by 2002:a25:df11:: with SMTP id w17mr15894436ybg.314.1625472295025; Mon, 05 Jul 2021 01:04:55 -0700 (PDT) MIME-Version: 1.0 References: <20210417142059.45337-1-samuel@sholland.org> <20210417142059.45337-3-samuel@sholland.org> In-Reply-To: <20210417142059.45337-3-samuel@sholland.org> From: Bin Meng Date: Mon, 5 Jul 2021 16:04:43 +0800 Message-ID: Subject: Re: [PATCH v2 2/4] usb: xhci-pci: Move reset logic out of XHCI core To: Samuel Holland Cc: Marek Vasut , Jagan Teki , Andre Przywara , Andre Heider , Icenowy Zheng , Simon Glass , Kever Yang , Chen-Yu Tsai , Maxime Ripard , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Sat, Apr 17, 2021 at 10:21 PM Samuel Holland wrote: > > Resetting an XHCI controller inside xhci_register undoes any register > setup performed by the platform driver. And at least on the Allwinner > H6, resetting the XHCI controller also resets the PHY, which prevents > the controller from working. That means the controller must be taken out > of reset before initializing the PHY, which must be done before calling > xhci_register. > > The logic in the XHCI core was added to support the Raspberry Pi 4 > (although this was not mentioned in the commit log!), which uses the > xhci-pci platform driver. Move the reset logic to the platform driver, > where it belongs, and where it cannot interfere with other platform > drivers. > > This also fixes a failure to call reset_free if xhci_register failed. > > Fixes: 0b80371b350e ("usb: xhci: Add reset controller support") > Signed-off-by: Samuel Holland > --- > drivers/usb/host/xhci-mem.c | 2 -- > drivers/usb/host/xhci-pci.c | 51 ++++++++++++++++++++++++++++++++++--- > drivers/usb/host/xhci.c | 35 ------------------------- > include/usb/xhci.h | 2 -- > 4 files changed, 47 insertions(+), 43 deletions(-) > Reviewed-by: Bin Meng