Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3147582yba; Mon, 8 Apr 2019 12:12:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrjehxXMn0OpbNU6s6x/yRVPidjNymH0xoISpLzzwAbanTD1Xi90+S+2ozYYkJnfYD83n1 X-Received: by 2002:a17:902:4681:: with SMTP id p1mr31864403pld.42.1554750735306; Mon, 08 Apr 2019 12:12:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554750735; cv=none; d=google.com; s=arc-20160816; b=thR8RMl3OV5kht4NhCbt3WuSgZ0Vw4nQGL5x9v+fZQOAlVavqT8ldQ9m+2BOs7PVMu irFTXly0dmpBMgME5nR8W80/UI8mjV/2negGZnx9Kdj1UbIMjjb+IsVLnUKVo8UfmvlI TzQlH1GbPygyehGfZFPgjpeQrJ+MRog3Hc//4I9DcsXw2UEjkJhExC6VokCR4eK+H5EI Mt/aqd/BpNs7btJ30VrCvnYp9WNBrkYvP6lnPig93mdD+M6bxveQJVFFAgoZXus/+PY8 F2VKrwv9SRDVXkQd79gFl9VsJdz/CFm2P4CJAz7NER/bTSmrz+VbZELiw+ndzmU76JGO lDgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qEyLIYd+jzHclGjIT9PLtyASZ28Kzy/vNGmvo5if7H8=; b=TLbl3aJN2v/+7JSOrtNy/nLXRlUSg4bR5qMw/JecfHCZofpg69STODtmxkiXoX1dQK g6dBw9WYDlpffgspwxkj/I8j9EG2Bswk7T9fERGj4PvwSTfNhkgyAJjcwihIvfzkCkaz 8ft7txc59a9ECnAT0lCGZHyhxrp9aBsSiaHRniNZbLTgQSJ0pprnFj7+qKErMSYagy7/ VLLzaWVq3/IDLropU4dF8grDXcgJLsqhxB+SASlO+zmDpAiDlTg32PS6uO8O+UUh9Pod 7NBtHlhS/tjgoYy6Xjqnbwksa6tYOFWvN0T0ACWSB3O4KSgSiEVk+tnMt3+5+QULke04 lwig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=sazS80Cw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e13si6336775pgv.241.2019.04.08.12.11.59; Mon, 08 Apr 2019 12:12:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=sazS80Cw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726938AbfDHS6q (ORCPT + 99 others); Mon, 8 Apr 2019 14:58:46 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:36319 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726730AbfDHS6p (ORCPT ); Mon, 8 Apr 2019 14:58:45 -0400 Received: by mail-lj1-f196.google.com with SMTP id r24so517571ljg.3 for ; Mon, 08 Apr 2019 11:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qEyLIYd+jzHclGjIT9PLtyASZ28Kzy/vNGmvo5if7H8=; b=sazS80CwX+rRoUG4ucFCFrCBFbO29OQhRRC+xtU7jvILfGvm0Dah8Z3xdJQR5yHqeu CvSZxt7Anf/EmTuJTM4AhsSx0QhFf4NkfMSLWmOXRG4Ww+7pB3FTDqeeB6d0SaVPWN6v FP6j9Xm3iBkTbjg3nicjRcJlACc15MuoCEr87LtzWeufSm69U0ij6iEf07dQou4msDS/ 1m3yQTyB1/lADCHPmJZD2+MRpVM5eKxP8M0B8Vc3BTSNDMM8yvElHDOxVlKWqjeX974+ 7IAwiU6CaNRlpvt3ePlkecZ9VE354ap5fYf5ElreTzA5hKohXCsYt7WVv9QAoxtOB6lp GOYg== 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; bh=qEyLIYd+jzHclGjIT9PLtyASZ28Kzy/vNGmvo5if7H8=; b=ZdAfOrLqwYxa59tih4usmlJp1jDJvkWyKBq0TliWFr+V65hMeHppfuu0l7MOIK1Wjj S25fPHhAfN96Ux54/8peoKCJaU4lFlkTXU28UQkevoXAnIX7k7ae/KpC6aHkiofyBl4y uK71k9s8faXdgGdKi4ya+p6PJLumRz+NV3lykeOzlLHZSofwS4RR/HSlBUXlguoEp+xM mYhqr2UMDV0BSNIjR081r/HJUKSQU8WsfzolSybBMggnTdaR5isPoffaYJpOxHmGfVRd xvkchKYiwTEZA4j8WuEsOSfYETfxu7fZo97l3sDbspgZdt2NwfAweeTMqGJ0467SFEGt +WzA== X-Gm-Message-State: APjAAAU2fj8gJF6+WubHT3eNqi6vNw/ELOPDceyXTskHklLaXkXOBT3U y1Kxf9n6rTjAA1C5Qhy54J+MMtSNVYk4E5oI/Q7Mjw== X-Received: by 2002:a2e:9a0f:: with SMTP id o15mr16851279lji.130.1554749922721; Mon, 08 Apr 2019 11:58:42 -0700 (PDT) MIME-Version: 1.0 References: <20190313222124.229371-1-rajatja@google.com> <20190405203558.19160-1-rajatja@google.com> <20190405203558.19160-2-rajatja@google.com> In-Reply-To: From: Rajat Jain Date: Mon, 8 Apr 2019 11:58:06 -0700 Message-ID: Subject: Re: [PATCH v3 2/3] platform/x86: intel_pmc_core: Allow to dump debug registers on S0ix failure To: Andy Shevchenko Cc: Rajneesh Bhardwaj , Vishwanath Somayaji , Darren Hart , Andy Shevchenko , Platform Driver , Linux Kernel Mailing List , Tomasz Wysocki , Rafael J , Srinivas Pandruvada , Furquan Shaikh , Evan Green , Rajat Jain Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 8, 2019 at 11:41 AM Andy Shevchenko wrote: > > On Mon, Apr 8, 2019 at 9:36 PM Rajat Jain wrote: > > On Mon, Apr 8, 2019 at 10:02 AM Andy Shevchenko > > wrote: > > > On Fri, Apr 5, 2019 at 11:36 PM Rajat Jain wrote: > > > > Perhaps something like > > > > > > pmcdev->check_counters = false; > > > /* User doesn't want to be warned */ > > > if (!warn_on...) > > > return 0; > > > /* We do suspend via firmware */ > > > if (...) > > > return 0; > > > ... > > > > > > ? > > > > I guess what you mean is one conditional per line. Sure, I will do that. > > Yes > > > > > +static inline bool pc10_failed(struct pmc_dev *pmcdev) > > > > > > To be or not to be? :-) > > > Perhaps names of the functions should be > > > > > > pmc_code_is_pc10_failed() > > > > > > and so on > > > > I think the suggestion is to use pmc_core_* as the function names. OK, > > I will rename the functions to: > > > > pmc_core_pc10_failed() > > and > > pmc_core_s0ix_failed() > > And verb "to be". See above. > > > > Can't we utilize existing print helpers? > > > > I didn't quite see any existing print helpers in this file. I took > > this code from pmc_core_slps0_dbg_show(), and I think although I can > > abstract out this code into a static function, the calling code need > > to use seq_printf(s,...) and dev_warn(dev,...) respectively. - so > > might be overkill (did not feel that the benefits were worth it). > > Please let me know if you have any suggestions and will be happy to > > use them. > > Instead of adding module parameter and doing these prints, perhaps > introduce another debugfs node. Uh, I actually did wanted to print them at the resume time in kernel logs, because I think this is something kernel developers would be responsible for debugging and thus would be great to have this included within the kernel logs. User space tools may differ on different distros and may or may not be looking for S0ix failures, and particularly may not dump this new debugfs attribute. The other thing is that seemingly this could also help in situations where debugfs is not configured? Thanks, Rajat > > -- > With Best Regards, > Andy Shevchenko