Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2259323rwb; Mon, 15 Aug 2022 01:50:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR5uZKj3k0sXdjY6KobE1DFZxZc/inuU38jsqjk40WnCtJDm+S9NPxtrfdQ+wgiyzC73T92J X-Received: by 2002:a17:90b:1d8e:b0:1f5:525d:4d90 with SMTP id pf14-20020a17090b1d8e00b001f5525d4d90mr26347537pjb.126.1660553409196; Mon, 15 Aug 2022 01:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660553409; cv=none; d=google.com; s=arc-20160816; b=l+FS3xwmH5tzwpsoew8aSaFmczxRw3WjkA6GuLsacur5x1KMRe4UJu7+MNuJ0BQtoi idzlrvdth272dc+dtt7du3qmCqCs6fqU4BNuYh8RtN4PI0GPjgzsi4+4p4snABq1TdSd tjBPqN7Xrf9DpaT0gIK1pUtbdFGBCUaArIuMLTsysKP9Fd/lXl25nAduY/9zqSw86PzJ VMtgW/a1W9a5sJPW2pFQJCYngsR+3I+KrPdxOABSSc8DHqW3n6abngMg/ub39oZJkCL9 jB8W4TRcluv8fw1vfCshA4wg/OUsEuWPDABzGGtA9XR44uU0UP0UksZSj96CykyNaXZ4 4ZmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=khmr8My1/aYtGWoyc1tu0pnFYFeZzQHpVSJzTcR8GWc=; b=c8Bzla7uPvILbRuZTLkJsoFL2Wqx/aQ7Ne3OGPwERA0nuZL9A2odZFNHj+FHKryZAg qUpH7Tm0jEwj6VM4NjULWJP+Pcc1NvNt0BkJQJubn3qet0zmAeB3UlXDoO4O1yfB0rUD Vlq5+dQIlKx8TKbk3DCMhmpHd1D+K8vJAtMD3uawjbzZO+1pWZbvI7oq9gdX8+ePURZQ WjjgtDmi2ks968S3qOxTLrfnhnkplaW1h6/XZCzSnIOgO+3Sx6PskzfWDWULqYU8jJ3S 0N1UvrS6yT6hQh3eCrc2NJKRImxC3Awi4m0QoPnz+misLc3OprFpc/pNot3tvCSLmzJu Yfiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=lhv2dMSx; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=WJ726LH8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y30-20020a056a001c9e00b005252be33906si8299478pfw.224.2022.08.15.01.49.58; Mon, 15 Aug 2022 01:50:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=lhv2dMSx; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=WJ726LH8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241365AbiHOHrW (ORCPT + 99 others); Mon, 15 Aug 2022 03:47:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232680AbiHOHrV (ORCPT ); Mon, 15 Aug 2022 03:47:21 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1029D1CFE8 for ; Mon, 15 Aug 2022 00:47:20 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 71C745C00B4; Mon, 15 Aug 2022 03:47:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 15 Aug 2022 03:47:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1660549639; x= 1660636039; bh=khmr8My1/aYtGWoyc1tu0pnFYFeZzQHpVSJzTcR8GWc=; b=l hv2dMSxbgNyYg+5kzn7scng8/sD8mR1YIAT42WGkQLmdEd+/I26aKgp3iW5tU0UK /OPloBRT0KQq6VdvkgOonbXByKBzTn7JRxY0WHbW2GemTEvI4ssjU/5l9OCZMCe2 sv/XubdZdrCOEXN/gluaGP1A8DYawbsbmd6GxAZSi878j4Q4t6r8ENxl0caE8emX fKfHdj28NOG8EYPQ/cxlWaUC0BZpeN/jyodroHHllcHjltxy9Fs2z1hQZ7nBZb/s ljU5irohL+FSoW9OnsH7xZ+evh045J1xG2GpJRCfcrj2Zg/aLpHZMcNFs0tyMJBd odkoAt7K25oTJhi5yBIZw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1660549639; x= 1660636039; bh=khmr8My1/aYtGWoyc1tu0pnFYFeZzQHpVSJzTcR8GWc=; b=W J726LH8dCVK/IiKs88VCwZbwbqIf51A1YKauLzBmfpMZtTIMz2lkcXg/hOXZnrVk OWrQN4Y38CkJSJ48jG59fwJ4c1iQ7wqdS+UOKEZ3QcijMJ1Q+D/EyPGoaufZTQnA IPT9lGgsMe6KLI17pIztTtFJjj/WayQb3CCtJMZER2dQsodLqnVzuPGrFZFOJN+e C9UDmHPorR6dfFmsQSWDr3UacvBZsfy/gtqJGsguBIyOslM1iOer80ThSPnhSuGL bmf2arvAJyoK8SerOJ9vGfdIR4XESosHwFituz9tYS6M+r4fBCjVqQ1AJJ2Rvs0d 1ks+e7y4Ja9As3jQi4VPQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehuddguddvjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhggtgfgse htkeertdertdejnecuhfhrohhmpeforgigihhmvgcutfhiphgrrhguuceomhgrgihimhgv segtvghrnhhordhtvggthheqnecuggftrfgrthhtvghrnhepueeigefghfffffeifeehud eiuedvteegueefffevgfetvdffheehkeffvedufeeinecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 15 Aug 2022 03:47:18 -0400 (EDT) From: Maxime Ripard To: jernej.skrabec@gmail.com, wens@csie.org, samuel@sholland.org, mripard@kernel.org Cc: Maxime Ripard , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, airlied@linux.ie, daniel@ffwll.ch, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH] drm/sun4i: dsi: Prevent underflow when computing packet sizes Date: Mon, 15 Aug 2022 09:47:14 +0200 Message-Id: <166054963291.173470.13302885096018416390.b4-ty@cerno.tech> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220812031623.34057-1-samuel@sholland.org> References: <20220812031623.34057-1-samuel@sholland.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 11 Aug 2022 22:16:23 -0500, Samuel Holland wrote: > Currently, the packet overhead is subtracted using unsigned arithmetic. > With a short sync pulse, this could underflow and wrap around to near > the maximal u16 value. Fix this by using signed subtraction. The call to > max() will correctly handle any negative numbers that are produced. > > Apply the same fix to the other timings, even though those subtractions > are less likely to underflow. > > [...] Applied to drm/drm-misc (drm-misc-fixes). Thanks! Maxime