Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp390590pxj; Thu, 3 Jun 2021 09:08:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3FWzNG2Vq/GcRxQXrHYxctjhg7GnKmOfNdvl9RLQEwShkheHZWB9z+2MC5Ym19SbOOaW7 X-Received: by 2002:a17:906:26cb:: with SMTP id u11mr100872ejc.385.1622736528148; Thu, 03 Jun 2021 09:08:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622736528; cv=none; d=google.com; s=arc-20160816; b=L/BiyEavVXQCJaaOQJKc3n51r3zkSwJU0vnrdS+kRuJMu+rDxA85YUHCDgU4IITfXM KcjlVUMGwxZYrBIHHkeUzFwDuZVMczBcuqM4a3KCf848rQIJPKyJ9KiYeHqKnAGzLeT+ U875Xwvl43l0YXdYD5tgiKaZNeTFi0I6A0KiovV06j5EK6nzhiIu5aMjM/DL0sMaedPc mp3tcb10VOFlJg5S6JL4nb/ivG94oaQ+QGBWPQ0+b6zdBrCG3kswFSwr3ElVEnd+TZ91 0yk4XFCm16kbD7jUjmvxOBgxX76UmMcJ8YfErskelahAEGcTwBqf5rQV4zh1OeHHHBfK ibxg== 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:sender:dkim-signature; bh=txSLEZ3LWB2jIP8GzWe1AjRD5to95FBD5hpn/LCQK04=; b=xFm8A1lH/ExG3CmAX5FiockJ1cj1sQLRnVkP1Cd2PTT6NWuv/dz+PlR7oABpEqpbX3 WblqNXXXrtHMiHl05pOmtNEl3c3nJWvVbFb39c68Gxzq3mpUEJQDHXAqLWD5/BBkmEeJ ijG05+sbZxGtS7C/IWUPLHMMWwOYJMdCLHzTA2JWOJI6yzwOzImZzuBK6hZl2/AX4JPS opiaLMO7+5A9l3LZszA1/eOG1fPLou6D3Zk5rVPqQ+BkYwz71Mh9gqxKjId27VRKZ/ZT vSnetx+hlQcia6QFtPEIvE/ytnchc/Bhg4TUdWaQnse8sEjxiLh6d5W7vaQFgX91hDh+ OufA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lMpo58oF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si2604837ejc.422.2021.06.03.09.08.23; Thu, 03 Jun 2021 09:08:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lMpo58oF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229752AbhFCQIV (ORCPT + 99 others); Thu, 3 Jun 2021 12:08:21 -0400 Received: from mail-qk1-f172.google.com ([209.85.222.172]:36436 "EHLO mail-qk1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229695AbhFCQIU (ORCPT ); Thu, 3 Jun 2021 12:08:20 -0400 Received: by mail-qk1-f172.google.com with SMTP id i68so2859255qke.3; Thu, 03 Jun 2021 09:06:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=txSLEZ3LWB2jIP8GzWe1AjRD5to95FBD5hpn/LCQK04=; b=lMpo58oFV+3bVYwWPZXQTPuHacJ2CaLzBoX2pmwRFphRqO1bJ+tV/2TwZXegjqpjGs fQv31J+fuiTBtUkwo7odXhBXHljfhbcwDX2i3f0Ff9R9s8ljeUHP+OLxfAcT/Vq4z7xM Di6eX7KjunGFxGymiwMMYUy7j/qMVi7e561n8E+G9CXZbVJZKes9G7dYwYqWAPxa++q9 g6sxZqY39AD28CU7HytMAAKP2tUaA/4OUSSsA3dnYL0/HlNVngoMDimcvCWWCz5+RXkf cXZHCD2w6w+/2jWYZxflIGbxiitt52SzycKMZ7ew/bBNAGBntVDK0sCWPmsQ7slHNdnF NHng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=txSLEZ3LWB2jIP8GzWe1AjRD5to95FBD5hpn/LCQK04=; b=gzDmv9FGzcWRiSTMlZ9kZV/rSCj/CSK6htPh29uysgjT4wk8TQzhuzLAMC0Te1yBhN qm2oT9FY+pWaD4CS75/a/LlX4br60+mfvgDbw++iy2nvCcH0ULBC4+dkbT1TE1Ph6OuB rciZppN0fEas5EfjZ0718cp4OqaQxR8OtZ78aKNP9tbfQEUtk4gHJafw2ERIuXpF7LD1 Sppz+LSErxM6z1Bu9w9UHs5B/ZfWsA+X702fm3SR4aGWskYdLidWYc6AE4hBdhjGFHOu MAygb4RQP7B8/jXwTXtIxzijQh7aQRgUrbQuJC55MRo96uH7ulkKa+rErMW8Z2h4I+44 CJDA== X-Gm-Message-State: AOAM530CV7ilHETqcYlL7eihBZJ9ymbLwRNhF6fLrGPTDDeXdU1aBR31 44xPd6jq2MyadqL187Vc8+o= X-Received: by 2002:a05:620a:14b5:: with SMTP id x21mr330423qkj.336.1622736335423; Thu, 03 Jun 2021 09:05:35 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id l3sm374231qth.87.2021.06.03.09.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 09:05:34 -0700 (PDT) Sender: Guenter Roeck Date: Thu, 3 Jun 2021 09:05:33 -0700 From: Guenter Roeck To: Wilken Gottwalt Cc: linux-kernel@vger.kernel.org, Jean Delvare , Jonathan Corbet , linux-hwmon@vger.kernel.org Subject: Re: [PATCH v2] hwmon: corsair-psu: fix suspend behavior Message-ID: <20210603160533.GA3952041@roeck-us.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 03, 2021 at 11:51:02AM +0000, Wilken Gottwalt wrote: > During standby some PSUs turn off the microcontroller. A re-init is > required during resume or the microcontroller stays unresponsive. > > Fixes: d115b51e0e56 ("hwmon: add Corsair PSU HID controller driver") > Signed-off-by: Wilken Gottwalt Applied. Thanks, Guenter > --- > Changes in v2: > - corrected fixes commit > --- > drivers/hwmon/corsair-psu.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/hwmon/corsair-psu.c b/drivers/hwmon/corsair-psu.c > index 02298b86b57b..731d5117f9f1 100644 > --- a/drivers/hwmon/corsair-psu.c > +++ b/drivers/hwmon/corsair-psu.c > @@ -771,6 +771,16 @@ static int corsairpsu_raw_event(struct hid_device *hdev, struct hid_report *repo > return 0; > } > > +#ifdef CONFIG_PM > +static int corsairpsu_resume(struct hid_device *hdev) > +{ > + struct corsairpsu_data *priv = hid_get_drvdata(hdev); > + > + /* some PSUs turn off the microcontroller during standby, so a reinit is required */ > + return corsairpsu_init(priv); > +} > +#endif > + > static const struct hid_device_id corsairpsu_idtable[] = { > { HID_USB_DEVICE(0x1b1c, 0x1c03) }, /* Corsair HX550i */ > { HID_USB_DEVICE(0x1b1c, 0x1c04) }, /* Corsair HX650i */ > @@ -793,6 +803,10 @@ static struct hid_driver corsairpsu_driver = { > .probe = corsairpsu_probe, > .remove = corsairpsu_remove, > .raw_event = corsairpsu_raw_event, > +#ifdef CONFIG_PM > + .resume = corsairpsu_resume, > + .reset_resume = corsairpsu_resume, > +#endif > }; > module_hid_driver(corsairpsu_driver); >