Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3479717ybi; Fri, 5 Jul 2019 08:04:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyy/cHQU7uLRAQEENzQzhqodXZ9fysaD8c/7yNG8lKojdQG78uXEO0/schNwypHigkRYKjq X-Received: by 2002:a63:1918:: with SMTP id z24mr3828921pgl.94.1562339087975; Fri, 05 Jul 2019 08:04:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562339087; cv=none; d=google.com; s=arc-20160816; b=G1egMWruz1vSsR4pQVP9ZQNdLxF2Vu/EYbU90X9M3gqWphhTRTE7kAvwZlstgornNQ nzGi84cce3pgWtiFYqLRIgsFFG2Q3f7wT0vJRfR6SeYkccMWnMOXw5zIFD1gD3HfX+92 COy6E32FCmgsPA+3RJCl0meh88pZqHw50XKQiGEVsvMK0nJeNaspixm0cqei+AKPxu/1 iXV5W/BHcXhJiaccNOmFepMydSlJ7qlIdQUNvH3W4AXOUJ/Mxibt2TO5nRqE165O4ZJR 2qsKhDJNRkB9pF9NUxAj3g19EbtCpaLmp+mYKrQss33WWu8GMxhius/OnjocCrAQtbch 1+IQ== 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=dEDcm+IMzdH45vWKat38tOP6YtE82uRu/Nk82XO3Gqc=; b=wK/pzKwBEUti5LnoQjShHVe/I3Tv2z1pZR5ZNwNoIuw4Fo2H0mbO950/aoGB7cdZX5 7/vccNiCRzx2eZX8OI+PX51XsKESrw0dcZn43VbyvX7n46HtzeKo8MqCDdfGEv1ohqv6 M52OKPjQ3A06glqORDcvJlifbqLzeEdKJc3x77DESg3oHBODg7QnQUM3rvdE8oBJP5B7 y+IUN+9Vw8vSaoH8wq7RZzACwo+/6nFKsOn6N1XHYxsVDDUIyi6tiKBC9wj6BHoOioMN s7VpRe61c1dLeiOJYPMy9vEbA7QGDfv+mzWBSb70KPGGmD1IwZLS/YieJMyL6vLd2OGC DzhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iJcJXmB5; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m185si9742935pgm.421.2019.07.05.08.04.31; Fri, 05 Jul 2019 08:04:47 -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=@gmail.com header.s=20161025 header.b=iJcJXmB5; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727464AbfGEPCm (ORCPT + 99 others); Fri, 5 Jul 2019 11:02:42 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:41136 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbfGEPCl (ORCPT ); Fri, 5 Jul 2019 11:02:41 -0400 Received: by mail-lf1-f67.google.com with SMTP id 62so6534357lfa.8; Fri, 05 Jul 2019 08:02: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; bh=dEDcm+IMzdH45vWKat38tOP6YtE82uRu/Nk82XO3Gqc=; b=iJcJXmB5wQwsHy7K+5FKnawavg8Vjb7KBII9CyBGGAGolFGWLmi693+1tRqJK0iza+ Vax3sfK3ogtihSJZN8rkQ8xF62RwdPkTPNnmIYall/HCRNgX/hSQPpMUPNyc7SR9cjV8 w4UNSfaeClgSjE2RoYDzRdHEsKTGJFGbllOMrS7YKUHFIOmPahUxNqmq1wXTMnJlKg0T mmRULlAmjKi58Kl294M68uDdva31t+w1vYZm00QyRnWHUgv/EeM+sCZcLt6Ol60G/nQl mMGHeE3qVPZXRfUEGul+PTXI1kPmIEjevh2ep+DvrwzRGLtAZDMiaXsiHMKqo14XS/Ih MW1g== 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=dEDcm+IMzdH45vWKat38tOP6YtE82uRu/Nk82XO3Gqc=; b=XyHk7f2CYI9p8xdIFXepRka38RRhhP84k3/x4ACAj4nMDm/xxb6wWalhTDDtQc4OlW b0t+tzmR8QM9L4GXuTtK8Mc/gSP1/LLq0AzDmQcjsSdjhPCM4EHVWifjE7WtdjaJrdUB NF9Ds7T3VNtZhY309vEZa7T1qhbaVPIkg3lkYPEdFRPU/jqc1vMRL+1uGctyJtb3ZAAc sR2SFf8JTB5HfP4UCbQoo5LiU9nxycQdinBu7vs0pIayDT9ATxi13L7GQt2plePoJSuw Sf6n2Mba7a1hp+MQVHHCckivdCaXzQoOCabVlFcH9PEhbm5UXV6FVTosnlKGnARlAWlI mIFw== X-Gm-Message-State: APjAAAVEJcvDQOyRIetk9dDcqJ+i/A6w1vkGNgjVADiE/H6v1tEAWlxy 23vx4l90uPcBNYOpCzbyPRdRF6DyeQVrUBUcK5ppnG1dFSQ= X-Received: by 2002:a19:7509:: with SMTP id y9mr2256015lfe.117.1562338959781; Fri, 05 Jul 2019 08:02:39 -0700 (PDT) MIME-Version: 1.0 References: <20190705095800.43534-1-mika.westerberg@linux.intel.com> <20190705095800.43534-8-mika.westerberg@linux.intel.com> <20190705145106.GA2640@lahna.fi.intel.com> In-Reply-To: <20190705145106.GA2640@lahna.fi.intel.com> From: Yehezkel Bernat Date: Fri, 5 Jul 2019 18:02:23 +0300 Message-ID: Subject: Re: [PATCH 7/8] thunderbolt: Add support for Intel Ice Lake To: Mika Westerberg Cc: LKML , Andreas Noever , Michael Jamet , "Rafael J . Wysocki" , Len Brown , Lukas Wunner , Mario Limonciello , Anthony Wong , linux-acpi@vger.kernel.org, Raanan Avargil 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 Fri, Jul 5, 2019 at 5:51 PM Mika Westerberg wrote: > > > > +static int nhi_suspend_power_down(struct tb *tb) > > > +{ > > > + int ret; > > > + > > > + /* > > > + * If there is no device connected we need to perform an additional > > > + * handshake through LC mailbox and force power down before > > > + * entering D3. > > > + */ > > > + ret = device_for_each_child(&tb->root_switch->dev, NULL, > > > + nhi_device_connected); > > > + if (!ret) { > > > + lc_mailbox_cmd(tb->nhi, LC_PREPARE_FOR_RESET); > > > + ret = lc_mailbox_cmd_complete(tb->nhi, > > > + LC_MAILBOX_TIMEOUT); > > > + if (ret) > > > + return ret; > > > + > > > + return nhi_power_down(tb->nhi); > > > > Just to be sure: unforce power is done only if no device is connected? > > My understanding of the comment above was that unforce power should be done > > anyway (so it should be outside of this if block), and the difference between > > the cases is only about the additional LC mailbox message. I guess I misread it. > > nhi_power_down() should be only called if no device was connected so it > should be in correct place. I can try to clarify the comment a bit, > though. Maybe adding the word "both" ("to perform both an additional") will make it clearer. Maybe removing the "additional" (which to my ears sounds like "an additional operation besides the normal one, to unforce power") is enough. Again, your call. I'm not sure it's strictly needed, maybe it's just me. Thanks!