Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp199478pxj; Thu, 3 Jun 2021 04:39:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuLWQrJRyE3qi88ssmTHzF1LSP75LhkTARQ8yF9X8VCYK0+lU589OJEiKdWU1VFZTUloKu X-Received: by 2002:a05:6402:b1a:: with SMTP id bm26mr3264956edb.387.1622720384623; Thu, 03 Jun 2021 04:39:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622720384; cv=none; d=google.com; s=arc-20160816; b=e+TZuXBiIpbR7QjEbnxKzNxL6JSIkoLM/NsBgviOUB+nwiKwhNl7T5Gwyi1xjpna4y g/KngQX9XePkb2HhJWRhgSqFkFubb+WS9fqsQhQWyHhoO/yW0CJSorpYFEqBKk4AN3sj R0WRFlopqqrSmNyJYqLZjcYzRskmhq6hAnZ8MX5nh9Xjk+n2EoqmAM8QuWiNGAoqmm3i kDKJ0iK5Q0MsNbsvd1Eh5Mrn3RKA5g84rZ5nPk/Gr34/CUdcn07Zj14rrV6hxwzHOmeg l+bs+WmkoyB2Spx96t0BHD461X4k+j5koV+0VQVL3fxJNbgeRKgpeh2QXOTMIl+IS6Hx xJ4g== 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=r6ydmvdX8y7zmVqNRg3SF59KUVJeh1Y6FzMbcPW3jGs=; b=ysUdGS9+yRBEv3SWlekno1cFtHqA+GRgqLEjLSYplnZu3xejBucQ/hwsKdQHgaU5Aa OTJs6yS2NtJK0mmaFyRHCd5LoLqhAsZkR4ZATH5fk3OCqwRMqCiHpE2fFc9Ru080SdHU 6FrFENU17Kkd42sFFcbaJHKr4EkfoeqoTKoenNN3kWtvDfDblgatZ8BdJUaoJP6ITXp8 VwfIdde11XSHg2nR0Ruoq8AJWhz0Q1uf/D0Ls8JHSuS1jIIIE5S6hDmS+slZGr2Gulzh nBpAkFxNVGdWbfParlmR4XT7bP6UUBzKX4d/x66AQvvr6oo4lvjtxgiXdA10KHyEwAP+ zyLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b="NfpaM2/5"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f22si1978201ejl.264.2021.06.03.04.39.21; Thu, 03 Jun 2021 04:39:44 -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=@posteo.net header.s=2017 header.b="NfpaM2/5"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229747AbhFCLjN (ORCPT + 99 others); Thu, 3 Jun 2021 07:39:13 -0400 Received: from mout01.posteo.de ([185.67.36.65]:44709 "EHLO mout01.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbhFCLjN (ORCPT ); Thu, 3 Jun 2021 07:39:13 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 16F03240027 for ; Thu, 3 Jun 2021 13:37:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1622720245; bh=VK9fcZ01IcuMVfo0nR6TgCfnH/EpeC6PBFr09prL+wo=; h=Date:From:To:Cc:Subject:From; b=NfpaM2/5AzJ+pUQZPRGmwWglg4v3KQL6Q4v9R3ttshNBMoJiWfAzvt6wyVlnKAEFX 0ePlClXc52Z2uFPL6/fAl1KaOiHYqoEmZxsbbQc0GsWkfVgMFXCF4VoGM6hbPnd+p7 8KBwIrSy6q22B8gDcgGiqj3WcJBwLAW2nYDtX7IUJ+rNgbjjnwi61JreAZ6wcLEpj4 cHMeJ/zOWd02STMVxTk1bmtjdxaQQ3Mdl/0xwyZMFN7lH18va9bD3/k7qWGKuCmXS0 8ZzS5hBXRM5UKKKy6UL/0dh3JMMmjSCJ+PcrmarGQbHEOeRlHTnpKT6sxjqgWXoa3n 4vd1y49Sz+hRw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FwkQX16CMz6tm9; Thu, 3 Jun 2021 13:37:23 +0200 (CEST) Date: Thu, 3 Jun 2021 11:37:23 +0000 From: Wilken Gottwalt To: Guenter Roeck Cc: linux-kernel@vger.kernel.org, Jean Delvare , Jonathan Corbet , linux-hwmon@vger.kernel.org Subject: Re: [PATCH] hwmon: corsair-psu: fix suspend behavior Message-ID: <20210603133723.1cf62b93@monster.powergraphx.local> In-Reply-To: <20210603104156.GA644104@roeck-us.net> References: <20210603104156.GA644104@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 3 Jun 2021 03:41:56 -0700 Guenter Roeck wrote: > On Thu, Jun 03, 2021 at 05:23:38AM +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: 726c945ab2eb ("hwmon: (corsair-psu) Remove unneeded semicolons") > > That seems wrong. Removing semicolons doesn't typically introduce resume bugs. > This should fix the patch introducing the driver. Oh yes, you are right. Wasn't really thinking about it. I will send a proper patch. greetings, Will > Guenter > > > Signed-off-by: Wilken Gottwalt > > --- > > 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); > > > > -- > > 2.31.1 > >