From patchwork Fri Aug 23 09:39:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Yufan X-Patchwork-Id: 13774843 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 60790C531DC for ; Fri, 23 Aug 2024 09:39:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C8A110E106; Fri, 23 Aug 2024 09:39:46 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="kBVLMXNl"; dkim-atps=neutral Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2044.outbound.protection.outlook.com [40.107.215.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 73B9010E077 for ; Fri, 23 Aug 2024 09:39:45 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wZOjtPiMufkP/1vNKYT8UIFhPkjHUOZbiAUF3Y1Ywzdv8DuP07QJIyCYJDIpWkKvtJLsZMpOsW4m1rWSeZ0lbCNcQRQr8XTd52izvC4AOeNtMWdZGajoakvfuTx3FDUdj5V/yp+XuDlqUaptmo4AmDEcpXeb9L1QvAir8e2tW93gjbOmKFq1bFXiouddO05lsm92xg6yT6S+zsjhiIrEBJxmkPOaDjv//GSvud1sUt782+hO+AYkzwcptrMwxP0VDqBQEd1UJe7PF/yhvZHgRnIrEPSQQjVA+b14FrSg2XNydcQy1ldHB3g88CYX/5TC01VRIfyFUq2XikiKgfuGgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=GwL98ugu5Ie/LZn6olQZuUJVBBalWRKRMZWGDyzjZPU=; b=n2hctopDxtYLH6AvZX7eX0byCe3WCOg/swFQXDjKPJFYXBn8yyC4XArwy5HXcxmbY01tipwdFrMjZ8IQeAz+smxklgIv8hcGjSKiVIhEMUJ5yZYrXGWhYPm1lVjKtHpA+cBOX9ssDcbLGRF9B8HhuqydFis6Vtlo+KxYyO/gufJedDDXgLLR3VApn0RZR6UAPe5acpH7tzMLEciudivMgvS+fgShUYdU67CuuZ72vrugsx8dLe5PwBZAA9PzHeDW6566uqf8o8/hykVy7O0OD9UpjuFlgcvGm9N7L3HdyjpJQ5i9IHEfTSDLBB2QfaXgLkFtABWJgTHrLBvJIRGvBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GwL98ugu5Ie/LZn6olQZuUJVBBalWRKRMZWGDyzjZPU=; b=kBVLMXNlYHBYc+vBRFCJFqKdvU7g3Xov+kr6xfX4vIIefn8lb1ZcL3178OWFCg95fJE8+bZITI1+YZgCAw0h/kp3KWuEy3ikdyZr6YaQu/ADyuy0OAUDf6Nx1vEAUevT48K+Bn98ZUwKAqhUZLYykxF9f7QVOGlIQn1e2ICzn4yQ8o75F3Sm7EdNaFy+rAqyA/Nh2lYk4P4/kkxb1HqsON5FowYh4K7ZZjbWvRpPhNWKfVH/XrZq96eCw4rRSYe8LZcviamOaw0XO7rJHglkF0en428ckNLiZ7oGYkIUa32hQEFheu6Pmu+ZWQx+vzT3khf0PLIzQFLVTSlV/jZdqA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from KL1PR0601MB5487.apcprd06.prod.outlook.com (2603:1096:820:bf::14) by TYZPR06MB6637.apcprd06.prod.outlook.com (2603:1096:400:451::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Fri, 23 Aug 2024 09:39:38 +0000 Received: from KL1PR0601MB5487.apcprd06.prod.outlook.com ([fe80::2129:59e5:6c67:311f]) by KL1PR0601MB5487.apcprd06.prod.outlook.com ([fe80::2129:59e5:6c67:311f%7]) with mapi id 15.20.7897.014; Fri, 23 Aug 2024 09:39:38 +0000 From: Chen Yufan To: Frank Binns , Matt Coster , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Donald Robson , Sarah Walker , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Chen Yufan Subject: [PATCH v3] drm/imagination: Convert to use time_before macro Date: Fri, 23 Aug 2024 17:39:24 +0800 Message-Id: <20240823093925.9599-1-chenyufan@vivo.com> X-Mailer: git-send-email 2.39.0 X-ClientProxiedBy: TYWP286CA0030.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:262::20) To KL1PR0601MB5487.apcprd06.prod.outlook.com (2603:1096:820:bf::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR0601MB5487:EE_|TYZPR06MB6637:EE_ X-MS-Office365-Filtering-Correlation-Id: 6a7658e4-378e-4923-8d0d-08dcc3578171 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|52116014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: 4g0ceeOC3i4quCIeFI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x6LAtk7435WKHhexrF5zcxdiqD3MdM0fSV8lgRhg1gv/LKWRlhGTa3+qaWc0xRW6jcYrzV07AK9OaUlr7PVPwnH8hKtzc9rTDkDpU1514OSLwCnMmZBhQXU7dFULHfU0nZ3cjUt8QIU/MBZEB6CEFWW4D26Fz+I6k/oa+5j2F3GUrtoOu9SoAdvMgdCcuQBV09maQGO/Lj5NgOQyoOD73M+J+mzTYc8pDj3dD8dpDeBF4bIyxzd26z80r6Ghy+WXq0sGSFDD8YLjri7yv8Gpn3CnEU0VnSATQMD5vhrn/uHsb/7Sy1uS4kDqnyjP3xSFCP2hM4QiPrevUepj2gb2GYR8IF0kcI+8yMYK8qob44l4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:KL1PR0601MB5487.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(52116014)(1800799024)(366016)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rpV8FaBNJDgqdOeawGpPk0wgNILv+yvQMUnY65QtBKfrBs8cFTdxITiYfEczaOlMK5xJeYS9lGnuuYFvTcyKBuumsMw/pRX2DTkyAmy03u3/I2ax3lwGqvP4QlBefkq2xZQJ6pq7Zz7rWGkk6zyjRRgHRzbIyXJRlYuxI84YbRHZFTdXgfPGvEeVmMuC6fyIFma2ouaifTSD4k09CQVl87XLHBt85VYSvIM0hpImFrp3uX6ck8oYdxxLvTJaYCZqk8XmUsubsbkFK2GPeWUPA++1bputAFna1A1x9T2nosDu3jlayJvQp2Ld+3ipbZ8NhWgXucUqfRovf9LFedT4wfB3TfM/vwNjU6PDfWPIIU1t88Y8sUg4o/iRqf3lTQP6iLcSObtFt+q9v9EdfmSdkeBUKxha9VBoSN/oaiug1xVdmyhbKQLV87E2ootppVOmn0jEa2mzFYiS602MShs8PnUzlPIDSwB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ekddbl6f2FDPYwByQ0HcNwEPTo3sgwrtiOyVl X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a7658e4-378e-4923-8d0d-08dcc3578171 X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB5487.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 09:39:38.2831 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: V8+Nvpmb7iTAcK0aKLjTy/CwtRtpNdBY8f2dM0T2fC9005lZHO2Dn+Xdu5pPmV+4NIcCx5/eElPrmOUAJrT1GQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6637 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use time_*() macros instead of using jiffies directly to handle overflow issues. Fixes: cc1aeedb98ad ("drm/imagination: Implement firmware infrastructure and META FW support") Signed-off-by: Chen Yufan --- The modifications made compared to the previous version are as follows: 1. Change the prefix of subject. 2. Correct fixes. 3. Drop the cast of RESERVE_SLOT_TIMEOUT. --- drivers/gpu/drm/imagination/pvr_ccb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/imagination/pvr_ccb.c b/drivers/gpu/drm/imagination/pvr_ccb.c index 4deeac7ed40a..b7d5f9ca3ca6 100644 --- a/drivers/gpu/drm/imagination/pvr_ccb.c +++ b/drivers/gpu/drm/imagination/pvr_ccb.c @@ -321,7 +321,7 @@ static int pvr_kccb_reserve_slot_sync(struct pvr_device *pvr_dev) bool reserved = false; u32 retries = 0; - while ((jiffies - start_timestamp) < (u32)RESERVE_SLOT_TIMEOUT || + while (time_before(jiffies, start_timestamp + RESERVE_SLOT_TIMEOUT) || retries < RESERVE_SLOT_MIN_RETRIES) { reserved = pvr_kccb_try_reserve_slot(pvr_dev); if (reserved)