Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2352601rdb; Fri, 8 Dec 2023 05:57:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHE4wguR0gxX0KGgZdR9MdfDGsomO9SzhMelibswIXMqEVQnce4jSEIr/scyOItKtkfrFGS X-Received: by 2002:a05:6a20:f397:b0:18f:c875:6b3b with SMTP id qr23-20020a056a20f39700b0018fc8756b3bmr15963pzb.100.1702043879653; Fri, 08 Dec 2023 05:57:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702043879; cv=none; d=google.com; s=arc-20160816; b=nRVbTAH1tj9zqjLnNbzi8WXFsooY3F3nSpM3imWYsttZ0L4rlgwmhY8nvDcU/BfB/F NUrMR27htRjTYWrNJydToz8JUbtCbzkrrQvVC0rlGJ6k4GACNT7PjG5dPFpwDKh45oU6 RkOgjm7TaXN6bxMQnbjvQtAb33PX6wBoqKx54xypy42BpMUqx2G8fQHnU+Vga4X8YFtp al9Y8Tz6lMqgzq8y71vwRSiYpPy8TkSfi+nOeDQ8jjtKbETgCAtUMIm06bEsRzmYXRRv mkzE+YupPcPp7sP4Xw5kK1/W+64e/BI9XY/+yDDYN60yKttKKBht7SgyCVkH2mJGqG3O 0kBg== 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:subject:cc:to:from:date :dkim-signature; bh=MrqRybEdVT8A2tD9/tSjTq1/b4GqQXKsJ/S+eqdnIIk=; fh=T1aOXec+VFwMn/B3KH71SAUF/W/nMMF2TdEKU9FEU0c=; b=Wb0SWWf2mUh/TgosrxoUtlCzXAVRBi1toW02ETvib3YtOr50fEzR1meYy5MpXC+09q uxNPnn5qVlJ3532JQ6UGTyTjAhv+fzqfU1GCyc4le0pTFf6IXQAW2UEjIldpaJRfqhYy qvt7fURZKQPRMGhU6Fvq/Uz0EXLWfE2zJFAjYGSoqUCfMYbDPV5mGSGjS8mS7KtgDyf/ DXxkrvULGUnORS/Dx39PkyEMuB8n3IBsYi5c7zcOWJkRs6zlE6u+ZwdsKBcYGhwlWBGI dO7oNTGM6EEQjvyBuErxjawll2aWvTGdo0YJtJfdD3K8Rx087aRKwWlSOrU6wrawz+6+ Z/cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=ZZuYyHHL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id b32-20020a631b60000000b005c1b316d768si1541042pgm.664.2023.12.08.05.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 05:57:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=ZZuYyHHL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 2C62C825A188; Fri, 8 Dec 2023 05:57:57 -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 S1573874AbjLHN5n (ORCPT + 99 others); Fri, 8 Dec 2023 08:57:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573857AbjLHN5l (ORCPT ); Fri, 8 Dec 2023 08:57:41 -0500 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D05C173B for ; Fri, 8 Dec 2023 05:57:47 -0800 (PST) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 53D19240106 for ; Fri, 8 Dec 2023 14:57:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1702043864; bh=MqMA5eXxYSHMs5eMUtbebE4rmWa8231Kz2vpnDkYL1M=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=ZZuYyHHLhfuqU7oGpQ1wR/NUVz/LV0NQ0JvJ3OCUKRvRHYt3qZJeKZJGapO+k6bxT 4BMEfqHWEZQZS/1SrMk2zIbqnnSbsq/hIbxDhr4nK/fqS88jsV7LmIIlAXFvOL6zge epAqHYvuvfAZkyZaSumezdLNFYXbNgU0k+nY/7+4RwT+lenrz99lXxVz9gTOBkwiN1 SHDf/omKx/qDRwIvhqoKm5OtWMoh8PZKg/glSAoqD3FRMIqeLxhBcr5qNs298WZ704 t9qZ3WCcptCTDT3Gdk15Pm+Q6TdfVD0Q5r3V5/03FKlqKyYFWe4uocjgCODxzEDfQk iZOOaTlI0JmzQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Smt4l2Gnvz6txp; Fri, 8 Dec 2023 14:57:43 +0100 (CET) Date: Fri, 8 Dec 2023 13:57:42 +0000 From: Wilken Gottwalt To: Aleksa Savic Cc: linux-hwmon@vger.kernel.org, Jean Delvare , Guenter Roeck , linux-kernel@vger.kernel.org Subject: Re: [PATCH] hwmon: (corsair-psu) Fix failure to load when built-in to kernel Message-ID: <20231208145742.6def047a@posteo.net> In-Reply-To: References: <20231208130710.191420-1-savicaleksa83@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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]); Fri, 08 Dec 2023 05:57:57 -0800 (PST) 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. greetings, Will