From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61CE850253; Tue, 23 Jan 2024 01:51:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705974709; cv=none; b=WmeCCr+Qbxh64D1+yHKgjHQyAybAeOta/W1sZ5RWESZm7jzOndjCYzKXgldLleR7JxZdv49Yclteld4UwsnVLPymeFjaFZGT/CIUxEseB+i46ubVKv9xP5L3CctPXjeNU36g0FmSjc+dRNiNf2RN3n+6Ipf9WhXhd949oivZfAk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705974709; c=relaxed/simple; bh=0NqCcdcHuoDmT+uXXvLSA+l139rEWAG5YhQYamZ+Bc8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h8D7ZLWmN4f/xlHqPfgGyiS3klo3GiSJCWqInF67zVZ4cgl7bHv/sqX2PL2lg34is72wSg44AQyG6fE9PVuOFq7zN8jIYJp+MKr6eaowqscmFJW/Wo8ahTDsLgXvVPfWGB+WW/+fpt0kUkFc4zasW9pVgTYYeHlrMoUYKjtLy9Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=as2bneST; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="as2bneST" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C538BC433C7; Tue, 23 Jan 2024 01:51:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1705974708; bh=0NqCcdcHuoDmT+uXXvLSA+l139rEWAG5YhQYamZ+Bc8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=as2bneSThAVjPyzCaZnaJszX/cQf61Z2dITMJ0+sApf6KT5nOAj0nG6UGCYIDaUtC XGt9fPcAC+0rI7tTOeIA6XbqwTkBokoE69jjRYCR6DQB5U7Stw/U04DRNHzxyJ4QbN Uscu9ZVaOZ68/s6PdqejhbCmQ6GV4fW3uUhM29Wk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, RD Babiera , Chris Bainbridge , Heikki Krogerus Subject: [PATCH 5.15 261/374] Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs" Date: Mon, 22 Jan 2024 15:58:37 -0800 Message-ID: <20240122235753.839880035@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122235744.598274724@linuxfoundation.org> References: <20240122235744.598274724@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Heikki Krogerus commit 9c6b789e954fae73c548f39332bcc56bdf0d4373 upstream. This reverts commit b17b7fe6dd5c6ff74b38b0758ca799cdbb79e26e. That commit messed up the reference counting, so it needs to be rethought. Fixes: b17b7fe6dd5c ("usb: typec: class: fix typec_altmode_put_partner to put plugs") Cc: Cc: RD Babiera Reported-by: Chris Bainbridge Closes: https://lore.kernel.org/lkml/CAP-bSRb3SXpgo_BEdqZB-p1K5625fMegRZ17ZkPE1J8ZYgEHDg@mail.gmail.com/ Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20240102091142.2136472-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/class.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -265,7 +265,7 @@ static void typec_altmode_put_partner(st if (!partner) return; - adev = &altmode->adev; + adev = &partner->adev; if (is_typec_plug(adev->dev.parent)) { struct typec_plug *plug = to_typec_plug(adev->dev.parent); @@ -495,8 +495,7 @@ static void typec_altmode_release(struct { struct altmode *alt = to_altmode(to_typec_altmode(dev)); - if (!is_typec_port(dev->parent)) - typec_altmode_put_partner(alt); + typec_altmode_put_partner(alt); altmode_id_remove(alt->adev.dev.parent, alt->id); kfree(alt);