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=-7.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 D9BD4C2B9F4 for ; Tue, 22 Jun 2021 20:12:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B96AC61352 for ; Tue, 22 Jun 2021 20:12:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232740AbhFVUOZ (ORCPT ); Tue, 22 Jun 2021 16:14:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230157AbhFVUOY (ORCPT ); Tue, 22 Jun 2021 16:14:24 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5456C061574 for ; Tue, 22 Jun 2021 13:12:07 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id n20so412029edv.8 for ; Tue, 22 Jun 2021 13:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=x32YDuCNYMIMWiusaAMc7PppyDkWuVh9XTNpn/BCcpQ=; b=BVWcNCtQ4is0MBgfGJQ+u0YjZxicJsGPzkwdc9vxUNSbSFWNcKLZw9aS8L9VTwoMng 5wVZHg0BjK1WPhnEpuCI0f/oVS0iBoem0SRuYCxn/sw43fqs2GlFa+851hEpIABucYSp NGLRq3KJK8C1J+p3Z0iBqqC48GwvlcAje6NdaafN24SAbViQQ73uZrM4r+JAoIX26/mK /lCdftyAfcYiJUDaGm1aFDYfktGqPbJMRofn7i9EEeRjucyQRTbsLpKwVr7jrIrNe+VF fOLRAMsgWTJxZtSChOqRG1V73VsWlrXfOSu9u6DvouSU9pQJOsqX9zw7+Fve/RRej9QS A5AQ== 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=x32YDuCNYMIMWiusaAMc7PppyDkWuVh9XTNpn/BCcpQ=; b=bYgDi8x6B8srQZy3vQV7wpmZvgei3Ta/cPujvgweVNBQDlQ1Hig983o/3pS6BS4u6K dQgnLanCWVxiYQp8ohnpBzyWyb2Mqy5e8zwNcbeck0hArTWksHqdHHdaFEA2LwJbnpir Kg2DQeGFTJUgJe1PzxJRM+RG1AZ7qlMDxezBLzpaMS+9OCR5+yNET1f4BahGX9+pPwa8 kSyqCB9duSyDhH4+VKbxBsAPLnQAO2t9BJr0rORL/4bOkymd9yQOHHJ2UEqutQgkzeyO JwdFQUBN3R+wZED+x0+QP8JBUZJoZGP0s1gaYgygjq3EaLzkg/TXmrgGeDQXWQam18ga /nMw== X-Gm-Message-State: AOAM5306BXe/tLzt4ko0l2YgnvETXvm6wQHpFAwWawcwtHIdwCsZ+CDr vPHE5V0qVloPU+I8AZR5VoZAnR8SbvubyXpzEJM= X-Google-Smtp-Source: ABdhPJxzgiSFYuAF6bcGf2ZGpBCK4YxwOEs6nOAZgcWJxDPcDT203mzVcUzx3TCooP4yABmGdttrQ+s/KNqNmrNKgNE= X-Received: by 2002:a05:6402:2694:: with SMTP id w20mr7479552edd.287.1624392726470; Tue, 22 Jun 2021 13:12:06 -0700 (PDT) MIME-Version: 1.0 References: <20210617194154.2397-1-linux.amoon@gmail.com> <20210617194154.2397-7-linux.amoon@gmail.com> In-Reply-To: From: Martin Blumenstingl Date: Tue, 22 Jun 2021 22:11:55 +0200 Message-ID: Subject: Re: [RFCv1 6/8] phy: amlogic: meson8b-usb2: Use phy reset callback function To: Anand Moon Cc: Kishon Vijay Abraham I , Vinod Koul , Neil Armstrong , Kevin Hilman , Jerome Brunet , Philipp Zabel , linux-phy@lists.infradead.org, linux-arm-kernel , linux-amlogic@lists.infradead.org, Linux Kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Anand, On Mon, Jun 21, 2021 at 9:16 AM Anand Moon wrote: [...] > Ok Thanks for the inputs. got your point. > > I was also looking into Amlogic source code for reset. (aml_cbus_update_bits) > [0] https://github.com/khadas/linux/blob/khadas-vims-4.9.y/drivers/amlogic/usb/phy/phy-aml-new-usb.c > is there some feature to iomap the USB with cbus? for that specific code: that's what we do inside drivers/reset/reset-meson.c Amlogic's vendor kernel uses an increment of 4 bytes per value, so 0x1102 translates to 0x4408 then in mainline's meson8b.dtsi we have: compatible = "amlogic,meson8b-reset"; reg = <0x4404 0x9c>; as you can see 0x4408 is part of the reset controller node. next in include/dt-bindings/reset/amlogic,meson8b-reset.h we have: #define RESET_USB_OTG 34 the register used for reset line 34 is translated using: 0x4404 (first register) + 4 (4 * reset line / 32 = 1) = 0x4408 then the bit inside this register is translated using: reset line % 32 = 2 that's how we express aml_cbus_update_bits(0x1102, 0x1<<2, 0x1<<2); in the mainline kernel (by going through the reset subsystem) [...] > > > > > - priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, NULL); > > > > > + priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, "phy"); > > > > I think this breaks compatibility with existing .dtbs and our > > > > dt-bindings (as we're not documenting a "reset-names" property). > > > > What is the goal of this one? > > > > > > > > > > OK, If we pass NULL over here there is the possibility > > > USB phy will not get registered. > > I don't understand why - with NULL everything is working fine for me. > > Also no matter which name you give to the reset line (in reset-names), > > it will be the same reset line in all cases. If it's the same reset > > line before and after: why is this needed? > > > I need to investigate this reset feature. With my setup with current changes > after I update the below. > - priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, "phy"); > + priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, NULL); > if (PTR_ERR(priv->reset) == -EPROBE_DEFER) > return PTR_ERR(priv->reset); > > Reset will break the USB initialization, see below output. interesting, I have not seen that USB problem before and neither is Kernel CI seeing it: [0] Is it only happening with this patch or did you also see it before? Best regards, Martin [0] https://storage.staging.kernelci.org/next/master/next-20210617/arm/multi_v7_defconfig+ltp-ima/gcc-8/lab-baylibre/baseline-meson8b-odroidc1.html 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=-5.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 809E4C2B9F4 for ; Tue, 22 Jun 2021 20:13:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3BBA160FEB for ; Tue, 22 Jun 2021 20:13:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BBA160FEB Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8SiYgr0VlClfzPPIpDFPbary3GloSWDeNW8GUFJ1Caw=; b=Jnfa3z7WOYyG94 hxAKYcezr/lY+zSsWjU+FTo5tI7Gly/7px0XXXrW3ZaANjEhAc2Wp9Proc+KNldUkIA855mFMxUEd 42yPeohH4iFq/GNy4vVqIsNsyt2cJmKjIRdVg2LCb0ixRr+H6EYZPVa9VJVUoQNRJHqFG5TDU2k/F oq1GlXgZdA4r5FHEG1MaqV5cgNgHOnw8PdDyPBui1iF9dPxNGvQ2dQ0tLILS3sOEgqrVZlHx2Qj4p H8rMfrkgah9ONjNDvnBJ7NZ3efEHy5Ha1MT1KSkQ3ZEAsIGLvGhExkNVMWBxggLDXWRr9ATU0NQSl pAZImG3SLuu4pj9qMAGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvmko-008KFV-4I; Tue, 22 Jun 2021 20:12:14 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvmkh-008KED-Vl; Tue, 22 Jun 2021 20:12:09 +0000 Received: by mail-ed1-x533.google.com with SMTP id s6so396821edu.10; Tue, 22 Jun 2021 13:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=x32YDuCNYMIMWiusaAMc7PppyDkWuVh9XTNpn/BCcpQ=; b=BVWcNCtQ4is0MBgfGJQ+u0YjZxicJsGPzkwdc9vxUNSbSFWNcKLZw9aS8L9VTwoMng 5wVZHg0BjK1WPhnEpuCI0f/oVS0iBoem0SRuYCxn/sw43fqs2GlFa+851hEpIABucYSp NGLRq3KJK8C1J+p3Z0iBqqC48GwvlcAje6NdaafN24SAbViQQ73uZrM4r+JAoIX26/mK /lCdftyAfcYiJUDaGm1aFDYfktGqPbJMRofn7i9EEeRjucyQRTbsLpKwVr7jrIrNe+VF fOLRAMsgWTJxZtSChOqRG1V73VsWlrXfOSu9u6DvouSU9pQJOsqX9zw7+Fve/RRej9QS A5AQ== 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=x32YDuCNYMIMWiusaAMc7PppyDkWuVh9XTNpn/BCcpQ=; b=OTRMTGw0QMfucdCQjfJkSn3AU3Jo35bPDNbCz/hdUltYyl+0WrqphcNpdLVa/jj+WA bYJ7Ru3baGW/H0sOcVBczMIwv0LcrqerWcNWh/vfGImoTUr1Xqq2RIWZRphV4WHeBWAe mMGLIVghqUKyEmxuF6mgfL7xk4JxluS1CLssGha3gGX4x0986rqnEP29BKTDdhbvaDUA u+l606hwEWanYdzjlIm6cJc1VAde36pe+lryhb/ck/oqgYpQnQgHUsgxba5d015SDOgx ndj1BiRSKhM/6M4tS0akkkPSy1ajTk/kycLtT68t+MWElD97xXvQunerEMjQk92RnooR U0cQ== X-Gm-Message-State: AOAM533e5p1AIPxooODZHdypgYn+wycZQewa3KUcgNY5urnzdXk6f4Gd k8IHv226ZYh/UD8cChEcoBX5KdhIQk0Z9IeTSF0= X-Google-Smtp-Source: ABdhPJxzgiSFYuAF6bcGf2ZGpBCK4YxwOEs6nOAZgcWJxDPcDT203mzVcUzx3TCooP4yABmGdttrQ+s/KNqNmrNKgNE= X-Received: by 2002:a05:6402:2694:: with SMTP id w20mr7479552edd.287.1624392726470; Tue, 22 Jun 2021 13:12:06 -0700 (PDT) MIME-Version: 1.0 References: <20210617194154.2397-1-linux.amoon@gmail.com> <20210617194154.2397-7-linux.amoon@gmail.com> In-Reply-To: From: Martin Blumenstingl Date: Tue, 22 Jun 2021 22:11:55 +0200 Message-ID: Subject: Re: [RFCv1 6/8] phy: amlogic: meson8b-usb2: Use phy reset callback function To: Anand Moon Cc: Kishon Vijay Abraham I , Vinod Koul , Neil Armstrong , Kevin Hilman , Jerome Brunet , Philipp Zabel , linux-phy@lists.infradead.org, linux-arm-kernel , linux-amlogic@lists.infradead.org, Linux Kernel X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210622_131208_107969_D9F6BFBD X-CRM114-Status: GOOD ( 21.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Anand, On Mon, Jun 21, 2021 at 9:16 AM Anand Moon wrote: [...] > Ok Thanks for the inputs. got your point. > > I was also looking into Amlogic source code for reset. (aml_cbus_update_bits) > [0] https://github.com/khadas/linux/blob/khadas-vims-4.9.y/drivers/amlogic/usb/phy/phy-aml-new-usb.c > is there some feature to iomap the USB with cbus? for that specific code: that's what we do inside drivers/reset/reset-meson.c Amlogic's vendor kernel uses an increment of 4 bytes per value, so 0x1102 translates to 0x4408 then in mainline's meson8b.dtsi we have: compatible = "amlogic,meson8b-reset"; reg = <0x4404 0x9c>; as you can see 0x4408 is part of the reset controller node. next in include/dt-bindings/reset/amlogic,meson8b-reset.h we have: #define RESET_USB_OTG 34 the register used for reset line 34 is translated using: 0x4404 (first register) + 4 (4 * reset line / 32 = 1) = 0x4408 then the bit inside this register is translated using: reset line % 32 = 2 that's how we express aml_cbus_update_bits(0x1102, 0x1<<2, 0x1<<2); in the mainline kernel (by going through the reset subsystem) [...] > > > > > - priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, NULL); > > > > > + priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, "phy"); > > > > I think this breaks compatibility with existing .dtbs and our > > > > dt-bindings (as we're not documenting a "reset-names" property). > > > > What is the goal of this one? > > > > > > > > > > OK, If we pass NULL over here there is the possibility > > > USB phy will not get registered. > > I don't understand why - with NULL everything is working fine for me. > > Also no matter which name you give to the reset line (in reset-names), > > it will be the same reset line in all cases. If it's the same reset > > line before and after: why is this needed? > > > I need to investigate this reset feature. With my setup with current changes > after I update the below. > - priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, "phy"); > + priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, NULL); > if (PTR_ERR(priv->reset) == -EPROBE_DEFER) > return PTR_ERR(priv->reset); > > Reset will break the USB initialization, see below output. interesting, I have not seen that USB problem before and neither is Kernel CI seeing it: [0] Is it only happening with this patch or did you also see it before? Best regards, Martin [0] https://storage.staging.kernelci.org/next/master/next-20210617/arm/multi_v7_defconfig+ltp-ima/gcc-8/lab-baylibre/baseline-meson8b-odroidc1.html _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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=-5.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 E5A8DC2B9F4 for ; Tue, 22 Jun 2021 20:12:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A500B6109E for ; Tue, 22 Jun 2021 20:12:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A500B6109E Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KrG3it1zPypt+plcFNAIpPlSQMNG0serpMsqHyFXDhY=; b=hMmhm2fkFQs4+O rkGU/fDDZT+zaY9Q/kbWcRnkV4WMvDjZqhFEfMFPCiLXycZ4TVODe3IQWYDKbRj9G2wUWXqW87BpJ dYcVOefnDWMeAuXdJZ2R4T6UyKqgRCUH+sMfI48qnhqoK4grihate1iaCfbupPo8YrFVJW6OE/xRC fghSQ2xrb52scQD7hBKR0/SUcsfy9k0gYKrAmr8YP0G1G5HLMgnRzuq7Zo+2BUOZu9XVtLFBsaH04 3es7Qv5EEShtqZ+2HT+3101Fg9qWDOc0nIgu/Lx0geyMDpxjAcBeG+STJWDjqlgyH1tmuD2dzEXqw gHanQGf//tpFMDUzuSkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvmkz-008KHY-Er; Tue, 22 Jun 2021 20:12:25 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvmkh-008KED-Vl; Tue, 22 Jun 2021 20:12:09 +0000 Received: by mail-ed1-x533.google.com with SMTP id s6so396821edu.10; Tue, 22 Jun 2021 13:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=x32YDuCNYMIMWiusaAMc7PppyDkWuVh9XTNpn/BCcpQ=; b=BVWcNCtQ4is0MBgfGJQ+u0YjZxicJsGPzkwdc9vxUNSbSFWNcKLZw9aS8L9VTwoMng 5wVZHg0BjK1WPhnEpuCI0f/oVS0iBoem0SRuYCxn/sw43fqs2GlFa+851hEpIABucYSp NGLRq3KJK8C1J+p3Z0iBqqC48GwvlcAje6NdaafN24SAbViQQ73uZrM4r+JAoIX26/mK /lCdftyAfcYiJUDaGm1aFDYfktGqPbJMRofn7i9EEeRjucyQRTbsLpKwVr7jrIrNe+VF fOLRAMsgWTJxZtSChOqRG1V73VsWlrXfOSu9u6DvouSU9pQJOsqX9zw7+Fve/RRej9QS A5AQ== 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=x32YDuCNYMIMWiusaAMc7PppyDkWuVh9XTNpn/BCcpQ=; b=OTRMTGw0QMfucdCQjfJkSn3AU3Jo35bPDNbCz/hdUltYyl+0WrqphcNpdLVa/jj+WA bYJ7Ru3baGW/H0sOcVBczMIwv0LcrqerWcNWh/vfGImoTUr1Xqq2RIWZRphV4WHeBWAe mMGLIVghqUKyEmxuF6mgfL7xk4JxluS1CLssGha3gGX4x0986rqnEP29BKTDdhbvaDUA u+l606hwEWanYdzjlIm6cJc1VAde36pe+lryhb/ck/oqgYpQnQgHUsgxba5d015SDOgx ndj1BiRSKhM/6M4tS0akkkPSy1ajTk/kycLtT68t+MWElD97xXvQunerEMjQk92RnooR U0cQ== X-Gm-Message-State: AOAM533e5p1AIPxooODZHdypgYn+wycZQewa3KUcgNY5urnzdXk6f4Gd k8IHv226ZYh/UD8cChEcoBX5KdhIQk0Z9IeTSF0= X-Google-Smtp-Source: ABdhPJxzgiSFYuAF6bcGf2ZGpBCK4YxwOEs6nOAZgcWJxDPcDT203mzVcUzx3TCooP4yABmGdttrQ+s/KNqNmrNKgNE= X-Received: by 2002:a05:6402:2694:: with SMTP id w20mr7479552edd.287.1624392726470; Tue, 22 Jun 2021 13:12:06 -0700 (PDT) MIME-Version: 1.0 References: <20210617194154.2397-1-linux.amoon@gmail.com> <20210617194154.2397-7-linux.amoon@gmail.com> In-Reply-To: From: Martin Blumenstingl Date: Tue, 22 Jun 2021 22:11:55 +0200 Message-ID: Subject: Re: [RFCv1 6/8] phy: amlogic: meson8b-usb2: Use phy reset callback function To: Anand Moon Cc: Kishon Vijay Abraham I , Vinod Koul , Neil Armstrong , Kevin Hilman , Jerome Brunet , Philipp Zabel , linux-phy@lists.infradead.org, linux-arm-kernel , linux-amlogic@lists.infradead.org, Linux Kernel X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210622_131208_107969_D9F6BFBD X-CRM114-Status: GOOD ( 21.31 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Hi Anand, On Mon, Jun 21, 2021 at 9:16 AM Anand Moon wrote: [...] > Ok Thanks for the inputs. got your point. > > I was also looking into Amlogic source code for reset. (aml_cbus_update_bits) > [0] https://github.com/khadas/linux/blob/khadas-vims-4.9.y/drivers/amlogic/usb/phy/phy-aml-new-usb.c > is there some feature to iomap the USB with cbus? for that specific code: that's what we do inside drivers/reset/reset-meson.c Amlogic's vendor kernel uses an increment of 4 bytes per value, so 0x1102 translates to 0x4408 then in mainline's meson8b.dtsi we have: compatible = "amlogic,meson8b-reset"; reg = <0x4404 0x9c>; as you can see 0x4408 is part of the reset controller node. next in include/dt-bindings/reset/amlogic,meson8b-reset.h we have: #define RESET_USB_OTG 34 the register used for reset line 34 is translated using: 0x4404 (first register) + 4 (4 * reset line / 32 = 1) = 0x4408 then the bit inside this register is translated using: reset line % 32 = 2 that's how we express aml_cbus_update_bits(0x1102, 0x1<<2, 0x1<<2); in the mainline kernel (by going through the reset subsystem) [...] > > > > > - priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, NULL); > > > > > + priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, "phy"); > > > > I think this breaks compatibility with existing .dtbs and our > > > > dt-bindings (as we're not documenting a "reset-names" property). > > > > What is the goal of this one? > > > > > > > > > > OK, If we pass NULL over here there is the possibility > > > USB phy will not get registered. > > I don't understand why - with NULL everything is working fine for me. > > Also no matter which name you give to the reset line (in reset-names), > > it will be the same reset line in all cases. If it's the same reset > > line before and after: why is this needed? > > > I need to investigate this reset feature. With my setup with current changes > after I update the below. > - priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, "phy"); > + priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, NULL); > if (PTR_ERR(priv->reset) == -EPROBE_DEFER) > return PTR_ERR(priv->reset); > > Reset will break the USB initialization, see below output. interesting, I have not seen that USB problem before and neither is Kernel CI seeing it: [0] Is it only happening with this patch or did you also see it before? Best regards, Martin [0] https://storage.staging.kernelci.org/next/master/next-20210617/arm/multi_v7_defconfig+ltp-ima/gcc-8/lab-baylibre/baseline-meson8b-odroidc1.html _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic 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=-5.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 5D10AC48BDF for ; Tue, 22 Jun 2021 20:12:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1A3AC6109E for ; Tue, 22 Jun 2021 20:12:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A3AC6109E Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mW8H37fCJTBfT6ET7NtAfsN/EcUXqmMGlETEuIaxaQE=; b=tw+em+K11BbPH6 8daOj/RIsMrI0EWdSr8qhH/4T0tIS/bpqr2OEd1gnSMXzMJgADRqgylns4q+oYgJ5QHjmGK/40dLl DkctZhe0QkNAszl/n3DZpIIKGlJJGcZnYW69oRpmUXmuLmnC0X3Ty2qENyFxHSJY+Y8yr08Dh5f0Q qoWEdP1YrsZJrL3cUUbPsrQDD4xmWrDjARJSItQmzwUWys3POxWlVrai/5ClGW8yLDuydTynfnjBP ZpWVuH3UQUg5UFzdzI7YBKCYSK92e1Zfu5sRhTOeLRjZifiE+yKxD8haBNqdZcaU4D2p4IaJyIXsw VQ47qvR64T7QVA1X+yhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvmkl-008KFQ-J0; Tue, 22 Jun 2021 20:12:11 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvmkh-008KED-Vl; Tue, 22 Jun 2021 20:12:09 +0000 Received: by mail-ed1-x533.google.com with SMTP id s6so396821edu.10; Tue, 22 Jun 2021 13:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=x32YDuCNYMIMWiusaAMc7PppyDkWuVh9XTNpn/BCcpQ=; b=BVWcNCtQ4is0MBgfGJQ+u0YjZxicJsGPzkwdc9vxUNSbSFWNcKLZw9aS8L9VTwoMng 5wVZHg0BjK1WPhnEpuCI0f/oVS0iBoem0SRuYCxn/sw43fqs2GlFa+851hEpIABucYSp NGLRq3KJK8C1J+p3Z0iBqqC48GwvlcAje6NdaafN24SAbViQQ73uZrM4r+JAoIX26/mK /lCdftyAfcYiJUDaGm1aFDYfktGqPbJMRofn7i9EEeRjucyQRTbsLpKwVr7jrIrNe+VF fOLRAMsgWTJxZtSChOqRG1V73VsWlrXfOSu9u6DvouSU9pQJOsqX9zw7+Fve/RRej9QS A5AQ== 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=x32YDuCNYMIMWiusaAMc7PppyDkWuVh9XTNpn/BCcpQ=; b=OTRMTGw0QMfucdCQjfJkSn3AU3Jo35bPDNbCz/hdUltYyl+0WrqphcNpdLVa/jj+WA bYJ7Ru3baGW/H0sOcVBczMIwv0LcrqerWcNWh/vfGImoTUr1Xqq2RIWZRphV4WHeBWAe mMGLIVghqUKyEmxuF6mgfL7xk4JxluS1CLssGha3gGX4x0986rqnEP29BKTDdhbvaDUA u+l606hwEWanYdzjlIm6cJc1VAde36pe+lryhb/ck/oqgYpQnQgHUsgxba5d015SDOgx ndj1BiRSKhM/6M4tS0akkkPSy1ajTk/kycLtT68t+MWElD97xXvQunerEMjQk92RnooR U0cQ== X-Gm-Message-State: AOAM533e5p1AIPxooODZHdypgYn+wycZQewa3KUcgNY5urnzdXk6f4Gd k8IHv226ZYh/UD8cChEcoBX5KdhIQk0Z9IeTSF0= X-Google-Smtp-Source: ABdhPJxzgiSFYuAF6bcGf2ZGpBCK4YxwOEs6nOAZgcWJxDPcDT203mzVcUzx3TCooP4yABmGdttrQ+s/KNqNmrNKgNE= X-Received: by 2002:a05:6402:2694:: with SMTP id w20mr7479552edd.287.1624392726470; Tue, 22 Jun 2021 13:12:06 -0700 (PDT) MIME-Version: 1.0 References: <20210617194154.2397-1-linux.amoon@gmail.com> <20210617194154.2397-7-linux.amoon@gmail.com> In-Reply-To: From: Martin Blumenstingl Date: Tue, 22 Jun 2021 22:11:55 +0200 Message-ID: Subject: Re: [RFCv1 6/8] phy: amlogic: meson8b-usb2: Use phy reset callback function To: Anand Moon Cc: Kishon Vijay Abraham I , Vinod Koul , Neil Armstrong , Kevin Hilman , Jerome Brunet , Philipp Zabel , linux-phy@lists.infradead.org, linux-arm-kernel , linux-amlogic@lists.infradead.org, Linux Kernel X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210622_131208_107969_D9F6BFBD X-CRM114-Status: GOOD ( 21.31 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Hi Anand, On Mon, Jun 21, 2021 at 9:16 AM Anand Moon wrote: [...] > Ok Thanks for the inputs. got your point. > > I was also looking into Amlogic source code for reset. (aml_cbus_update_bits) > [0] https://github.com/khadas/linux/blob/khadas-vims-4.9.y/drivers/amlogic/usb/phy/phy-aml-new-usb.c > is there some feature to iomap the USB with cbus? for that specific code: that's what we do inside drivers/reset/reset-meson.c Amlogic's vendor kernel uses an increment of 4 bytes per value, so 0x1102 translates to 0x4408 then in mainline's meson8b.dtsi we have: compatible = "amlogic,meson8b-reset"; reg = <0x4404 0x9c>; as you can see 0x4408 is part of the reset controller node. next in include/dt-bindings/reset/amlogic,meson8b-reset.h we have: #define RESET_USB_OTG 34 the register used for reset line 34 is translated using: 0x4404 (first register) + 4 (4 * reset line / 32 = 1) = 0x4408 then the bit inside this register is translated using: reset line % 32 = 2 that's how we express aml_cbus_update_bits(0x1102, 0x1<<2, 0x1<<2); in the mainline kernel (by going through the reset subsystem) [...] > > > > > - priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, NULL); > > > > > + priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, "phy"); > > > > I think this breaks compatibility with existing .dtbs and our > > > > dt-bindings (as we're not documenting a "reset-names" property). > > > > What is the goal of this one? > > > > > > > > > > OK, If we pass NULL over here there is the possibility > > > USB phy will not get registered. > > I don't understand why - with NULL everything is working fine for me. > > Also no matter which name you give to the reset line (in reset-names), > > it will be the same reset line in all cases. If it's the same reset > > line before and after: why is this needed? > > > I need to investigate this reset feature. With my setup with current changes > after I update the below. > - priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, "phy"); > + priv->reset = devm_reset_control_get_optional_shared(&pdev->dev, NULL); > if (PTR_ERR(priv->reset) == -EPROBE_DEFER) > return PTR_ERR(priv->reset); > > Reset will break the USB initialization, see below output. interesting, I have not seen that USB problem before and neither is Kernel CI seeing it: [0] Is it only happening with this patch or did you also see it before? Best regards, Martin [0] https://storage.staging.kernelci.org/next/master/next-20210617/arm/multi_v7_defconfig+ltp-ima/gcc-8/lab-baylibre/baseline-meson8b-odroidc1.html -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy