Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2421916rdb; Fri, 8 Dec 2023 07:43:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IEIJjQv1jGVAmhtDauXx/kRwEItmb8H+rOQKabI9p8sa+u9FoQq+Rm5rCWUq/DE0CPmAYha X-Received: by 2002:a17:90b:1801:b0:28a:2692:fae9 with SMTP id lw1-20020a17090b180100b0028a2692fae9mr232995pjb.82.1702050200042; Fri, 08 Dec 2023 07:43:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702050200; cv=none; d=google.com; s=arc-20160816; b=b1snPY5RVjc1jK8SRH5TmsXCniTNiqUNxVhkCAW1Rx/2nyUbeZQh4BfrXNwFzx9j4I TIg6VSNHrMJe3n1NRKyLLuq7M+jR2oaxSKMIAcKWaj5iM6GibxgOXmxW5FD/ee/MnLpb I042E5yLOM5aID72zIFJJPBeka8A13PPfffBf+GY03sgFa4OCayzSH+yTMB58Q5UT6Si K3fFMMJOt+pL/eU/Nwu1VNq/tJG0GrqfjSaeq9bpDBHZ/38AwaKp8/Pa8Er+EPgnDX3Y OkXQLOTcTs60+7sHMAknodeKWo/gu1xw3Eo77h4JwOmaNFr5oTjvcl/IzdS1PUNsjU63 mXIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:sender:dkim-signature; bh=WdZ6XGEPzhT5jj/IPHXYwoO9J2EgJOhsZV1HjQOLiWk=; fh=LQ81olhz+1X805lyJdqNfPV48YRHV8kgiiDF4am2fWQ=; b=xxBRc8G0eIAMZTRKo8Xkw3vyRO4sRG7AXOBB/MXWzWTpe5uSG3hp/Z0NWSjD8VTLNU 1FIhxEAmcK+ukWkaqsQIjP7sFeI+hC0ExnLbrEgdtYGOwy35SXE5YTi4yNpLp0BjSWSK nRnrsIJRDJnZ9qn7vGoNsxl9/Y5dxa/oTT1qh3mBTftyX0AFUBpV4o88G2zoumdgBdBq X05P4JROO1aB+IM8PD2yThq9anKGjfI9V+lZ2vExhnd06tO5dLJuhSK9LIe7urv4In5l oYr3VU1dgekKHRdVdRNgVOIGb76XcmUVjtaVI97Qh+z24wtXDTI1uxmCNEKrn/QiyIN0 /2Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WLt7FeaC; 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 Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id kb4-20020a17090ae7c400b002871b0b4a11si1887853pjb.61.2023.12.08.07.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 07:43:20 -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=@gmail.com header.s=20230601 header.b=WLt7FeaC; 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 Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A73118133C9D; Fri, 8 Dec 2023 07:43:17 -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 S1574379AbjLHPnE (ORCPT + 99 others); Fri, 8 Dec 2023 10:43:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233564AbjLHPnD (ORCPT ); Fri, 8 Dec 2023 10:43:03 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2DB810EB; Fri, 8 Dec 2023 07:43:09 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2851a2b30a2so1840592a91.3; Fri, 08 Dec 2023 07:43:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702050189; x=1702654989; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=WdZ6XGEPzhT5jj/IPHXYwoO9J2EgJOhsZV1HjQOLiWk=; b=WLt7FeaCRmjoXsyorS5u05JlruCGkrn4NaWJ5a1wUihAXZixxWrq2dkzo8gcdxUsgb kIDQ8j6zN3snZkumYCym3j8Un86bpCiPqLT+vsPorhPSeI1tjJPfSiIRLCcMFsGFcRO9 2E4oiyeo7jpMfOGXrfw3WOH7kc+loF2YEpHwC8FrpS0P2RAa6lVENgjObXWjY3c9fJf5 l4BkitoLorCRHrn2GqVDVAo23bv9EkA2cAdpijFvRN7DvYS887p/BC9z8MVxAkBpozbO NBx1cwtq13fWSGy8nU3/LT1ueEd0GNZ0rhqPO+63fyv66p1RLjqKmuB5X8IlMSHZJNLc AaJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702050189; x=1702654989; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WdZ6XGEPzhT5jj/IPHXYwoO9J2EgJOhsZV1HjQOLiWk=; b=LhduWvQfvtQic8q1mGbqKK/Ih6wlBian4fEUtbCChyg4Gc0EpkrEAgbb2lbO2UEh/p RM1kawAgzN+yEmEYk9C0rknUWAuD0ohSd/gOcd10M0vwStuJQAhXDT1cSwnplL4rq7cG tqhSEgbTLJnur7S+zMsQMlaTXPOg1iRE8f0+v4tZrKonrjRN6J3ds30GHnpDMzsbd1rL JF1OAse82vUJPO0/dC7ArQqstNoyDbN3U8GQeEhHvAreo6cmb6ZTWVpKPjvL0P8aV0mL RjxJfq14BWWJBoyZIDCxlY7tIP3Dt9k35h6S6Co15/37Fh7QXaQ0Orm65odawNdcNvXV h5wQ== X-Gm-Message-State: AOJu0Yw9gg0o3m6b6gwwVSGbPg81HDLJD0Wsh7ZOYqdeBfb318piJMeI 4YlRQ1+adrBTdO6edYc4GXg= X-Received: by 2002:a17:90a:df86:b0:28a:464d:5ecb with SMTP id p6-20020a17090adf8600b0028a464d5ecbmr268789pjv.36.1702050189043; Fri, 08 Dec 2023 07:43:09 -0800 (PST) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 26-20020a17090a191a00b00286e69c8fb1sm2122269pjg.52.2023.12.08.07.43.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Dec 2023 07:43:08 -0800 (PST) Sender: Guenter Roeck Message-ID: Date: Fri, 8 Dec 2023 07:43:07 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] hwmon: (corsair-psu) Fix failure to load when built-in to kernel Content-Language: en-US To: Wilken Gottwalt , Aleksa Savic Cc: linux-hwmon@vger.kernel.org, Jean Delvare , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Jiri Kosina , Benjamin Tissoires References: <20231208130710.191420-1-savicaleksa83@gmail.com> <20231208145742.6def047a@posteo.net> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/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/T0HQpmiPTqQcIaG/edgKVTUjITfA7AJMKLQHgp04Vylb+G6jocnQQX JqvvP09whbqrABEBAAHCwWUEGAECAA8CGwwFAlVcpi8FCRmg08MACgkQyx8mb86fmYHNRQ/+ J0OZsBYP4leJvQF8lx9zif+v4ZY/6C9tTcUv/KNAE5leyrD4IKbnV4PnbrVhjq861it/zRQW cFpWQszZyWRwNPWUUz7ejmm9lAwPbr8xWT4qMSA43VKQ7ZCeTQJ4TC8kjqtcbw41SjkjrcTG wF52zFO4bOWyovVAPncvV9eGA/vtnd3xEZXQiSt91kBSqK28yjxAqK/c3G6i7IX2rg6pzgqh hiH3/1qM2M/LSuqAv0Rwrt/k+pZXE+B4Ud42hwmMr0TfhNxG+X7YKvjKC+SjPjqp0CaztQ0H nsDLSLElVROxCd9m8CAUuHplgmR3seYCOrT4jriMFBtKNPtj2EE4DNV4s7k0Zy+6iRQ8G8ng QjsSqYJx8iAR8JRB7Gm2rQOMv8lSRdjva++GT0VLXtHULdlzg8VjDnFZ3lfz5PWEOeIMk7Rj trjv82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <20231208145742.6def047a@posteo.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=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 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]); Fri, 08 Dec 2023 07:43:17 -0800 (PST) On 12/8/23 05:57, Wilken Gottwalt wrote: > On Fri, 8 Dec 2023 14:11:44 +0100 > Aleksa Savic wrote: > >> On 2023-12-08 14:07:10 GMT+01:00, Aleksa Savic wrote: >>> When built-in to the kernel, the corsair-psu driver fails to register with >>> the following message: >>> >>> "Driver 'corsair-psu' was unable to register with bus_type 'hid' >>> because the bus was not initialized." >>> >>> Fix this by initializing the driver after the HID bus using >>> late_initcall(), as hwmon is built before HID. >>> >>> Fixes: d115b51e0e56 ("hwmon: add Corsair PSU HID controller driver") >>> Signed-off-by: Aleksa Savic >>> --- >>> drivers/hwmon/corsair-psu.c | 15 ++++++++++++++- >>> 1 file changed, 14 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/hwmon/corsair-psu.c b/drivers/hwmon/corsair-psu.c >>> index 904890598c11..48831a528965 100644 >>> --- a/drivers/hwmon/corsair-psu.c >>> +++ b/drivers/hwmon/corsair-psu.c >>> @@ -899,7 +899,20 @@ static struct hid_driver corsairpsu_driver = { >>> .reset_resume = corsairpsu_resume, >>> #endif >>> }; >>> -module_hid_driver(corsairpsu_driver); >>> + >>> +static int __init corsairpsu_hid_init(void) >>> +{ >>> + return hid_register_driver(&corsairpsu_driver); >>> +} >>> + >>> +static void __exit corsairpsu_hid_exit(void) >>> +{ >>> + hid_unregister_driver(&corsairpsu_driver); >>> +} >>> + >>> +/* When compiled into the kernel, initialize after the hid bus */ >>> +late_initcall(corsairpsu_hid_init); >>> +module_exit(corsairpsu_hid_exit); >>> >>> MODULE_LICENSE("GPL"); >>> MODULE_AUTHOR("Wilken Gottwalt "); >> >> >> Woops! Just saw that the same fix was sent yesterday. Please disregard, sorry! >> >> Aleksa > > It is fine. I just start to wonder if there was a change in the subsystem. I > used the driver as built-in in the past for several months and never had that > issue. And now it is a real flood of reports. > Maybe there was a change in the build order, or some subtle change in driver registration code. Question though is _when_ this changed. It would be great if someone could bisect it. For example, bus registration code has been changed significantly in v6.3. I am copying linux-input and the hid maintainers for feedback. Either case, I now have two patches and at least the first one was actually tested, but no Reviewed-by: or Tested-by: for either of them. While that is of course a formality, it would still be useful to show that it is not just a random change. Thanks, Guenter