Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1354219ybp; Thu, 17 Oct 2019 11:30:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwu0K1iqmu+jGBg4606x9wSJaLUNfrC2q29GnIFmbVkOJx35uj8VuKhG1U27HhT2IW0iSB0 X-Received: by 2002:a05:6402:296:: with SMTP id l22mr5381488edv.86.1571337046220; Thu, 17 Oct 2019 11:30:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571337046; cv=none; d=google.com; s=arc-20160816; b=Lyi8KoOBsp8gZWd5+VFu9CMWb38Bm6OcF9gbrIN+cbKAw999GERwaUb9KgLk68PyWi MOre+2xmL24Ur5P51DaG4fzAdLkZSqDAnBcRr6JxIDE/8csiZPgenpI6zVFkB/nTWuh1 l2UpegHYLs6MIrisciecrZEyMkINet3gQQ493bf9VCShDSTFAiqEuMh6h1l61jwT/ohq AgICUvfWhB0YiXF7k7T/kf4L0XHw7e1T/gGd0D0jrAajOTImRcchRaAPjqEg6Lx1Tq4e cdU/PKhoGer/yodZ/wbErrS/hlao5kS/5TS+chs5rpWVXApXn0cFZb9+OzAC66othTcV RCMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MZX/rPJ/5AE5/fzuatdrPZlfEcWNb7a56a1Gm1PKbNU=; b=FSJBlpVDl6Bxqw+Rjr9z/3tdu0JWEHKPxmycU5jtZBvRDQ8ZQ4dh4w8UeuzbE/k3ZV qenu84XAJs2k/RgMCMkx6l3qOcfA+VLBhQf4KrefnFOnjHNScSytsej5+LL/soBdmXwg OGA1wkWZiExdqWhhbZn+KjF2WVpnGmzY4Y1SBore4Js3SxKKXW0Gwi3FzHoFm0JOGOHN kQQ4lXo6s21sRIEbqmB6Fgjy8oQZr++IBcCOwFAaVB2b1Z/ZlD2QfDzovNw+BuXX1EXy Yf7PEPcHQJEwdPJyY8utWMRVI6A4m+R+EL80bSv4fnXPJg8sZwyzRZ27iebcHzAWlNVG fgJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rw2gJcp8; 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 ci22si1998961ejb.162.2019.10.17.11.30.23; Thu, 17 Oct 2019 11:30:46 -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=@kernel.org header.s=default header.b=rw2gJcp8; 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 S2389862AbfJPWGU (ORCPT + 99 others); Wed, 16 Oct 2019 18:06:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:52298 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438192AbfJPV6e (ORCPT ); Wed, 16 Oct 2019 17:58:34 -0400 Received: from localhost (unknown [192.55.54.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 33ED921928; Wed, 16 Oct 2019 21:58:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571263114; bh=cgUZmNNAzyKO94lgcFtGH3+Q2ibbzA3dWEHh+4TK0iE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rw2gJcp8g145vlzePsbTVBVEcViVCQkASy4JehONPkveVGJnAU4ysyuFI4WaOwNHM qbgWlTHkeF+kMFQItTpZYOAE6ydJh5uVvUE4t/dLdeW1BI7/ilNtJjLNTey9MS6lYf dYFQPOz+L+D7HGc+X+lJ+rFc+U+OKbZvyWT88Ms4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heikki Krogerus Subject: [PATCH 5.3 038/112] usb: typec: ucsi: displayport: Fix for the mode entering routine Date: Wed, 16 Oct 2019 14:50:30 -0700 Message-Id: <20191016214854.090208871@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214844.038848564@linuxfoundation.org> References: <20191016214844.038848564@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Heikki Krogerus commit f2372b87c386871b16d7dbda680d98d4092ab708 upstream. Making sure that ucsi_displayport_enter() function does not return an error if the displayport alternate mode has already been entered. It's normal that the firmware (or controller) has already entered the alternate mode by the time the operating system is notified about the device. Fixes: af8622f6a585 ("usb: typec: ucsi: Support for DisplayPort alt mode") Cc: stable@vger.kernel.org Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20191004100219.71152-3-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/ucsi/displayport.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/usb/typec/ucsi/displayport.c +++ b/drivers/usb/typec/ucsi/displayport.c @@ -75,6 +75,8 @@ static int ucsi_displayport_enter(struct if (cur != 0xff) { mutex_unlock(&dp->con->lock); + if (dp->con->port_altmode[cur] == alt) + return 0; return -EBUSY; }