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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C7F8BC52D71 for ; Fri, 2 Aug 2024 05:01:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SFKigovb0c/iNhyUWRzIRaCFkACHoRPioRGFAtBz5kY=; b=SNZ4+YOetpePo6/BbI9tBDBJCs hc2HTGJeyV6b/rdtrSHAZ87RbrkDtxj35zZa+tcaC5RCXwdy1nQnCSWbgllGrZtAql5AxLJRvPU8H RWJ7wh2RBf0IG0xj6ptI4GWpuV+3Qvs6Ur5rfPnNzwf7CJWd9UDZ2tvKPzBnMRW5L4XYmmwJRDRkV Nk3GlMvc7qjo4rp6r/mMK1An99TNB6sGl4bDWtiHwsaPm0cOdF67RWyHRz42fZ0otnGslCsgmRxxC JsGGY2mg82RTgDI4MGIQRIAnzkVSnucwfG09Qt6tkpmEBRNJ5zdRFfl3Qgipn8z6VL5g6mL/bx6uJ VwlyFIYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZkQA-00000007eAP-1mtg; Fri, 02 Aug 2024 05:01:42 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZkPg-00000007e5b-2pFT; Fri, 02 Aug 2024 05:01:14 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1fc4fccdd78so59335625ad.2; Thu, 01 Aug 2024 22:01:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722574872; x=1723179672; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=SFKigovb0c/iNhyUWRzIRaCFkACHoRPioRGFAtBz5kY=; b=ifJbQrnePT05Fp4pT7MEK+MlAydla2ZTlsQ2CWrhaGlouasEJLFMkYKDQ2h+u73zkp HphcnjnFJPZNttfPUQ+37JJxD6Gb05J+LMSJRv7KIyNJ/truf9PC+4PTiFoIvAAuX7g3 wUtcd4uSj3wAIFmJpB23RhGsfcmc/fsI2KR0f5edM45/aRx5StCcQL2zhiW84P6YWejq 7fZQ+CDJLzJSF5P7y+fKFfx3LipNyhC5wJCOF4F36KZSQ5qxGm5MnXV4KTdpDm01oRwf 7NNafKyPNyrgVZnBu4Q3d8QfJqMklXbQrTrvQaS79KowcvrboPmE15jxFOYc7HFag5uY hsRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722574872; x=1723179672; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SFKigovb0c/iNhyUWRzIRaCFkACHoRPioRGFAtBz5kY=; b=n+PmWer2e0G3VoLBeTm/pGoxnvz6awtP216yoDKuxrMVritRMx/43xWq18BwLemmxD 93r9rOdzcLYDCYlgcXPSXowRBl+oAQHQj/OR99M/yEdwd48edU63Jg06lkR9UCyiCrUp oAl/SMW82g+JR6wAnJKHp13ao4xpQp6oIZkliM+bbpgvXsbmC8jRMPEXhuGVSkZH8top yHzAL1HSDqAj05y10Dnsar3PhAg5KX+QzS/pllNkFd7IzEniR6VPxb8WwrznHQwmfWmz Mx6TUV6XJfwGq9dW2ESBQaUCav5Ty0Wyhcxu8cfQ1YYRZNph6DNi9T8m85vR2iuyFRcP WMsw== X-Forwarded-Encrypted: i=1; AJvYcCUw+JtPZ02X5S3hUCdvH1fl8Nfq/0YF3msAZmYABLw/5PTbhmHgGFqXEp2rTHDDkt9M9z+zbkeWHBF9PDpga2LLMeeVoW5N1jgo4ITeoA== X-Gm-Message-State: AOJu0Ywwi36TzY6wCVTIx7GgFpAZL602/KpRJvD7gSNYuWPY2wN9ruHO e8S/raZOWY7xEJTCQK+eJW7N1SNIaiJm89HCdyuFN4rh+sj96f/O/zAP3g== X-Google-Smtp-Source: AGHT+IHcflfL/YECuodg/hQlDr7gN6A6Zu66HPKnYHhtmqIU+9cxcGsm8NNmBnxNmOCqDTuqOCC1tA== X-Received: by 2002:a17:902:e18b:b0:1fb:81ec:26da with SMTP id d9443c01a7336-1ff574cf79dmr24831925ad.58.1722574871621; Thu, 01 Aug 2024 22:01:11 -0700 (PDT) Received: from [172.19.1.53] (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ff58f5a473sm7880685ad.106.2024.08.01.22.01.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Aug 2024 22:01:11 -0700 (PDT) Message-ID: Date: Fri, 2 Aug 2024 13:01:08 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/2] phy: nuvoton: add new driver for the Nuvoton MA35 SoC USB 2.0 PHY To: Krzysztof Kozlowski , vkoul@kernel.org, kishon@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240801053744.807884-1-hpchen0nvt@gmail.com> <20240801053744.807884-3-hpchen0nvt@gmail.com> <85bd5da2-312e-4d25-a4e9-afae4fedbd50@kernel.org> Content-Language: en-US From: Hui-Ping Chen In-Reply-To: <85bd5da2-312e-4d25-a4e9-afae4fedbd50@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240801_220112_739160_D7379EBD X-CRM114-Status: GOOD ( 15.28 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Dear Krzysztof, Thank you for your reply. On 2024/8/1 下午 10:43, Krzysztof Kozlowski wrote: > On 01/08/2024 07:37, Hui-Ping Chen wrote: >> + struct regmap *sysreg; > Look here - iomem? No. Yes, this is my mistake. >> +}; >> + >> +static int ma35_usb_phy_power_on(struct phy *phy) >> +{ >> + struct ma35_usb_phy *p_phy = phy_get_drvdata(phy); >> + unsigned int val; >> + int ret; >> + >> + ret = clk_prepare_enable(p_phy->clk); >> + if (ret < 0) { >> + dev_err(p_phy->dev, "Failed to enable PHY clock: %d\n", ret); >> + return ret; >> + } >> + >> + regmap_read(p_phy->sysreg, MA35_SYS_REG_USBPMISCR, &val); >> + if (val & PHY0SUSPEND) { >> + /* >> + * USB PHY0 is in operation mode already >> + * make sure USB PHY 60 MHz UTMI Interface Clock ready >> + */ >> + ret = readl_poll_timeout((void __iomem *)p_phy->sysreg + MA35_SYS_REG_USBPMISCR, > Eh, I responded to v2, not here, so repeating: > > sysreg is a regmap, not io address. How could it possibly work and be > tested?!? This cannot work. Test your code *before* sending it. > Yes, this is my mistake. I won't reply to v2. I will reply here. I would change 'readl_poll_timeout' to 'regmap_read_poll_timeout'. And it has been tested OK on our platform. > Best regards, > Krzysztof Best regards, Hui-Ping Chen