Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2063473ybk; Mon, 11 May 2020 11:02:28 -0700 (PDT) X-Google-Smtp-Source: APiQypIEp/b4owbekmXi9tjiTPYt/bnASa/n57LbMVM8ly0eB9VKofyg4W7NllZnoSs8CNrbAhq/ X-Received: by 2002:a17:906:b253:: with SMTP id ce19mr14972519ejb.341.1589220148193; Mon, 11 May 2020 11:02:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589220148; cv=none; d=google.com; s=arc-20160816; b=F8I7FU2qdu0GtRdbqBOaY6CsuMe3dbxGcXh+IUrdIyCSt93LiiUGOQQ9eRwsSrxKSF 0LbinyG0rBMeZpukhCRM8amC6AInfC5qlOJMhKBEaOQW0Rcr82hmLHgUKV9UnUncfqJ/ cRnwIBUtM1szcH6ZTbPl2YEFEU9vaO92xCUobTu6haC2K2A7ssdFvQkzETzelQKLNqzS OugcMAHZP1b8o3RFHw/3Oks0/r9o7HTapp+OHVBX1AMEnHtely7Djqv9s5JWHOvhVXhC eGLQ9aRnSThswXBwtM7Pz03hjaPLuMgdu6fF3VT0f/OBhHDOWfseV92JOz1L3pFjYNzx 8Iqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=/4VPW/3YLXwoqcjHvmu+U93vY1XvtT8ILR97l+aBRHM=; b=jspY1S1a9fD4jElx9Y1BzAcmVGCaq7rTpkt6Zw3Js1DBhKX6G0MvitqGpxGV7R0qyL QxUKwdxkwTjJZkieMk7Q+NqNj0/TcRTee/74NfFnr41ub3gQXuD+9nGIPRN3AYYIrJWP jRr5LIrbgVwWlq67SPHsw69ZsOg3o7aW0P8Q+FWOoHLw2o3tL7zGqVd9pi8yyzgJ0vmC WBQT7/P+ZKNylWbbDcXvBc7sv/AquLWpJ2T9a/QpDUGfF3Rja4umFyH4DLXBUtyjl9zQ CsUUnWMNK7U296gaAdmrnQROm2LJFfyZQ/dS68mXGLbY2siNYeP7lSBy4LeHQ4Vd8vTQ bPOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XYsodEli; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j13si6715802edn.465.2020.05.11.11.01.57; Mon, 11 May 2020 11:02:28 -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=@chromium.org header.s=google header.b=XYsodEli; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730841AbgEKR5X (ORCPT + 99 others); Mon, 11 May 2020 13:57:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727051AbgEKR5X (ORCPT ); Mon, 11 May 2020 13:57:23 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C94A0C061A0E for ; Mon, 11 May 2020 10:57:21 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id t16so4242593plo.7 for ; Mon, 11 May 2020 10:57:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/4VPW/3YLXwoqcjHvmu+U93vY1XvtT8ILR97l+aBRHM=; b=XYsodElimbqFJLNFnU/6UJl3lwNcwYu/y1MR1mjVNPFY94eInf7JUE6nLmVgUkHowr 4zSTdezoG0smW1qmL27QUdfb65KUD5AuCFfMJHnfOwzRVwH5uwUY2BPnP2uILCu+GQY0 PICJ13i5ZMC1iPneXD+vBuFAGy2Rk3JBqX/2k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/4VPW/3YLXwoqcjHvmu+U93vY1XvtT8ILR97l+aBRHM=; b=B+6ZFTk+ICzFGCGFYseW05KOb4FRnayaPBGjL5u3jNL34DIj/U4ol+xPOEjRscMXgx /H9Nzo0cTBtIgpOce+U4rCdGl84y7wf52rzcPjRsCXJlEIEzWp0GuktsndMgGGL6/9Zo LsgqtXOBQe+Z9EIvWIpG2Bcl41mefLbFtb2xJ7Z0Hje83AcVmgcwTRgdmMi3dxN6FOSh du1sdkccDDphHgAb1AhL+PGxvdmrLbOFieMtgTc+mXOiU2czJl4p0DKcAF3nod2jWo/m yG2AQB65uZv+YvjOpjvl+yoNnY2wt64ALDsiPZL46+PzPTlzWZC4D1POQqf8uZ/IqsGC cCQA== X-Gm-Message-State: AGi0PuYs2Rw1tjzu3713ST1zXAiKlDs1YPcM613MSrPVgUTYioNtc3XZ ibRf4xIVcTMqqdm3TolwWFlycKPCXoQ= X-Received: by 2002:a17:90a:1b67:: with SMTP id q94mr23611499pjq.84.1589219841106; Mon, 11 May 2020 10:57:21 -0700 (PDT) Received: from google.com ([2620:15c:202:201:476b:691:abc3:38db]) by smtp.gmail.com with ESMTPSA id z190sm9750203pfz.84.2020.05.11.10.57.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2020 10:57:20 -0700 (PDT) Date: Mon, 11 May 2020 10:57:19 -0700 From: Prashant Malani To: Heikki Krogerus Cc: Greg Kroah-Hartman , Benson Leung , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH 2/4] usb: typec: mux: intel_pmc_mux: Support for static SBU/HSL orientation Message-ID: <20200511175719.GA136540@google.com> References: <20200507150900.12102-1-heikki.krogerus@linux.intel.com> <20200507150900.12102-3-heikki.krogerus@linux.intel.com> <20200507224041.GA247416@google.com> <20200508111840.GG645261@kuha.fi.intel.com> <20200511133202.GA2085641@kuha.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200511133202.GA2085641@kuha.fi.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Heikki, Thanks a lot for looking into this. Kindly see my response inline: On Mon, May 11, 2020 at 04:32:02PM +0300, Heikki Krogerus wrote: > On Fri, May 08, 2020 at 02:18:44PM +0300, Heikki Krogerus wrote: > > Hi Prashant, > > > > On Thu, May 07, 2020 at 03:40:41PM -0700, Prashant Malani wrote: > > > > +static int sbu_orientation(struct pmc_usb_port *port) > > > > +{ > > > > + if (port->sbu_orientation) > > > > + return port->sbu_orientation - 1; > > > > + > > > > + return port->orientation - 1; > > > > +} > > > > + > > > > +static int hsl_orientation(struct pmc_usb_port *port) > > > > +{ > > > > + if (port->hsl_orientation) > > > > + return port->hsl_orientation - 1; > > > > + > > > > + return port->orientation - 1; > > > > +} > > > > + > > > > static int pmc_usb_command(struct pmc_usb_port *port, u8 *msg, u32 len) > > > > { > > > > u8 response[4]; > > > > @@ -151,8 +170,9 @@ pmc_usb_mux_dp(struct pmc_usb_port *port, struct typec_mux_state *state) > > > > > > > > req.mode_data = (port->orientation - 1) << PMC_USB_ALTMODE_ORI_SHIFT; > > > > req.mode_data |= (port->role - 1) << PMC_USB_ALTMODE_UFP_SHIFT; > > > > - req.mode_data |= (port->orientation - 1) << PMC_USB_ALTMODE_ORI_AUX_SHIFT; > > > > - req.mode_data |= (port->orientation - 1) << PMC_USB_ALTMODE_ORI_HSL_SHIFT; > > > > + > > > > + req.mode_data |= sbu_orientation(port) << PMC_USB_ALTMODE_ORI_AUX_SHIFT; > > > > > > I'm curious to know what would happen when sbu-orientation == "normal". > > > That means |port->sbu_orientation| == 1. > > > > > > It sounds like what should happen is the AUX_SHIFT orientation > > > setting should follow what |port->orientation| is, but here it > > > looks like it will always be set to |port->sbu_orientation - 1|, i.e 0, > > > even if port->orientation == TYPEC_ORIENTATION_REVERSE, i.e 2, meaning > > > it should be set to 1 ? > > > > I'll double check this, and get back to you.. > > This is not exactly an answer to your question, but it seems that > those bits are only valid if "Alternate-Direct" message is used. > Currently the driver does not support that message. Could you kindly provide some detail on when "Alternate-Direct" would be preferred to the current method? Also, is there anything on the PMC side which is preventing the use of "Alternate-Direct" messages? It seems like the state transition diagram there would be simpler, although I'm likely missing significant details here. > > I think the correct thing to do now is to remove the two lines from > the driver where those bits (ORI-HSL and ORI-Aux) are set. I see. How would orientation then be handled in a retimer configuration where AUX/SBU is flipped by the retimer itself? Best regards, -Prashant > > Let me know if that's OK, and I'll update the series. > > thanks, > > -- > heikki