Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5245548rdb; Wed, 13 Dec 2023 03:24:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGUENR5V0qMKxlkbOGH2a6LULsK2CSeJt/JPLTPHpIN+8o5NVcj7AZhi1y2ifTypZGZYHTw X-Received: by 2002:a05:6e02:16c8:b0:35d:59a2:9291 with SMTP id 8-20020a056e0216c800b0035d59a29291mr11307619ilx.37.1702466641357; Wed, 13 Dec 2023 03:24:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702466641; cv=none; d=google.com; s=arc-20160816; b=GZJjznZbVoKICU0pwPlKHlvROmrE8BQ0WNKBAc1EDkaVEU5rt9Cmdo+vDnjsSYIk1O 1Q2kDj3WeILWvcumwDQGnIWZeEidvzArGEwgbYMOUa2yISqVPdpWck81iSmQvqOCAe0V uf/6F0XY8m+4U+XYbnrVRh/CevNBwgrZwS059BUe1iogERUryqckJvmKJ0lvzEZfg1WS kc9FTsWuQhrN8LTQTLmTWbKuvBWpsW1USdYFpz0oo7NHug+/FkCtBX/AP6uZHG3yiG7s AF/9WcFmiPcOyTiFrksQUamp/MAX1WgAEVuUhrlz3jZSz9iCAQiGHKrEttoyoJWr/FtX EBvg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=3yY4KmLQpcYAsUmi3OX4hx3O7fOx5wIAS6KqRonuq5I=; fh=P1HXXq0BxLYW1m94xNAUm3Jxre+XSt0cRyPQK4zqmfI=; b=0qMg0F+Q2zhNwN8SLQsIR9eAQN8kwg7txpWp/3dtdERXNJ0edvWe4KGKMSlpJgU6bd ULJwOJfw7xwZQe3dMATdnUVNKxaw+xxOFxQDb9AI+YSB8mnWKkyP4AWfC4Gb/ttx1/k5 n/UOwxhqQFOsL1EVqX+G1RR9JNw/SOXBZHefUF7AYb/dGqrlkTtTOYKK1+GTzIbytpJe 1k/cCjTIMzA75+WopmwjPoykfAvFuUZUW53sJ+PM862lCC8Ld68BjkIEyhjj79LUEbWt yaXFM/SqZcnLjQMmvwyzUuY/hVz54MU2GPX4+ZCF+4s5jWxBQSMIYzyGU7a1/NjS1/GG kJXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kpQtbytX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id f14-20020a63100e000000b005c660a37af2si9643655pgl.255.2023.12.13.03.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 03:24:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kpQtbytX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id E1197804476F; Wed, 13 Dec 2023 03:23:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377480AbjLMLX2 (ORCPT + 99 others); Wed, 13 Dec 2023 06:23:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377428AbjLMLXX (ORCPT ); Wed, 13 Dec 2023 06:23:23 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67B04112 for ; Wed, 13 Dec 2023 03:23:29 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5B3DC433C8; Wed, 13 Dec 2023 11:23:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702466609; bh=dM20k1aIuurzuuEbrL9Li5fyjqQfBsAPeqrud2tbKNE=; h=From:To:Cc:Subject:Date:From; b=kpQtbytXXYBOTNSZ14250C8VyTOF1kOnoCHIm5KJngdLNB/P4RO4L1wDawKiBApHh nvlOCJZfBV/VT8307P0u/xe/hkhLnC87ehAUfYJfC+cPbckYGfuqAEbUgt0RpN5YFQ HvxEiOhmAiFNu+q32QQ7pbhzgPWEMin+xANEXcc8DQpNxOlH3brUB1B4FVt4ADx11n AXqYQC0YF7uIy/9nb/+fbe0PzS6yDurdvg7S0YHWomyg1UL89AQlqUKnCnGT7lnfko uZq0aV49rVfyFQew3RK+Nt5FEex8AWk3gHqjhrJRSggKG/0cxkTbumMgXQ2PDv58j2 l2FL63m7wcDag== From: Arnd Bergmann To: Laurent Pinchart , Sakari Ailus , Mauro Carvalho Chehab , Nathan Chancellor , Jacopo Mondi , Hans Verkuil Cc: Arnd Bergmann , Nick Desaulniers , Bill Wendling , Justin Stitt , Tomi Valkeinen , Shuah Khan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] [v2] media: i2c: mt9m114: use fsleep() in place of udelay() Date: Wed, 13 Dec 2023 12:23:07 +0100 Message-Id: <20231213112322.1655236-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 13 Dec 2023 03:23:59 -0800 (PST) From: Arnd Bergmann With clang-16, building without COMMON_CLK triggers a range check on udelay() because of a constant division-by-zero calculation: ld.lld: error: undefined symbol: __bad_udelay >>> referenced by mt9m114.c >>> drivers/media/i2c/mt9m114.o:(mt9m114_power_on) in archive vmlinux.a In this configuration, the driver already fails to probe, before this function gets called, so it's enough to suppress the assertion. Do this by using fsleep(), which turns long delays into sleep() calls in place of the link failure. This is probably a good idea regardless to avoid overly long dynamic udelay() calls on a slow clock. Cc: Sakari Ailus Fixes: 24d756e914fc ("media: i2c: Add driver for onsemi MT9M114 camera sensor") Signed-off-by: Arnd Bergmann --- drivers/media/i2c/mt9m114.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c index 0a22f328981d..68adaecaf481 100644 --- a/drivers/media/i2c/mt9m114.c +++ b/drivers/media/i2c/mt9m114.c @@ -2116,7 +2116,7 @@ static int mt9m114_power_on(struct mt9m114 *sensor) duration = DIV_ROUND_UP(2 * 50 * 1000000, freq); gpiod_set_value(sensor->reset, 1); - udelay(duration); + fsleep(duration); gpiod_set_value(sensor->reset, 0); } else { /* -- 2.39.2