Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3203703ybi; Mon, 17 Jun 2019 19:06:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4iZxVsDy3snXV4RfdTVug/Vn6HLNzWICgIHyvvJqknIeRznL5fsRDLmzuCMAKW+/Nipy1 X-Received: by 2002:aa7:934f:: with SMTP id 15mr37097437pfn.238.1560823574885; Mon, 17 Jun 2019 19:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560823574; cv=none; d=google.com; s=arc-20160816; b=Fp1gHr9U+PRI8at3mWSdgLoGSDPV3Vf0ALvgAMZUMnNfwBMw9sZHsKW4PZvBskYHHw wpp2g73ef2zXsa/c39PifwUgktpABLiXWFuaOV3VpJsopmSoAjUqzwh36fVwC3K0sMop tjzKPr/7FRgr7Y6486qwZVYlWnR0bpczUYT5Ac90KNsh7cFOVpRE3jxW9POAFMSnZVz9 XV3kjhktUhoJSxvWV2lcFz2aKk2DB1kQunRCYdReLwmdwwatQHYxWSwezkWasLQ8tjk0 fnE0X+io0OSc/zd2Upwy+Of9qT/zctz9h9o2lclM8JuRDPe8llJRO4lkiMhUXvZTDBNh XlnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:nodisclaimer:user-agent:content-language:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from:dkim-signature; bh=kg2kvnqT0VjSojJg+YRo1O9WIFi6KUcTt8LWGNg7nDc=; b=CMN1ycYQKuKqI29vEJTKtZNur1qIineFMk9sXTRRPx7uf99O6z49jPxpyV4hPOZF6A wf0Q1nWhNm/9jzAFOeUSqPc6hG/V/71Hwb0Dy9PU03KW2xOXM6dxVaIWa5d9D1Mz8J3k 4R4cv0dPMBghpvMe0qxPPZjc2+YIW+HrBrRrueASbCn9Ej9K3XoEvdMfKUAvDrZVcLMj Lu9JPbMnuuIWKkF4nJgaOE6GPB9Jtl8kw3zlV5k/3kJTAQw6wloORVXECQBNp67hNxz4 PIsyV4FQrPhgJetf0R4dxACWJmvtki04RAAJyeGzW+ApGM4o7KYQXbB4iloGZFo4Cwe/ +fSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=cEembCbJ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m63si892016pjb.8.2019.06.17.19.05.58; Mon, 17 Jun 2019 19:06:14 -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=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=cEembCbJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726872AbfFRCFi (ORCPT + 99 others); Mon, 17 Jun 2019 22:05:38 -0400 Received: from mail-eopbgr150085.outbound.protection.outlook.com ([40.107.15.85]:40038 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725829AbfFRCFi (ORCPT ); Mon, 17 Jun 2019 22:05:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kg2kvnqT0VjSojJg+YRo1O9WIFi6KUcTt8LWGNg7nDc=; b=cEembCbJiNme+wGioPsdTCVzDyFC1DyA2U+lV6geOLavLrsMt7dEX6fHyawkJB+VO0TlnuAeNX/Du/+laneueMba/RdqEG5fGGvwNxEQ3SIxFvmQP33OkMETu8sT9jNraYfeeM5D892hrTO68uTKca8HQ0ga0NHKjqvMrBI01DA= Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB4688.eurprd08.prod.outlook.com (10.255.115.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1987.15; Tue, 18 Jun 2019 02:05:35 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::206b:5cf6:97e:1358]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::206b:5cf6:97e:1358%7]) with mapi id 15.20.1987.014; Tue, 18 Jun 2019 02:05:35 +0000 From: "james qian wang (Arm Technology China)" To: Arnd Bergmann CC: Liviu Dudau , Brian Starkey , David Airlie , Daniel Vetter , "Lowry Li (Arm Technology China)" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , nd Subject: Re: [PATCH] drm/komeda: fix 32-bit komeda_crtc_update_clock_ratio Thread-Topic: [PATCH] drm/komeda: fix 32-bit komeda_crtc_update_clock_ratio Thread-Index: AQHVJXpNE3N21cdpKkuGT3soJLEwQQ== Date: Tue, 18 Jun 2019 02:05:35 +0000 Message-ID: <20190618020529.GB32081@james-ThinkStation-P300> References: <20190617125121.1414507-1-arnd@arndb.de> In-Reply-To: <20190617125121.1414507-1-arnd@arndb.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mutt/1.9.4 (2018-02-28) x-originating-ip: [113.29.88.7] x-clientproxiedby: HK2PR02CA0160.apcprd02.prod.outlook.com (2603:1096:201:1f::20) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) authentication-results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8bd65035-c28a-4f80-d7c9-08d6f3917371 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:VE1PR08MB4688; x-ms-traffictypediagnostic: VE1PR08MB4688: nodisclaimer: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 007271867D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(7916004)(396003)(39860400002)(346002)(376002)(366004)(136003)(199004)(189003)(76176011)(25786009)(33716001)(478600001)(6246003)(99286004)(52116002)(256004)(58126008)(476003)(316002)(54906003)(229853002)(6486002)(11346002)(486006)(33656002)(1076003)(6436002)(14444005)(446003)(4326008)(6506007)(26005)(5660300002)(66066001)(6512007)(9686003)(66476007)(66446008)(66556008)(64756008)(81166006)(53936002)(71200400001)(71190400001)(8936002)(81156014)(3846002)(6116002)(386003)(86362001)(55236004)(186003)(8676002)(102836004)(66946007)(68736007)(14454004)(6916009)(2906002)(305945005)(73956011)(7736002);DIR:OUT;SFP:1101;SCL:1;SRVR:VE1PR08MB4688;H:VE1PR08MB5006.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: y04z68eaMDTgREEPP+neA+e8LM/Xh9ECuJHSo3zcKDewmgaV7iHGG71Jue5c1iwzMyIGI8q8POjzUXWlaxc1J4FlVyEtQ9WR3t4jaFvaxd3KJCdVBzJ/wQtoR6fzgk3gII0+L/5RYOnyix5pA5oP/9+wVFRaNJQHW8VxB2YwmuSmGcQ0hTivRv60oiRuTsLRspa/z94UP0ZtjUw+e3PCyhOahZdqw+8jt5djppLXe12qWLGqhjLBr6/7znabufSA20GxyZ5RTKCumImTfxLxMzk2D8CzsiWXjW307Sm6Zr5NDcC1iE8+MOqLkr5mODRFlH4bvdkaE145die8rpIjeCVFPYWyfyRykQcUOKeTIOlc9vDP31oO4LMJ6QtwYk0ctJV/8Mf6eQWUuC9U5qix8ThC5/xxPHemBgSQXV3C7AM= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8bd65035-c28a-4f80-d7c9-08d6f3917371 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jun 2019 02:05:35.4910 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: james.qian.wang@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4688 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 17, 2019 at 02:51:04PM +0200, Arnd Bergmann wrote: > clang points out a bug in the clock calculation on 32-bit, that leads > to the clock_ratio always being zero: >=20 > drivers/gpu/drm/arm/display/komeda/komeda_crtc.c:31:36: error: shift coun= t >=3D width of type [-Werror,-Wshift-count-overflow] > aclk =3D komeda_calc_aclk(kcrtc_st) << 32; >=20 > Move the shift into the division to make it apply on a 64-bit > variable. Also use the more expensive div64_u64() instead of div_u64() > to account for pxlclk being a 64-bit integer. >=20 > Fixes: a962091227ed ("drm/komeda: Add engine clock requirement check for = the downscaling") > Signed-off-by: Arnd Bergmann > --- > drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/g= pu/drm/arm/display/komeda/komeda_crtc.c > index cafb4457e187..3f222f464eb2 100644 > --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c > @@ -28,10 +28,9 @@ static void komeda_crtc_update_clock_ratio(struct kome= da_crtc_state *kcrtc_st) > } > =20 > pxlclk =3D kcrtc_st->base.adjusted_mode.clock * 1000; > - aclk =3D komeda_calc_aclk(kcrtc_st) << 32; > + aclk =3D komeda_calc_aclk(kcrtc_st); > =20 > - do_div(aclk, pxlclk); > - kcrtc_st->clock_ratio =3D aclk; > + kcrtc_st->clock_ratio =3D div64_u64(aclk << 32, pxlclk); > } > =20 > /** > --=20 > 2.20.0 Hi Arnd: Thank you for the patch. Reviewed-by: James Qian Wang (Arm Technology China)