Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3599792pxu; Tue, 8 Dec 2020 16:57:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyYlwGVpL+W1R+zV0Z0YXm1I5+D/qmoHESESPh/7zQ3I3+hB60XZRsHY/0Ry7th0ncg5xxb X-Received: by 2002:a17:906:68c4:: with SMTP id y4mr27384ejr.332.1607475445364; Tue, 08 Dec 2020 16:57:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607475445; cv=none; d=google.com; s=arc-20160816; b=ix/ZPzwgtDF6Ck+xeyolVcPpVXHQIgzwxuksA1rkBJN/tiaye33ngpYniUpGWTVOG1 /7+oevlrJULSZn6y0r0LbCKH52Sqsp6AwFtg+EJvpsRaUGULO87o0cGQ/AU6ht2co0fV 12FaVsJDeH+Y8dF6QSuTHB0yh8W34HBO4r0l98ayMEUuzFQLb4UmTDvUIlCD21GSJBMA ENlOypKdwCIl2RXFTPWZXuga6qihYaXcr/aW47gLr+BTObqY6KDte2Xjn5QmC+8MZWFR qUM0pRMx2JoAohDNErloAqr7VqTkfPUiMJF9fVvCnMJDtWkZqsP4ddB0rv27zLBnP9RT Q2oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=Qlk9UC1hQAnoi57e2M4kIdIUkhHwBF5Mibx8g+znY0E=; b=Kuelxs69kL+UIr0r2neSX3XGd1zsTdFJp+E1cPmCEKyPQJct2L4s+XYtfwlZVCOxda 6l1kUEbYLTjsfGAu6OC1lF+ALOuJml3AIP/LoVAiAA79eN4c3tkOpfommspdR9m6e7/a 8ix/Uyaiwo6kyVCrfWYBRyOL0GUa2VRC6AmgYuiFHNzQh1We0hdg3aZNKyADFiUISM7l WxIsdV6wZzDvVp9Mw1PxhgfVaQ81snb49hO4Vj0h5jBwkXJ08yd7gdy3l7pQAJ/xV1IG pxHocvKMzK6Mco3Pyl8xmZWphT8b5HmKUby5LcShfYwIo3mFYhh/5Kyg/vTyp4nHevKH IgZw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zc8si62397ejb.662.2020.12.08.16.56.58; Tue, 08 Dec 2020 16:57:25 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729008AbgLHJkU (ORCPT + 99 others); Tue, 8 Dec 2020 04:40:20 -0500 Received: from mga03.intel.com ([134.134.136.65]:5141 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726584AbgLHJkU (ORCPT ); Tue, 8 Dec 2020 04:40:20 -0500 IronPort-SDR: MN5Z6TeplJhskw44HRxOCjBXpmgAMk7mQQyYwvPSOZ1YuZxNB2m6v7PCNiAIawaB1nopT6AYdf PEFaAPzKGdHQ== X-IronPort-AV: E=McAfee;i="6000,8403,9828"; a="173974783" X-IronPort-AV: E=Sophos;i="5.78,402,1599548400"; d="scan'208";a="173974783" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2020 01:38:44 -0800 IronPort-SDR: DstkOSJ9V+YZ75HUEGl4+M/zYZfi1LZN4DdG8PKi1d6yrhEJkugptWPNcOyiooU70P9xUHg8Pc BpXZVSHoLzzg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,402,1599548400"; d="scan'208";a="437320615" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 08 Dec 2020 01:38:41 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 08 Dec 2020 11:38:41 +0200 Date: Tue, 8 Dec 2020 11:38:41 +0200 From: Heikki Krogerus To: Utkarsh Patel Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, rajmohan.mani@intel.com, azhar.shaikh@intel.com Subject: Re: [PATCH] usb: typec: intel_pmc_mux: Use correct response message bits Message-ID: <20201208093841.GE680328@kuha.fi.intel.com> References: <20201203220813.16281-1-utkarsh.h.patel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201203220813.16281-1-utkarsh.h.patel@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 03, 2020 at 02:08:13PM -0800, Utkarsh Patel wrote: > When Intel PMC Mux agent driver receives the response message from PMC, it > checks for the same response bits for all the mux states. > Corrected it by checking correct response message bits, Bit 8 & 9 for the > SAFE Mode and Alternate Modes and Bit 16 & 17 for the Connect and > Disconnect Modes. > > Signed-off-by: Utkarsh Patel Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/mux/intel_pmc_mux.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c > index aa3211f1c4c3..e58ae8a7fefb 100644 > --- a/drivers/usb/typec/mux/intel_pmc_mux.c > +++ b/drivers/usb/typec/mux/intel_pmc_mux.c > @@ -176,6 +176,7 @@ static int hsl_orientation(struct pmc_usb_port *port) > static int pmc_usb_command(struct pmc_usb_port *port, u8 *msg, u32 len) > { > u8 response[4]; > + u8 status_res; > int ret; > > /* > @@ -189,9 +190,13 @@ static int pmc_usb_command(struct pmc_usb_port *port, u8 *msg, u32 len) > if (ret) > return ret; > > - if (response[2] & PMC_USB_RESP_STATUS_FAILURE) { > - if (response[2] & PMC_USB_RESP_STATUS_FATAL) > + status_res = (msg[0] & 0xf) < PMC_USB_SAFE_MODE ? > + response[2] : response[1]; > + > + if (status_res & PMC_USB_RESP_STATUS_FAILURE) { > + if (status_res & PMC_USB_RESP_STATUS_FATAL) > return -EIO; > + > return -EBUSY; > } > > -- > 2.17.1 thanks, -- heikki