Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp166983pxj; Thu, 3 Jun 2021 03:46:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1w1bi6n4wMRM9PisJkD2/wxXt3c0bjpbHiMRnZewSvX6Ni/SqbbH6MxOghbJDff/MUe4z X-Received: by 2002:a17:906:e104:: with SMTP id gj4mr25624156ejb.350.1622717209407; Thu, 03 Jun 2021 03:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622717209; cv=none; d=google.com; s=arc-20160816; b=OS7HD9IFUuDTHB0vNK9znZCZ5n/d5IvMmDgwd8SphpL/WI8PVwtNLnlzq+7Zp+mZR5 uXsCWr1dHMsj3bAe/+yOg2R7M4F0bUBWFeCDzeeDCnQirTVHz/OabHndVxUlEX8T4+WF UkeRnxoNamZUwqJaALcwDbeKjpY16P8n7cjT067H5pzF5uCL4Wf6NBDn6yfHguGpQz6z vaK2xCHqr2yjzEYQBAmGzaEIurAqgdl3BxzwG4UgDcwmHlJdtvy3TPBHsIafgRAhKRuC NxjbUWiAmgvJFFQw0ZUA2SgG9kG3+1fMAi3w+eHt61hcypg3bVSIkp6L9SrYA4chXxNy GzLg== 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=qZA/yEU8XYY+hN6SkfwGwA9NjKTQyXMkIE8P1Ry807Y=; b=sbSkASwjTYRhKpZlgqPvomXjxu/xdpBKqEnsuxEeHiLMjt0lv0P6LzNQe9NdR6H1Dm yBFQZoHAx4BndA6iN701XXI0JFVc6xUdZLPaYvxzi0v5D/7Hx/7v/IP/x54wQhzIdb3n yzSJizQoQ2Cn6sBPKdQOSpDhxO3L5reIziJEaqcB8sHPtBQJ0r0EJUYIlwngPAig9DOK kdT8T49LBwAr6t9iLZWebow+TVOXByMJFuU3TUmbzf583I8fRdofIRP2+7uIfmo5YUGk OMZ6NJaEYkmu47zJTsKb3ahMRhPP43CdF3po7qDlI4hozuUxhE/upYkwFeq8UTiMw4e4 KitQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eHwGGucF; 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 br18si1937507ejb.191.2021.06.03.03.46.26; Thu, 03 Jun 2021 03:46:49 -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=eHwGGucF; 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 S229758AbhFCKox (ORCPT + 99 others); Thu, 3 Jun 2021 06:44:53 -0400 Received: from mail-qv1-f44.google.com ([209.85.219.44]:34784 "EHLO mail-qv1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbhFCKow (ORCPT ); Thu, 3 Jun 2021 06:44:52 -0400 Received: by mail-qv1-f44.google.com with SMTP id m6so2947053qvg.1; Thu, 03 Jun 2021 03:42:59 -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=qZA/yEU8XYY+hN6SkfwGwA9NjKTQyXMkIE8P1Ry807Y=; b=eHwGGucFkuiEOjQRRxZAiTycw385gqP3QoKjG9+58obVtjjbQX8ozQzfz+OmX2DLcP L2FfwYeb1U17WjRrzp7MXXqoAkFfXNHtueN7Xc4z83pAsK0lR4g8kT1vZhHqIppFbxvo 7tRtG8+jNoTopLab+v1w3CNZi80fCO3qt+J/9j3M/hBLBjzLeojrkwfi/APO0hHGmM9n q51zNEcdjhgWGn2kh8aiMdsqYGfZBkZPNuFKk1mUYKBALwG3aJFAN4yVlr4hRsRBbANy cNpU55QIhR8O5Ac0IbryT4Jj3YnWhyMLw+7W+LP4MNjPGbro2RRsAodTOHtzK4/yrnRH tYww== 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=qZA/yEU8XYY+hN6SkfwGwA9NjKTQyXMkIE8P1Ry807Y=; b=Uowp0QLtFekw2hJQ+vmnkjoc6iwslKnm5su95XiVDDl/FUKuO7Bk6vGHlRaJyGGQRZ kB9AW1H+jUVDCZEbL2wZ0zJ+xNlrR7CdZeOynUuyPNG2/CGBuD2ImslERfQm+IvflmTI leXuKRzQE9QgaOcpxH5AJChrZr8w23ZLpV3xruYInHNgf8GNRhSdtMAC8fDg4d+wRY80 71+MEo+2aul0EXvPaGHvp6YrJDJKjC1+THdty9IahVHeXzkW8CSGKtKaF3lAIpnvfxCR +g3Y7fnW3zuxW/aKQT/ybsUek2muBSR+ZbABo7Qr7fDilMWd+msbXODjc3AuCGCJu04j BLPA== X-Gm-Message-State: AOAM532riJ4MZpwjqAKTHET/SX0FNBNwx63E2H+mtHZwbthhGNVYAeEc pgp06tg7BETBGZ4g6isZ3Bo= X-Received: by 2002:a05:6214:7f1:: with SMTP id bp17mr18194727qvb.29.1622716919599; Thu, 03 Jun 2021 03:41:59 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id n4sm401581qkc.79.2021.06.03.03.41.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 03:41:58 -0700 (PDT) Sender: Guenter Roeck Date: Thu, 3 Jun 2021 03:41:56 -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] hwmon: corsair-psu: fix suspend behavior Message-ID: <20210603104156.GA644104@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 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. 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 >