Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3930253pxk; Tue, 29 Sep 2020 09:38:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyj0svKJVWfqIeSrR4IFViGHFrdd+Q0cWQc99HS0lhVn4sP+H+/kgBNi1CgwlfYzemZzz+/ X-Received: by 2002:aa7:d29a:: with SMTP id w26mr4219066edq.106.1601397539460; Tue, 29 Sep 2020 09:38:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601397539; cv=none; d=google.com; s=arc-20160816; b=kxvXevQliS5G0OGphqOh3pezoL2/vtSjgoT6wMM2pxEZ4jFQ7O3VpdxXFVM1ngBfFS 8bjwQ6f5ybb6gbIIWqNev2czqqqwiJWDIaQX4fLWecdxDKr3/eww9XsfyQR4RW+4nkq2 /DohUGNvBUgx+bvq446XFlbjbia73HjZQUJUStrAU3iKw2xkLj6E3ErGWQTd9J6AlUMH ZRCJcRnTntKRXti+/I/v5cOSi/XdGNxJoRuDo66q/qReeK1LdQME6DdJEIE6QDneREk9 JiX/HkqiuneqkuMUKVSq/lbdJAoLuCmSB6qMCytmP+BtELdL0/y68u6eoshC/1KrIvDT JeXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=tg5f8r5u/C7h4zTCABx8TCIEL7vsD7cEWgNSNx1Mhuo=; b=OhmMpx8kk7rR3fwR8nxoyxBGSmJzvzlM0p5JkywJOFDQG26nx2nLvvitu3BxToEGOh qR7mlghpolLLkDnWapUqSKgB/c4+/NJIlYrbrBK4zMbGB2CXQBgK+7JzgkTHaaMZnkMl 8PwDJCvlM9opahLwYf0okUiuoHnhEdsuz0L6FUoAbv2pek32ViM6vxWqWVN1AO/ewSQW HcOzFSq8JO1tT4CiHcqxPjcWEQ3OAXazkr0f1NoS8C/2KgyDuMptVmsT1DYlWqMrPxPF GnF/HYEpy6fR6F1gELXYAxkWZWKDIwN6edkQX7HmBOWP9HOB1I+CK+dw1lSsygWnOdXv mCAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mMzxQvjL; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a4si3605693edq.101.2020.09.29.09.38.35; Tue, 29 Sep 2020 09:38:59 -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=mMzxQvjL; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728531AbgI2Qhl (ORCPT + 99 others); Tue, 29 Sep 2020 12:37:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728184AbgI2Qhl (ORCPT ); Tue, 29 Sep 2020 12:37:41 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEA7FC061755; Tue, 29 Sep 2020 09:37:40 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id jw11so2950412pjb.0; Tue, 29 Sep 2020 09:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=tg5f8r5u/C7h4zTCABx8TCIEL7vsD7cEWgNSNx1Mhuo=; b=mMzxQvjL29Mh9yG57bCHo7dUr7BOU1mi5S7nRbttYY7qjpEtgyB3th6JKvs04eLZpD bh1InFSWp/G9PLsIwwV7KNWy/n6UOR1S07EU87EwmcT8rJ+fyEQfQC0pvCCMmtBTmLHG UrA0dz164V3sVMRVinQXq3o7e0+3WYj5EEePB6e9WimQJ7sZd2WBOdPrAGcIiVT+OtC5 QGf7hXTxUyc5W2F2kMvrCl5PrnByNb+GrZLatlCcQbQI4NeohOxJy6Mou4s5orbOWctl hU2+4OJ1CZf+APEJEIGwP8F7MxU2ILjNVscUd9h2NsS9+8csPUh2ANMVEPYXb8NKHenx +ovg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=tg5f8r5u/C7h4zTCABx8TCIEL7vsD7cEWgNSNx1Mhuo=; b=YYtisWy8rzkYuF9VdIg4yAR9SivXQ4p7mWENJspVud4FtTUuMfRwpsakr7SqR+ocPz 4lmYnkwTj7exc+xOS6DnIebbv6F2jt/HCDM9CmYzlxCxoD9mHB/q6zSbmLbCLVMP1/+f mdh4gAf323ImNVotNPF3xKea2AgTzgAMWlq/a73fpihshDDhxCaLQnIH6q/woaArsxDB 0oKIDnW5zZKwHhNxnq6jyXmIOWepbfnBUuuRvKp4J3cuBtkxpbYybI7BrD/Vbn+MK6nM FspfhXG6AKicEgqiLvH7JiE4QENJOaAHU7n4f8ERspCowDi2fodXCC0s/MpZOd0xyEP9 buug== X-Gm-Message-State: AOAM531FiQlPaSE6aaSSfq21YgLmoX/LfVK0/S7XtFQ1Um0BmlgFIS+U qWhhwaLqFxP7kD6gsJZ//ugeP98tYmPtMagX00Y= X-Received: by 2002:a17:90b:fc4:: with SMTP id gd4mr4713204pjb.129.1601397460322; Tue, 29 Sep 2020 09:37:40 -0700 (PDT) MIME-Version: 1.0 References: <20200924192455.2484005-1-j.neuschaefer@gmx.net> <20200924192455.2484005-4-j.neuschaefer@gmx.net> <20200925213207.GA2510@latitude> In-Reply-To: <20200925213207.GA2510@latitude> From: Andy Shevchenko Date: Tue, 29 Sep 2020 19:37:21 +0300 Message-ID: Subject: Re: [PATCH v3 3/7] mfd: Add base driver for Netronix embedded controller To: =?UTF-8?Q?Jonathan_Neusch=C3=A4fer?= Cc: Linux Kernel Mailing List , Lee Jones , Rob Herring , Thierry Reding , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Alessandro Zummo , Alexandre Belloni , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Sam Ravnborg , Linus Walleij , Heiko Stuebner , Stephan Gerhold , Lubomir Rintel , Mark Brown , allen , Mauro Carvalho Chehab , "David S. Miller" , devicetree , linux-pwm@vger.kernel.org, "open list:REAL TIME CLOCK (RTC) SUBSYSTEM" , linux-arm Mailing List , Heiko Stuebner , Josua Mayer , Andreas Kemnade , Arnd Bergmann , Daniel Palmer Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 26, 2020 at 12:32 AM Jonathan Neusch=C3=A4fer wrote: > On Fri, Sep 25, 2020 at 12:29:45PM +0300, Andy Shevchenko wrote: > > On Thu, Sep 24, 2020 at 10:26 PM Jonathan Neusch=C3=A4fer > > wrote: ... > > > + dev_alert(&poweroff_restart_client->dev, > > > + "Failed to power off (err =3D %d)\n", res); > > > > alert? This needs to be explained. > > I copied the dev_alert from drivers/mfd/rn5t618.c. > > Upon reconsideration, I'm not sure what the correct log level would be, > but _warn seems enough, or maybe _err is better It's up to you to decide, but crit/alert and similar has to be justified (commit message / comment in the code). ... > > > + /* > > > + * NOTE: The lower half of the reset value is not sent, becau= se sending > > > + * it causes an error > > > > Why? Any root cause? Perhaps you need to send 0xffff ? > > Unknown, because I don't have the EC firmware for analysis. The vendor > kernel sends 0xff00 and gets an error. > > Sending 0xffff doesn't help. Maybe a slightly elaborated comment that it's copied from the vendor kernel (which is?). > > > + */ ... > > > + dev_info(ec->dev, > > > + "Netronix embedded controller version %04x detected.= \n", > > > + version); > > > > This info level may confuse users if followed by an error path. > > Right. I suppose printing incompatible versions is still useful, so how > about something like the following? > > > /* Bail out if we encounter an unknown firmware version */ > switch (version) { > case 0xd726: /* found in Kobo Aura */ > dev_info(ec->dev, > "Netronix embedded controller version %04x detect= ed.\n", > version); > break; > default: > dev_err(ec->dev, > "Netronix embedded controller version %04x is not= supported.\n", > version); > return -ENODEV; > } This is better. ... > > > + WARN_ON(poweroff_restart_client); > > > > WARN_ON? All these alerts, WARNs, BUGs must be explained. Screaming to > > the user is not good if it wasn't justified. > > poweroff_restart_client being already set is not a situation that should > happen (and would indicate a bug in this driver, AFAICT), but I guess > the log message could be better in that case... As per above. --=20 With Best Regards, Andy Shevchenko