Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp682940pxb; Fri, 21 Jan 2022 00:21:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJz89X29U1d1FHyPdyixkgAOAif+YxVGegjYlemCR8qwVGTjuSdv2yN62JM8nCZRXo/oz+G/ X-Received: by 2002:a17:902:aa8f:b0:14a:ccfd:ca42 with SMTP id d15-20020a170902aa8f00b0014accfdca42mr2804679plr.52.1642753301104; Fri, 21 Jan 2022 00:21:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1642753301; cv=pass; d=google.com; s=arc-20160816; b=lvvCfG97Gpu7Wbv3jIpi4/ow/vF8pqoli34EHkYsINdLvJH3FiekTi0vSfIWOaDq5/ U2CUyuCDjfTVPAHV3RgQxOkjn7al23Tx0JwvJX+i9DsAeu4AkdI7b9kcObCO2z2ueFHc i6yKzePgLEVpV6jp++gISEll7JtHDDgyBuffZUOdYjNOPn5Z95J2lH4p1KNQiSfox7XD pEyvDWGGM37ohflP/w1g2yJy2BHAsZ8p4SvWrUnRoukulbE9OJz5wd8mDEFZzcO0El1r QvHfcK0GTeJXXBmxDgLHqhf2Y7nKUgwjFnmzfh/RaRwjyeUCLmTpRs35bhfj1Ekt8cVt kUdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:references :cc:to:subject:from:dkim-signature; bh=79TGy9gydQNsHShFPNzG1ZRI4flEDZA2/JTil5PfN4M=; b=c4RyJRSk/GtGuAbb2/qMt/iMvEUCLFanSMP3la+8x+4xx00VE9VPybiEU68OyyO+Az EW8Ane1lmOmb+feUd9b46B9Uw2DjZPvy2NF9n92m8xwCFF6OtmSLVNsCbVo12INx6yoA UONF5Ga3P12GIQMC2Pw5BWwSx2EdFz1/FZaxfNxKLz9/usEWXGVb1LzvB6AUcQvYzzWR ernlGG06MWpm1fyD3sioqGqmqLUZDCLV+aIBITdY7WxjghYa6IAFhUT60uedQw7l58jk lCcUwUpMkNpW3Okf/X13sUl4t0mhqEK2egrnKZoulBK2HF7LwDIr56CAX1d+7K+tgqlx HRGw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector2 header.b=coTlpMea; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si5429963plr.199.2022.01.21.00.21.29; Fri, 21 Jan 2022 00:21:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector2 header.b=coTlpMea; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349447AbiARU70 (ORCPT + 99 others); Tue, 18 Jan 2022 15:59:26 -0500 Received: from mail-eopbgr150083.outbound.protection.outlook.com ([40.107.15.83]:13869 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S245609AbiARU7Y (ORCPT ); Tue, 18 Jan 2022 15:59:24 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XOZXLbDMVyrsxPk+ldew4MRwHIPcjQGat9PsjkIjRPNpbcySolNfHld5Qvv3sy27rJxQUu6ZNbS43qiG+WFBIfNPR/T7sqe/rt6TZzJn++rSztq+QtI3uO5HtMV9jjWT7vhOS4l9N1/ANlzPvB+CZsy1N4negcKFoEI6fm1Y7MB5Mbw7kPTfyrGTSIS8Oi2lQWkEKgUY2r+IgoCiLJR1yo0b5vG0qis00DfU9qhkTWfDrJDwPuAJtNTId4q/rS42HtVRyvajwq1jGWODdPLDyQ8Cgd1tBHGSWsEZiwRQraA7IrTcA+AWo20RrXhDiYPhq5ASz7qh9uwX2S/ph21qWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=79TGy9gydQNsHShFPNzG1ZRI4flEDZA2/JTil5PfN4M=; b=GQDzG8x1/E78gkMO2V095IfkG4RDtwwOESiUlh2QhRiZsaHsw/lq20JqDIz2q+P/asuPF3HuD8+G5V+kd8yGm06H5GJNhfdn9P/nsR5ocGhFtCJRZZwkZCyYU/VSIlMQHJ7r83JwkJwuCVwxFHAgxipfRxddx1SuxaCse+6NZHCSDSG0A7xdSAcdXAkfr4TZT0ESk02mlWm/82XrGRrOKpKwP5kQjXtabdmgI3/r/yFjTWTIfjvgjlC87JZcP7ry2ewKm5GaPOd12QW/+t1ByMOeeL7a2lct05J5oj24FZR53BjEciEQRUYL5IHKJvIQvDpWhv3jib26uyzCGmthMA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=79TGy9gydQNsHShFPNzG1ZRI4flEDZA2/JTil5PfN4M=; b=coTlpMeausd21Y2NXHnu+1M1bSJEsJkUXb9S4bpDsNMg1crH6iAB3XWFZ04Cdmrv0xEmbpN2JxsxWZuAuBdPS9flJDhyoFglqwO9RtvVr8d/K0kFKu415P2wEQrPQ0Bhqmt3SNtLSuOOsPH2kr1xqTR9uiqq/MLaP6XwUevq1cGW9XnmSh0yU/FqVtqqjPwvi/uLdrDv3E6s/wKA9FdZubEdqMp1xpTd4T7X5xSk7R2q+TXJ9gd56uWIvf6UtHYDnYp2K7oyXwOwjfxFSVTR/NxIp8GyToAAtyoiSv1gbFI1WojCkG1qnv5fFHSZcuAs6qYHnzBEdTp62wFdEAv8Tw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by AM9PR03MB6818.eurprd03.prod.outlook.com (2603:10a6:20b:2db::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Tue, 18 Jan 2022 20:59:21 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005%4]) with mapi id 15.20.4888.014; Tue, 18 Jan 2022 20:59:21 +0000 From: Sean Anderson Subject: Re: [PATCH 0/6] usb: dwc3: Calculate REFCLKPER et. al. from reference clock To: Thinh Nguyen , Baruch Siach Cc: Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Robert Hancock , Felipe Balbi , Balaji Prakash J , Andy Gross , Bjorn Andersson , Michal Simek , Rob Herring , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-arm-msm@vger.kernel.org" , Rob Herring References: <20220114233904.907918-1-sean.anderson@seco.com> <87iluifxy1.fsf@tarshish> <7831a4f7-7c3f-4a2a-be73-38f2c40a123c@synopsys.com> Message-ID: <0aaeb0e3-1e10-df41-0b61-c10249ea5faa@seco.com> Date: Tue, 18 Jan 2022 15:59:16 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MN2PR01CA0034.prod.exchangelabs.com (2603:10b6:208:10c::47) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 40e72eb7-6555-4937-1511-08d9dac566b0 X-MS-TrafficTypeDiagnostic: AM9PR03MB6818:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LAu4h4rYs0JoWVKTYy9sFoO7zCYe9F+cwEyygNLsjha9zvqGiChxFwO8v6qkpiahctBjlHlR593vZow2PiFVBN0a7xjSLNHHLb8OnVmWTogWN8MIk0HCbQzHYLoFiJqpk4bBRTYbju1pVjvbfPWKLJjLkNzo7ECNib+65yOMaP1mZtMgnT0AZQkZZPQd58Ew/f3JECWT0In+JPmYzW6TO8DhwYxPE46NmxOnnIm5ye8wBAQMCAELknhDJg8usLtIhXJBfkdeGKaV9NKLj3a/mlrYu74GW0EZRdfSkJCEfDFnJXCiPorEWVmfukz5BbUAKy9gVnTVJQCfKl75bovjpIY1AusunnB6m49UJoKQYBYldjSOG/gA7U9RlLlBjv8fxYtogwtae5UxodUghFGWr3313uGPiULn2sqpwOfOi2LOdNjLF5FjAbctVFHnSYSq2Oj34JXrDu8Kx6dis0vzTJKkWitBYDJXszfQBOgHz+qA/CG52Bj2mR4OfR22DQ6ZPhPTAjEX4Y1duJq5wKldH3K/y8kQQxRYiWCuCq4f94MTAL2Veyv3Gwlur1+QyfroRFoD5wWBsG00f/0wgkMLwPBkZKzrEZKzCnC9UjNcYnAghKBUtqdW4HunWjRtEbtXz7SX1jXLv8C1yryZ0KcudQ7ZxkWYL9jSwNEY3N+YRDNfblvE9EEBjyOOxAI2xFkO1rloDLuouPGeydNE+nL386vr/SC+aa0Y6LkVI58l0NBRwgCgmvZ/hCYGUzdEZOFWIwRivPej3JmgLAZnifrGw0nfsbr1fwcMeFQ1K5JQLXJXANVADDE5LwAWGZM9KVOIzOJIbBECScDH5+jCXmnf4LT6M+6mH6aWRfLsVcZ1Rtc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4523.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(31696002)(86362001)(83380400001)(66556008)(2906002)(966005)(4326008)(7416002)(38100700002)(38350700002)(44832011)(5660300002)(54906003)(6486002)(31686004)(110136005)(508600001)(316002)(8676002)(6666004)(66946007)(26005)(186003)(66476007)(53546011)(6506007)(6512007)(52116002)(36756003)(8936002)(2616005)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VDl3REJWSU9LNlpjSHBOMFBxYzBmOFMzaGtEUHRwZmVrMUlldkRBamJqalJj?= =?utf-8?B?d3lwTHYrd2FFL1pVWVZTWjZHTlBpYlZLbXIwU1ovT0twN1dsalhFaU9rU251?= =?utf-8?B?bVQ2NURBeWNnUVRhUlA4aENvckg4andyYVViTjlLK1hWcXZUMnVqeUUvVjJF?= =?utf-8?B?cXhZYWVUUFRIRllVVGhQb0tvVDZXQ0dtcnQwcUtXQi9yK29BbmI5alpLWW1S?= =?utf-8?B?dUVHQU10NGQ3ZVpIOS9BUGc3V2h0cEdERkZRbExSRnBE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elhJTFF6anFzVDQ3c2p5ak5ibkdzUkxCcHZzWkZjdEJZbUVFNU9lcyt5MWVB?= =?utf-8?B?UE5TT3o1VCtRTVNDc1ZSUHdOd3Z1eks1Q1ljSEg2Yk1FK1JGczVnaTFkWGho?= =?utf-8?Q?lgbw1Mcfyq6UBfi5Xz/55aU=3D?= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40e72eb7-6555-4937-1511-08d9dac566b0 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2022 20:59:21.7582 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XE4B8l8l2C4NOkMnppJ8gOlbjBrwkEjWfYSbVzjvSBQqyVSNPKmIqTqMgdsepimJUBQ+jrG5Z5grdJ1oyGdBGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB6818 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thinh, On 1/18/22 3:00 PM, Thinh Nguyen wrote: > Sean Anderson wrote: >> Hi Thinh, >> >> On 1/18/22 2:46 PM, Thinh Nguyen wrote: >>> Hi Sean, >>> >>> Baruch Siach wrote: >>>> Hi Sean, Thinh, >>>> >>>> On Fri, Jan 14 2022, Sean Anderson wrote: >>>>> This is a rework of patches 3-5 of [1]. It attempts to correctly >>>>> program >>>>> REFCLKPER and REFCLK_FLADJ based on the reference clock frequency. >>>>> Since >>>>> we no longer need a special property duplicating this configuration, >>>>> snps,ref-clock-period-ns is deprecated. >>>>> >>>>> Please test this! Patches 3/4 in this series have the effect of >>>>> programming REFCLKPER and REFCLK_FLADJ on boards which already >>>>> configure >>>>> the "ref" clock. I have build tested, but not much else. >>>>> >>>>> [1] >>>>> https://urldefense.com/v3/__https://lore.kernel.org/linux-usb/20220114044230.2677283-1-robert.hancock@calian.com/__;!!A4F2R9G_pg!M3zKxDZC9a_etqzXo7GSEMTHRWfc1wR_84wwM4-fShiA35CsGcxcTEffHPbprbdC4d2R$ >>>>> >>>> >>>> Thinh, you suggested the dedicated DT property for the reference clock: >>>> >>>> >>>> https://urldefense.com/v3/__https://lore.kernel.org/all/d5acb192-80b9-36f7-43f5-81f21c4e6ba0@synopsys.com/__;!!A4F2R9G_pg!M3zKxDZC9a_etqzXo7GSEMTHRWfc1wR_84wwM4-fShiA35CsGcxcTEffHPbprbpOFmvX$ >>>> >>>> >>>> Can you comment on this series? >>>> >>> >>> Unless there's a good way to pass this information for PCI devices, my >>> opinion hasn't changed. (Btw, I don't think creating a dummy clock >>> provider and its dummy ops is a good solution as seems to complicate and >>> bloat the PCI glue drivers). >> >> Can you explain your situation a bit more? I'm not sure how you can >> access a device tree property but not add a fixed-rate clock. >> >> --Sean > > Currently for dwc3 pci devices, we have glue drivers that create a > platform_device with specific properties to pass to the dwc3 core > driver. Without a ref clock property, we would need another way to pass > this information to the core driver or another way for the dwc3 core > driver to check for specific pci device's properties and quirks. The primary problem with the existing binding is that it does not contain enough information to calculate the fractional period. With the frequency, we can calculate the correct values for the registers without needing an additional binding. So we need to transition to some kind of frequency-based system. So perhaps we should add a "ref-clock-frequency" property and use that as a default for when the clock is missing. --Sean