Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5688863imm; Wed, 12 Sep 2018 09:35:27 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYe/VXy1/pt0C6FpiXIcal64YVtmmF9q5tgy0an8OFypglZPVCpDkD0RVyiyouf0EUQ51qj X-Received: by 2002:a62:3ac8:: with SMTP id v69-v6mr3315559pfj.164.1536770127900; Wed, 12 Sep 2018 09:35:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536770127; cv=none; d=google.com; s=arc-20160816; b=SdDoG3cQz3aclGQIuqzXFljniv1PJCml9zhjNO3RXOPjomgzY1egalJmqVPHHgRgAj QTxVqrishPubh1mmFH3X/E2zllIB1ks8PD/O33CR4mi8lNABfO1QYOjPTlK6Zuurn/ts LJwldM9OU1IZrSjBm30bUfgG0svYrIaRMgIpud25v7Hy/eh8AW59a74thYZB5YCSn7Wl 1YFTpvFVmy5KoiPbCHwheOstoLetpTSLIoULrGkDbcbuQQO5UhTYc5DBlegDYYvRGdoq zJd+Ai5+eu3KrtJwK+F6ZHUfqQcXtYK2Rift4MLiWexlNKmpNo4r+cRganTCdpUS/WMI pyPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=k/sXLsM7J090yYoftR7Se1bwfe1Z3YDRhJ6ZF5/wMkQ=; b=qdOLq4Mw2oAW6eRIi0VDYWOrOK8Y5Q5MeJxdusz/sb+NUc84Xfu2xKH+uGQCHhvoTU 9ytVxx2V+aUw9pyL1YsgLdtshyK9mKfU4HWVoBbDdDzzMaiZnhsgbZLJETp/UvPksl3k YQ0o3qr5R0unt8JfllA0zt2bqBMv7QoLk7qVFvTHG0pDWdH3EQbSw0oggFgjv8Wx91K9 WUCPMe2HRRHPE3pNP0yXgGEdNPrJyuibljkkhIUC4kljGS6XOw8ng2erj1eOxMUY0pmC YR6+zqHpbVbjQSv8ps5gX7AJfvzZ1f87kxQSiSfe9hqxlMyWI9M7Ot40XC7tPKi2ucx+ +3Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Q9LG5aK+; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v17-v6si1443660pfl.233.2018.09.12.09.35.03; Wed, 12 Sep 2018 09:35:27 -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=fail header.i=@gmail.com header.s=20161025 header.b=Q9LG5aK+; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727736AbeILVjf (ORCPT + 99 others); Wed, 12 Sep 2018 17:39:35 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:33373 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726798AbeILViU (ORCPT ); Wed, 12 Sep 2018 17:38:20 -0400 Received: by mail-pl1-f196.google.com with SMTP id b30-v6so1247608pla.0; Wed, 12 Sep 2018 09:33:01 -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:content-transfer-encoding:in-reply-to :user-agent; bh=k/sXLsM7J090yYoftR7Se1bwfe1Z3YDRhJ6ZF5/wMkQ=; b=Q9LG5aK+P7c02EZIME553q7+99rrBipy8/qyTp9SbcjE3KPo6bjRSlOD86HgCFsD4F LLn52hQid+/DKzSUA0YpD6xhqjdyWeNmpzJZ57tLRQiRp83BCujQUXgb/Eza7Qvbu6pX B/xW4jZUEvWxxx4Ego0PAaCEKIzwaZIuZAfCMP8WzIL6h23hw6bMojuXBdLG83WXPIFg 095VUsXwiZj0lBfzCOw3cdiq4NGBTsPSc7kmKx2ICFRyOHNsyfQyfNGEAilf0J/pz3X9 bmroCUc6mBB5m/Gawa8sFFa1zDkLIje+vwE5YAN0uq2CJVf+7bNk3LeYY++tu5zwcjfI r43Q== 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 :content-transfer-encoding:in-reply-to:user-agent; bh=k/sXLsM7J090yYoftR7Se1bwfe1Z3YDRhJ6ZF5/wMkQ=; b=Zig9WerqeUsX5dikAJ4dCrMQrzfqcPi2kg2FURl6IVFjjM97FIiDgc8LVgDRkZ1jou 2K0oJjBFBzDagMcDKeUYXezk7r13yIMPkEB3uRhgR56Pj+S/ceRGsCLTRC7GvLc9H/Rw HcMnOPHGBjLA2Lemwr4WNIWUUQBpMRi5A2d3l3B6VAFaVmo7skTDMD+FXxs+XtSeCFFA oEeWpQTAjFDIQeDJLs5lLrzKAgCuR/xNO9cYTYU8wXY1z/CdaswThKXCaf5HYhg/pwjp jaivVXOqe/BJXFciJu6tpeEWmLmyRlpVGKZdeYsRyo8wh1vFUcSy6SNsFdg6QkgycsGi 7BCQ== X-Gm-Message-State: APzg51D1z8cxaIexevbWCC3vEiqUPBfCHBH2xvj03ZUfvTwgrvsdSvfb F520P7OhnTDavytutZ97Nw8= X-Received: by 2002:a17:902:864b:: with SMTP id y11-v6mr3205117plt.335.1536769981393; Wed, 12 Sep 2018 09:33:01 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id q26-v6sm3736928pfj.127.2018.09.12.09.33.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 09:33:00 -0700 (PDT) Date: Wed, 12 Sep 2018 09:32:59 -0700 From: Guenter Roeck To: Angus Ainslie Cc: Heikki Krogerus , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] usb: typec: get the vbus source and charge values from the devicetree Message-ID: <20180912163259.GC3300@roeck-us.net> References: <20180906192644.24587-1-angus@akkea.ca> <20180911145931.32441-1-angus@akkea.ca> <8A418EC6-62A4-4354-8928-7693696409D1@gmail.com> <9d7431e51aa069f288dd4bf39e9db9f1@www.akkea.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9d7431e51aa069f288dd4bf39e9db9f1@www.akkea.ca> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 12, 2018 at 10:08:58AM -0600, Angus Ainslie wrote: > On 2018-09-11 09:33, Guenter Roeck wrote: > >I cant put my finger on it but this seems wrong. As i said both src > >and sink should never be true at the same time. I also din’t > >understand why turning off src should power off your board. Ultimately > >my concern is that we may be just painting over the real problem, and > >that would be really bad to do with dt properties. > > > > I agree that this doesn't seem like the correct way of solving the problem. > On this HW (Emcraft iMX8M BSB) I think the PTN5110 chip has been connected > correctly so I'm assuming that it is some quirk of the PTN5110. > > I didn't design the HW or the chip. This is a workaround for "quirky" > hardware and there may be others that don't behave exactly as expected. > I wouldn't be that sure about that. It may as well be that the tcpc driver and/or the tcpm driver are doing something wrong when initializing. I didn't really understand the logs you sent out earlier. It looked like the system would loose power if the TCPC_CMD_DISABLE_SRC_VBUS command is sent. That doesn't really make sense to me since it indicates that the chip sources power to the remote, and turning that off should not result in a local loss of power. Note that the chip is supposed to be able to report if it is sourcing vbus and if VBUS is present, in the POWER_STATUS register. Another question is the content of the ROLE_CONTROL register when the system boots, and the DEVICE_CAPABILITIES settings. Overall I suspect that we don't handle startup for your system correctly in the tcpc driver. The ideal solution would be to find a solution which does not require any devicetree properties, but to do that we'll need to get a better understanding about your system's requirements. Guenter