From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD5332E06EA for ; Tue, 24 Mar 2026 20:56:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774385773; cv=none; b=b6CT+yxpZc6jcV6ExknE/4iD57Nap5c6qvtigzp1NbLllMARskzdanEVomdvuC+MPDFLPjdl4amHa61Scz6Fr3g5S6ebeuUnbq8MfPSX3U6tQaXteKT0wzQlWU1meSHqL7tr97Ght0roXuHH5DmL9zvUp1CvbJkT6+4Z15CRrsc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774385773; c=relaxed/simple; bh=hdjKvfBWWeq0uSDptTLstowPlforQbXn8RIryJ7jeSY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=td8Oouccy/KLRi9vnfzi6+jo6Bqny5VNBfL/dzm+e+vk+sdfoCE5IYynVrCpjw4OlrQPyUr7ZKdXnXoZcFomGRTUDV8Q+nLB0QLMqxbj9pibOB0GLPWsAOvDsa8jnC1C02XW2Td5yXx8xzlq1souWCEgwLfrc/1APY3w71oI7eg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=MWWCXBP9; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="MWWCXBP9" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-354a18c48b5so4762793a91.1 for ; Tue, 24 Mar 2026 13:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774385771; x=1774990571; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=FscbW10Q3KKVYse0rj9RSiZh6xJn2dHId/vIM0ejStE=; b=MWWCXBP9njA4Ih7o9qnRzL7XJopLZlXYq1CyMEmVuOTrjreDf4Gqu06s59wvYCkcXy /GgZNf2rItiY9MvErZYrMb0TeKwFEb5TfAxXoCnrE7T9uVM/VEGEXPEJNF51TopvNsQz oOgG6xEaKHJQnYbqKofi+I9jqM16oFjw65rhi/goso19Agntu5Ofy5H3eSkW7uLIS/L+ j76wlBmYiRC0z7oMaiV0wZsHuJPr6vH0WXGDFICNNqASbaDIkX03fsHZP/HsNgL8kHrL gb24mZ2r1CzG8JqylzmDdtcF5q8rC8ZjgpdAzWTheR9d7y0hQ8zvPBPlXXZyNHPpzj8V VSRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774385771; x=1774990571; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FscbW10Q3KKVYse0rj9RSiZh6xJn2dHId/vIM0ejStE=; b=IG9jUN65DEb/Sw41JTSBksHd6CYCvlOIQOf5SzPOuBmJZq/wDk5rlH64E6LFBkuU75 Em2wzzyt1si0J4TPy+A+mjEBCJ482dt54IqZjYjHB/JqSBbo7SmlP4VCtZa/hH+vd8MJ BnBad3gMMkJjvY9AzmC3NAILvJryxhjt9QKTxctYbH0ztFczvhjTgJZ1liWFuGCSjG0I DX6Tfz8N8fnXnWC3Ze/b1yiDlHhoEruvGwjF/XOBg9S7nJPyQaivRfvpFL/5RDBl+yAk H791bb97KeVgucxQ4z7NYd8s4MIBb4OsO4sY4VYac0TZbYWv6L38VIEgPODFyOokjfRm OyZw== X-Forwarded-Encrypted: i=1; AJvYcCWE7+wdwe/E8KBp633ijfpfhMAS9b3TdkmpNnlj1YU9+ILMJWZHaKPwH0sVXdNbEReE1bl5iuFTKtZQXIU=@vger.kernel.org X-Gm-Message-State: AOJu0YzA5aGloElP7Iw1mK2hIvKwreZEl5o5M0CYyFUvcgDxjbOB8APj IADxRJC0Y4S9+G9sNp/Pz5IC6TJb9sphIwg2JEsz6INWv1s2TVkyKA5jCnuZGG+VYQ== X-Gm-Gg: ATEYQzyNXBnT9XzzT1SE/m40qpUP+A/QfkXvxzdzyS/2gFegUGE0UsN5gpacJjqosgD 8BWth4UjrYgdlF2B9IzNckfF1dNXBgt6y9sevLEQCHV6f9sU6HjrX+Ob4VCINOnOyVETP1Km5V6 xvq7nopYG88gBA33Rj7CfMbTkyg8QQ/1BX7HFkSKyzAm+2HB4YI27ebvXbRiwsDdyiSjO/LvEYX bqWrmyMNhwLz4togTLZ9z0iJyPU4scD83HZhYuHrU4amxaWeVxHBEZh36f6KFLmI7XzdNwplAUu zY/ABzmWE85T/S13neO997ga56RVByBclsl+GME7XAwdCsxZWA+4mrpPzyqI2wFWNmP1cI928rr 4X5pLsU5M8Qr0kroZaOaCTLG0JYgTEVVXUh4MH/mtzzI/+kA+j+UbNUmNP7kynAUZ/GUZ5paxYe Wl1XWkrLHak2986GaKkJGX9VsOQ+xWQ6sZQYO1ODg1YqB31BrlodgHLhoj X-Received: by 2002:a17:90b:2f0d:b0:356:2c7b:c026 with SMTP id 98e67ed59e1d1-35c0dd95872mr717194a91.23.1774385770651; Tue, 24 Mar 2026 13:56:10 -0700 (PDT) Received: from google.com (21.59.127.34.bc.googleusercontent.com. [34.127.59.21]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35c0312ee89sm4218287a91.1.2026.03.24.13.56.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2026 13:56:08 -0700 (PDT) Date: Tue, 24 Mar 2026 20:56:04 +0000 From: Benson Leung To: Andrei Kuchynski Cc: Heikki Krogerus , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , stable@vger.kernel.org, Madhu M Subject: Re: [PATCH v2] usb: typec: Remove alt->adev.dev.class assignment Message-ID: References: <20260324102903.1416210-1-akuchynski@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Mq7wClqCT9VK9him" Content-Disposition: inline In-Reply-To: <20260324102903.1416210-1-akuchynski@chromium.org> --Mq7wClqCT9VK9him Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 24, 2026 at 10:29:03AM +0000, Andrei Kuchynski wrote: > The typec plug alternate mode is already registered as part of the bus. > When both class and bus are set for a device, device_add() attempts to > create the "subsystem" symlink in the device's sysfs directory twice, once > for the bus and once for the class. > This results in a duplicate filename error during registration, > causing the alternate mode registration to fail with warnings: >=20 > cannot create duplicate filename '/devices/pci0000:00/0000:00:1f.0/ > PNP0C09:00/GOOG0004:00/cros-ec-dev.1.auto/cros_ec_ucsi.3.auto/typec/ > port1/port1-cable/port1-plug0/port1-plug0.0/subsystem' > typec port0-plug0: failed to register alternate mode (-17) > cros_ec_ucsi.3.auto: failed to registers svid 0x8087 mode 1 >=20 > Cc: stable@vger.kernel.org > Fixes: 67ab45426215 ("usb: typec: Set the bus also for the port and plug = altmodes") > Tested-by: Madhu M > Signed-off-by: Andrei Kuchynski Reviewed-by: Benson Leung > --- > Changes in V2: > - Marked as a Fix >=20 > drivers/usb/typec/class.c | 4 ---- > 1 file changed, 4 deletions(-) >=20 > diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c > index 8314309094719..0977581ad1b6e 100644 > --- a/drivers/usb/typec/class.c > +++ b/drivers/usb/typec/class.c > @@ -686,10 +686,6 @@ typec_register_altmode(struct device *parent, > =20 > alt->adev.dev.bus =3D &typec_bus; > =20 > - /* Plug alt modes need a class to generate udev events. */ > - if (is_typec_plug(parent)) > - alt->adev.dev.class =3D &typec_class; > - > ret =3D device_register(&alt->adev.dev); > if (ret) { > dev_err(parent, "failed to register alternate mode (%d)\n", > --=20 > 2.53.0.983.g0bb29b3bc5-goog >=20 >=20 --Mq7wClqCT9VK9him Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQQCtZK6p/AktxXfkOlzbaomhzOwwgUCacL6ZAAKCRBzbaomhzOw wq2sAQCUZJhrv7AaalP85KIJJboMt7KzueWrl87wl1CfC8SCUwD/QYg8KuDsEZC0 WC3rvxaQqHZeB3xJMTS+O65CYaCUzQU= =TV8y -----END PGP SIGNATURE----- --Mq7wClqCT9VK9him--