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 701371272B5; Tue, 23 Jan 2024 00:08:19 +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=1705968499; cv=none; b=kCpdQOANIjL9otA9112rRisKX/BD8A+IexI2lCZ8WCkt+ti7JghR7xwaZhMFLNbnPC46toOSLxTewf+jN6O76gslWr7JM51iHvDcMuJUZi4DRFhpKitCu+oosS4inbC7wNWZoWr+4OmbTxJMR+QFTyV81tYqbfGUzU7BRnkmv2Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705968499; c=relaxed/simple; bh=+GysUGNGR6EwoDbAZWphWjIaECzkumPuGRxWTIaQ6Ro=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pRnMYNdTzhGhyvmOd7vn3hycz39Frncniih2Ocpz6Ihhsf5QtwoOEzd0QdqhkD4NtBzzvgH5b+LJhYBJeFxgofkK0iF+vGg6/0JntToHR91DUVR9JJ+N77xazR+GYHSTL0bjqE+ELM4UCnUT4HKOZWBNf+5O56xuvD1/LN+en2Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XA0C567a; 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="XA0C567a" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F419C433C7; Tue, 23 Jan 2024 00:08:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1705968499; bh=+GysUGNGR6EwoDbAZWphWjIaECzkumPuGRxWTIaQ6Ro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XA0C567aYSiQ2SScG2E578CFK9q0dhybUPGwAJ4H1gEOItl61kLSwBWobt70ECOPM dmgJOcyx1EJt5XbWtVlljSC38b0XLRQ8r+9a/TtZjLuYyfvjZA8Z5aQVjeE/hkEdqN AxMv6aP970yVQ4WmE9GmexzXmdtXY+CuKFZU7Fvw= 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 4.19 124/148] Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs" Date: Mon, 22 Jan 2024 15:58:00 -0800 Message-ID: <20240122235717.529298405@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122235712.442097787@linuxfoundation.org> References: <20240122235712.442097787@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 4.19-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 @@ -192,7 +192,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); @@ -459,8 +459,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);