Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5173568rdb; Wed, 13 Dec 2023 00:33:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IF76IjHrermN1FVqd2WrZOJejyskbGL+h8fIahEDBjW8BUiB7OA1iD9j93ItyKzIOQMFDtA X-Received: by 2002:a05:6358:528e:b0:170:f4b1:a420 with SMTP id g14-20020a056358528e00b00170f4b1a420mr2011744rwa.14.1702456387268; Wed, 13 Dec 2023 00:33:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702456387; cv=none; d=google.com; s=arc-20160816; b=WGGhk0hwJgpb3XeWDr62L5gH6RPXnTB5AezCbkUJVkPb2rDhE8oLQ1z3PHxv91LLGA 932Xl3sBzyAR+/gzWE1vl5tp9fPHG+eGn5phv12wGQwl7AZy4jcfcpp774G4SY+ngvut /g9Hi6WTybMlcH5mZppB5/VwU88wFU7rfuJzgmDoiLn7oev/sSLgdUdkm4PGyB2lreQk 6Qzouzg81RIgZEatjg5egQ3tsdREKZUupAVJYif5/Hw98AkLCTMNvmdc9+q3z8FIAM/W yh/lmmO+9lPs+cCrZEISipfS9kevlw/gkTtrIdU0ltFFqRV/Tgs+hosFbFnfPH1oEBpU Xqyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0pfk2YH8Jj0bGTqakL/+eghqRqxGZxWIJdAGVYObAwo=; fh=USulhy/5pgbuTJQeaTUI+1ii50sve9LpBskFirQLujs=; b=HhFigKJHZXDKIUrk1uImVDUk9JdCLlvsbJtH5Pmv/LKnlaBxgrN8gv5cxr183S6ZU5 AnqQzf9fH9C2xWOoGwxePRdPYp/WsTgXzEGdyEPTPhpXSWnXMoL2dfD4nT+ky76n8DQ1 TrbiIW0G5wAx/pu7ZlbsS1s3SgTlMEci6TDO3hNu3W44qR6FatV5TcDZflBzwlCeLjIw Qv1NWM5O53li+BEaVEpOqjnGtCSYuCPNnXhNH6OuqpS4fSA/CQEBbHrnqfawc+Vvwhqe 2vnFaD4ePlp0h5zr/jZemXoZLbqJY+4PFUdK0xz4P+8Ey0FoxXQqiqYFTH9uylJo6CXx jP5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=I3siDL0L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id d7-20020a170902cec700b001d065c68f06si9332879plg.494.2023.12.13.00.33.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 00:33:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=I3siDL0L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 859E7807833E; Wed, 13 Dec 2023 00:33:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231756AbjLMIcu (ORCPT + 99 others); Wed, 13 Dec 2023 03:32:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbjLMIcs (ORCPT ); Wed, 13 Dec 2023 03:32:48 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B31291; Wed, 13 Dec 2023 00:32:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702456375; x=1733992375; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=yOuFqDFHt/+ICo+bJ6KPeRzo2w2uLCAeNLAy7AYJyLc=; b=I3siDL0LP/BNgs/qXCNlrlAf9lEY6hZVGeP762/QupngrwuvP165Aa0Y ettCHHlhOOKyvy80lKTxw67f1zI4P62pC7KLVTfCvJVIriL719vRnhci1 Gk6EwdBZG+ydNmoJcnGQTHrcxyG9u37VQLLBMqoOwiyxgQ0KEKXx/6A7b AEbsXm6tgi5e567Ahu7cG9blLa5MXQRcFVeTsgHH0e+NcBkN4d8qlAXFj jIJ/ET7T14Loxz8BzQq3bHd+Qi9Z2t/ZLyayFcwBnHAwGP+lNb0Z/6DLk 6YRCIpMUElsAmruS6wmEXDLlbp6lZ1YyrWMA1j4TSG4yJVlFcKJ+GMZQ5 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10922"; a="461406817" X-IronPort-AV: E=Sophos;i="6.04,272,1695711600"; d="scan'208";a="461406817" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 00:32:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10922"; a="1105234999" X-IronPort-AV: E=Sophos;i="6.04,272,1695711600"; d="scan'208";a="1105234999" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 00:32:50 -0800 Received: from kekkonen.localdomain (localhost [127.0.0.1]) by kekkonen.fi.intel.com (Postfix) with SMTP id 55A7611F7E4; Wed, 13 Dec 2023 10:32:48 +0200 (EET) Date: Wed, 13 Dec 2023 08:32:48 +0000 From: Sakari Ailus To: Arnd Bergmann Cc: Mauro Carvalho Chehab , Nathan Chancellor , Jacopo Mondi , Hans Verkuil , Laurent Pinchart , Arnd Bergmann , Nick Desaulniers , Bill Wendling , Justin Stitt , Hans de Goede , Tomi Valkeinen , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] media: i2c: mt9m114: add CONFIG_COMMON_CLK dependency Message-ID: References: <20231212213625.3653558-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 groat.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 (groat.vger.email [0.0.0.0]); Wed, 13 Dec 2023 00:33:04 -0800 (PST) On Wed, Dec 13, 2023 at 08:09:03AM +0000, Sakari Ailus wrote: > Hi Arnd, > > On Tue, Dec 12, 2023 at 10:18:04PM +0100, Arnd Bergmann wrote: > > 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 > > > > Avoid this by adding a Kconfig dependency that avoids the broken build. > > This sounds like an odd way to fix an issue with udelay(). On which arch > does it happen? Wouldn't it be better to fix the udelay() problem in the > source? > > A quick check reveals there are about 2400 files using udelay. After discussing with Tomi, I think the driver could be improved, too, by adding checks for clock frequency and avoiding an obvious potential division by zero if clk_get_rate() happens to return 0. Switching to fsleep() would probably address the Clang 16 issue, but that doesn't seem to be the primary cause here anyway. -- Sakari Ailus