Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1834398ybb; Thu, 2 Apr 2020 08:11:51 -0700 (PDT) X-Google-Smtp-Source: APiQypL0nkzrmUYZqWZS6C2Bb89NuAh+4DbRQfxBi7blAXIPAlvLejLe8o3hC8ESPPijBHc0kIag X-Received: by 2002:a05:6830:1da4:: with SMTP id z4mr2740972oti.5.1585840311294; Thu, 02 Apr 2020 08:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585840311; cv=none; d=google.com; s=arc-20160816; b=WENydgm/+kKQBOvl0WFPTUOH3mbInWNzHnbZVAYF7ZWTAzjvAI9cMfceTJ7055mAeh 4JPmHuXk06uRGPNyaVA3+K8PhM6tqLkbGis7yF1hzmc75TZHG47w+rs0Ap8DcFiuI7u4 hV31jj7wenRwzXVUFzSXtZCsIQ50g6c5MfABRYY2tWHZiZooJomiVjN9yiTrywvgXZLM 6kInj/xQ/owdXhxoee8IIHO4vimMF1ftx/mFPqTj8X6DMODR1xD9v3TMpMyhu/BlCp+V SBYZj2s3iLBbt/ncXUAmN4dGKFuZusBNcGnIfVs9ZWHWWKAtxf0sWS1h34pmQXbnwe0V 9pkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:content-language :thread-index:content-transfer-encoding:mime-version:message-id:date :subject:in-reply-to:cc:to:from:dkim-signature:dkim-filter; bh=6n/U4UXr1sadm5NpMP9GqwT5rx5fOlWjC/IaV5L6yFI=; b=ErF41w+OiwgHtOj6Eq4vuUV+cNeI4+96VBNRUyvE9hqwmHBMWlCQ0sOTocEtxb4Ruf 3KCeWopZUrAkb8uqq+KQFHY0tOq3uiSf9O7TAuLuj5F7U6S6CKwCrwCYgCt2J8AGb9aq 0ByzD15PM062eaK5oDiraA4mDt3e+ZsyWf8nb1t312BtPFuVrBH4PCpowfSoqj2yy5os KuTUcs+xsVQK9B1/kuPBuwEVQvYIFKrpXFkUjQm7VooW0xOWjx/XgBlTBgAeb5LmXPwb EJIIFBQBeaeZBZIK0M2ViPRrs9ya384bMATfNpaSWECJIsG2ISe5YCI2QggYbRwA6Au2 1wJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=VOSnjOU3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f63si2160698oib.85.2020.04.02.08.11.37; Thu, 02 Apr 2020 08:11:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=VOSnjOU3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389053AbgDBPIZ (ORCPT + 99 others); Thu, 2 Apr 2020 11:08:25 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:38357 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388808AbgDBPIZ (ORCPT ); Thu, 2 Apr 2020 11:08:25 -0400 Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20200402150821epoutp02cafc5d41bcd6aee6e33b51aaf0d8253b~CCSuZJVek0299802998epoutp02c for ; Thu, 2 Apr 2020 15:08:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20200402150821epoutp02cafc5d41bcd6aee6e33b51aaf0d8253b~CCSuZJVek0299802998epoutp02c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1585840101; bh=6n/U4UXr1sadm5NpMP9GqwT5rx5fOlWjC/IaV5L6yFI=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=VOSnjOU3F90aQgXc10Zr3lnSf7D5vupy1FNDL5CHZ9DimK21wm1JldHQrPtSZZo05 ILBvL3TWhlFsabG3rJydz27e4qqmZNp5PIidZ2ZBA+MkcgysDec8AWLn8azUPFw/lv UD6SrBHMU3HG22/MYJzVDgFHYrabT4pTypeswQ5s= Received: from epsmges5p1new.samsung.com (unknown [182.195.42.73]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20200402150820epcas5p3de6c9f31537388707edabd8a4a12df73~CCStqQfdI3224332243epcas5p3p; Thu, 2 Apr 2020 15:08:20 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 54.91.04782.4EFF58E5; Fri, 3 Apr 2020 00:08:20 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20200402150820epcas5p1d7438cd324271c43d54bd446e239f108~CCStIGjxQ2767827678epcas5p1g; Thu, 2 Apr 2020 15:08:20 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200402150820epsmtrp26e18ee8b63dda67bfd570c016d798f08~CCStHTQBJ2842128421epsmtrp2Z; Thu, 2 Apr 2020 15:08:20 +0000 (GMT) X-AuditID: b6c32a49-89bff700000012ae-a1-5e85ffe49d7c Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id E8.1F.04024.4EFF58E5; Fri, 3 Apr 2020 00:08:20 +0900 (KST) Received: from alimakhtar02 (unknown [107.108.234.165]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200402150817epsmtip2bc01951f013328dcb2a8973e30a4a8cd~CCSqSFhsN0906209062epsmtip2I; Thu, 2 Apr 2020 15:08:17 +0000 (GMT) From: "Alim Akhtar" To: "'Avri Altman'" , , , Cc: , , , , , , , In-Reply-To: Subject: RE: [PATCH v4 4/5] scsi: ufs-exynos: add UFS host support for Exynos SoCs Date: Thu, 2 Apr 2020 20:38:15 +0530 Message-ID: <000001d60900$8b6f5e70$a24e1b50$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQKI+vJzlUBp7WIi19k8pRZBKIHK2gGl+w7dArc8+ogCfXKHn6bJNFzg Content-Language: en-in X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrEKsWRmVeSWpSXmKPExsWy7bCmlu6T/61xBh/nGFq8/HmVzeLT+mWs FvOPnGO1OH9+A7vFzS1HWSw2Pb7GanF51xw2ixnn9zFZdF/fwWax/Pg/JovWvUfYLZZuvcno wONxua+XyWPTqk42j81L6j1aTu5n8fj49BaLR9+WVYwenzfJebQf6GYK4IjisklJzcksSy3S t0vgyliw2LngOU/F1Jf3mBsYV3F1MXJySAiYSOxZ9YKpi5GLQ0hgN6PE6h332SGcT4wS5589 ZwGpEhL4xigxfakqTEfn/l6oor2MEu+/voFy3jBKLJqzjxWkik1AV2LH4jY2EFtEoFZi8eQO VpAiZpCx3/ZOBhvLKRAr8fPJNEYQW1ggROLG6+VgzSwCKhKrHt9iBrF5BSwl9i+7wAphC0qc nPkErJdZQFti2cLXzBAnKUj8fLqMFWKZm8T7exOYIGrEJY7+7GEGWSwhsIxd4tO1dawQDS4S lzadY4SwhSVeHd/CDmFLSXx+txfoag4gO1uiZ5cxRLhGYum8YywQtr3EgStzWEBKmAU0Jdbv 0odYxSfR+/sJE0Qnr0RHmxBEtapE87urUJ3SEhO7u6EO8JD423uIa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dXAmMgiJcbzOX79dEt9Z8O3K5LP/Y+z3OGR8khQxdOunufQouN7LiZ3 OrQcm14nurfNs/xx4owcp52dnacO9uRXehVP+N/n1hC4OXq/auNPtuZJk8QOHtHWf/dr25Rn 8gzzr004/uqL0r1wj3RzsU79HQENrm7rzy2OerWQ042573KEtN/WaoYYJZbijERDLeai4kQA sutWFs0CAAA= X-CMS-MailID: 20200402150820epcas5p1d7438cd324271c43d54bd446e239f108 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P X-CMS-RootMailID: 20200327171420epcas5p490e1e6d090a540eaf050e0728a39ba25 References: <20200327170638.17670-1-alim.akhtar@samsung.com> <20200327170638.17670-5-alim.akhtar@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Avri > -----Original Message----- > From: Avri Altman > Sent: 28 March 2020 16:58 > To: Alim Akhtar ; robh+dt=40kernel.org; > devicetree=40vger.kernel.org; linux-scsi=40vger.kernel.org > Cc: krzk=40kernel.org; martin.petersen=40oracle.com; kwmad.kim=40samsung.= com; > stanley.chu=40mediatek.com; cang=40codeaurora.org; linux-samsung- > soc=40vger.kernel.org; linux-arm-kernel=40lists.infradead.org; linux- > kernel=40vger.kernel.org > Subject: RE: =5BPATCH v4 4/5=5D scsi: ufs-exynos: add UFS host support fo= r Exynos > SoCs >=20 > Hi, >=20 > > + > > +long exynos_ufs_calc_time_cntr(struct exynos_ufs *ufs, long period) = =7B > > + const int precise =3D 10; > > + long pclk_rate =3D ufs->pclk_rate; > > + long clk_period, fraction; > > + > > + clk_period =3D UNIPRO_PCLK_PERIOD(ufs); > > + fraction =3D ((NSEC_PER_SEC % pclk_rate) * precise) / pclk_rate= ; > > + > > + return (period * precise) / ((clk_period * precise) + > > +fraction); =7D > This helper essentially calculates a factor f, and returns period x f. > Why not do that regardless of period? >=20 The period can be different for different timing attributes, so this helper= function takes the period and returns the timer counter value based on the= pclk_rate.=20 > > +extern long exynos_ufs_calc_time_cntr(struct exynos_ufs *, long); > Why this factor needed to be exported? Yes, not needed, will correct this in next version, which I am planning to = post soon. Thanks for your time and review, let me know if you have more inputs.