Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6429994rdb; Tue, 2 Jan 2024 01:12:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGIqnI7jzgxXsL6Ytmf5o2qhsQLxbS3f92YbqVb8vXy71nK7DYIQd7nMn4/+OHx2w+FEd8g X-Received: by 2002:a17:90a:7047:b0:28c:8ca3:d668 with SMTP id f65-20020a17090a704700b0028c8ca3d668mr5000715pjk.86.1704186736472; Tue, 02 Jan 2024 01:12:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704186736; cv=none; d=google.com; s=arc-20160816; b=O3sdxt1FSZsJhAygYTkcn/arvNDfJRT36ZSD6dKp4sCBvKJLv1MqRSktzAjwITRcRZ J6t5GthB0UL5Afk/651Fs5rDkrKxpBbvXD3L0bELWUJHCtS8EuoQz9pxMVGbx3xBHnxN AsKxoo7H2rtzF2wAgGEMgM4RHcIW3WU65HHgXl/n5sLbCoDWjmHIWraSlbvsDCjMO+js /D68UczaXC0Cs4IJKrKH2NjPuQNZ95g+BPWzV308b6vQHQSpWKSgnwcBXdF5M1uCSYuI tbl4fy24oyNHBwZbyjbJmWuMvFJGi9kcEcAwOwobgwHX8SSedkWpxjgBZuUv9sRkqri6 2icg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=bk9sfES6QfRi/mytdWuY+kPaXfMllNywmMMIMvZ9INc=; fh=ANrN5VjnEHG2Z9ShHoe0ahgzfCKIpd140bi8DCH86p8=; b=WS8Ohx15yf+zppSYvTZESUHFzaug4IfUzyGqSj6Xfspt6siQWYb2O+vsgpEz/43EHX cKYLn3x9wTNbMKI2EDg/b/uqV/vr77THIXi0ThdSeql7oxH6yrRQ8lmIZKpp3XxASFYO mJJdZlGeXuDALg+h9NAE5DTWeFPVZl5a17shEc7fkDULs6/2WkKTAPNLZqVg7vonW8Lc 8hiVU1huLOlXsh6m2yNsRWBmXGLeEoaFJisk3Hp/cv7La5i+jnYz7iWr4WgU2BAIN1tp YLf3vMNFeR2VrZkuD9l5HTN6j+i1siYoc5ZymqSh5YbWHV2IwxgEI6DS/dNlw2Gr7d4a bd1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bPKWtbpt; spf=pass (google.com: domain of linux-kernel+bounces-14170-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14170-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id mm24-20020a17090b359800b0028abf878ca1si23334894pjb.46.2024.01.02.01.12.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 01:12:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14170-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bPKWtbpt; spf=pass (google.com: domain of linux-kernel+bounces-14170-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14170-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 24DE6282C99 for ; Tue, 2 Jan 2024 09:12:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CDA5D6AAB; Tue, 2 Jan 2024 09:12:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="bPKWtbpt" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) (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 90B3C568D; Tue, 2 Jan 2024 09:12:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704186723; x=1735722723; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=NyvPMiWn3WT/oZc8EH+SNeHjU8WnY+nEsLSZKALA/ow=; b=bPKWtbptAPui07c3URUxb4MdOZTEVwLrCn7bpqavfXnLSzI1qHTW9M5Q 9t1haV9KH71skJ+Di4mes4yuIgb8wTJ4KnRpz7cie3w4UfXam1Fp+WFvm KkNU/hXMNKcUcO8ppAorKrluSarOJEDgZd1jFJ3O65WXKxQWqlrlyvQAW SfHHbLiJRjQ1TcukWOQfqzFD398G2J4Ox7K93cjv5nZhI6DhIHY9hhBmz HMzNolRoHhPHhwgPfEODqj28+LU/W6IlHG54vAG3rvuvCidIgq4Rtdc+7 BGreGo7j1iFdvP5va39hhC6Vp+1zeESzgWxzJtXXWe/3bomigrxoEUJeN A==; X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="463258977" X-IronPort-AV: E=Sophos;i="6.04,324,1695711600"; d="scan'208";a="463258977" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 01:11:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="923172841" X-IronPort-AV: E=Sophos;i="6.04,324,1695711600"; d="scan'208";a="923172841" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 02 Jan 2024 01:11:43 -0800 From: Heikki Krogerus To: Greg KH Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, RD Babiera , Chris Bainbridge Subject: [PATCH] Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs" Date: Tue, 2 Jan 2024 11:11:41 +0200 Message-ID: <20240102091142.2136472-1-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: stable@vger.kernel.org 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 --- drivers/usb/typec/class.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c index aeae8009b9e3..4d11f2b536fa 100644 --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -267,7 +267,7 @@ static void typec_altmode_put_partner(struct altmode *altmode) 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 device *dev) { 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); -- 2.43.0