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 A93E6664B6; Tue, 23 Jan 2024 01:00:59 +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=1705971659; cv=none; b=DAzHet8rHV5r1fR6/A7mreQSS5zc0k/Bm8WJk/NDiGjlvSnP1E06u9+u6agZNckPZ8vqxtNRmSLs4AeJ5dWRDilvZgdX9wVrYrj0jqTUFsz6gY8iyds+i84tWumF6ZDn4Th/O3qCa+U3CC+Vg0cWjACiFAsebG0/vMke41NhczQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705971659; c=relaxed/simple; bh=yO5LkWCbm50B7hY5B770zd5Vxqh2nBFV3H8s23o6rm8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IJQ69l5mf6rzcSB4nJ4ETU7kfv2AUK4Lcn204Zd+DZ6uUJ+wCNA8ft4sKMziknUd7uALXBVTqf9CDDte2CeflF9NRsnOjEpMtWrbwqusF64N+Wss54LoPc7dmgmqbrFov/HbluxcnzKHxmMlUeFFUxw/WfYr+GKDXIRv6RT4NQ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NT+5NTzU; 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="NT+5NTzU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60751C433C7; Tue, 23 Jan 2024 01:00:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1705971659; bh=yO5LkWCbm50B7hY5B770zd5Vxqh2nBFV3H8s23o6rm8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NT+5NTzUMBi58zLboCTw4puq8EHc3uO/t7oUqLhPsEeT2FPn126PUyKeBAmOmjuoZ oU0qXqaT1jmW/NYNaCZ3K44nS6S6gkxGmkfUJX1J0n34xOdwVp6scudF9ChQiUc4Sa 181v8sttJZLPrXjw0XQeS31B80oqenLlYhmyjquo= 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 6.1 267/417] Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs" Date: Mon, 22 Jan 2024 15:57:15 -0800 Message-ID: <20240122235801.112484118@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122235751.480367507@linuxfoundation.org> References: <20240122235751.480367507@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 6.1-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 @@ -267,7 +267,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); @@ -497,8 +497,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);