From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (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 85C0F3C818D for ; Mon, 13 Jul 2026 08:46:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.125.188.123 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783932407; cv=none; b=PWN0roRFKeMXL06VOVy5uKElNv8I0T9myS+FMZ1/MzXfRZ0c4LqWL/ZaYQUSeY+64yQ6ZzH/CkyYW0W59kIUTlsZyIQL30s6nWw1Fa7yFc7YTs9dV9v/kGHud4e2Pyxrc9Nwt80RU/FNPHocggBzVcNqjyrDNfc5NzUnl1/tAQ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783932407; c=relaxed/simple; bh=Awk4gHStXNe+SsdJMWe6V5mysupa7InsP5iDVSNe7UU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Z2JlPo6yF5zZZ2M9zlPx1bdM884vsHQ1sCCZcHvfb8EV+3is3DlXhw9m6DTcnENu+jAddEeQmMRYs8SR5X/1j024yZLL5T3C/1lOGB8XhcRkD9XFfDPihuc0m1P7G0lfuq/xmRMAGDwGWFm6kkjVe19v6Qct9cDTy7NbZCYkiAw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=canonical.com; spf=pass smtp.mailfrom=canonical.com; dkim=pass (4096-bit key) header.d=canonical.com header.i=@canonical.com header.b=UdPKDQpb; arc=none smtp.client-ip=185.125.188.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=canonical.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=canonical.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=canonical.com header.i=@canonical.com header.b="UdPKDQpb" Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 0ABCE3F290 for ; Mon, 13 Jul 2026 08:46:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20251003; t=1783932403; bh=K2Yp4b4cielWvPpIJjqJ9dpzfqVERB7QaLNXPsZ17c8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=UdPKDQpbpAUAvYa9pDhdODFSfV829hK/bMqdNRpjC0SQf09fGeCw4555Tw1TU7mBK e+08eOjGxj0+rxC3y/lF4/8ZDcZ5kTy/UtER5oGrm+8GYRDBnR9wvDbyFa/2jFq8JY ma2seUCY+6U8kHGPDF2VO7aPDw944m6TJm3aNtEtCA1Sr9lJY8NL8vtFuiKV/PB3/x /+TpEcOCA9B7R6wqZzvwDC2jTL/Q2ydp74+GFfPTcD5oRUNlCyLnmGN6T07CMJzuTB cLAdu7oYAMBrON6TuQu9f8KoYAH3UUHt0Rz/nc45JosaGhMZtBjx9eapK0LlbYH5N2 p+ZyFIC9qmo//Xn4VjPzwZjBG+nzBnV+Ecdj+CEgUr9LEaQcqCsc8fC5Fr+fQLk+ix OJcIyDwiP0s1WSb4W4I1mLIcXG8ywYPbdZoRcYtslvvBR56IexPF51uxjQzd2PBEtH MydxpsrwAi3/O/+KV49354I/DWrVFFcR/M0/g2o1QCZaFR+3Nx9GfhHtoI6fdoQos3 IOKGKmitohWFOUBJaS55kGeVpXojehYvAOTDiFMip8wFyF7RFIswGBM2f85zZYEGsX JIDbLccxP9cHZlWA1RGcu1XqkgR4trnSAG/YQDDaAUsO860/mSGT3fF0ogHyfByQ2b 2NWdTbJtcZgDdoLdQA0wD+dA= Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2cc73f47bdcso51443405ad.3 for ; Mon, 13 Jul 2026 01:46:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783932401; x=1784537201; h=in-reply-to:content-disposition:content-type:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=K2Yp4b4cielWvPpIJjqJ9dpzfqVERB7QaLNXPsZ17c8=; b=UKFaewQLGIoyrvpzeH+OPPC1EJwaeKtXHpgaYVwS7ZaZ3mx910T3XTlSVlPZxRX8H5 ZLGijMLZudh57KT6o/OsEo/xoG9cJwJD53KgG7xPxAU/yhT5dbQx1eDIRSpIhkS99J70 2RvuWmH3WZhHcGPK7eX5oW+5QMVSFE3NZcvbrm/bUNec+oQ0dw8ZkZ+x6YbEiXqDRMTX xabMp1o5hR0bq4JMzG9V1oJXdjGMNdNwDb2+HPl657fTEzFXO4truDoPPderUhshPgr0 wHM5JkrUWXJcV+6wQa1DZeMiO60+H4XIIfGxkwhgUnIsp1rv1k1644xitn0VxmJS0c++ lKvQ== X-Forwarded-Encrypted: i=1; AHgh+RpfdsHTdxMXzF2DsJkie+Pz8NyzwiWj8TER7JyKu7qxCuLGyjsb5yAVpI4QseAy48or7bg1eLoKWbScAzY=@vger.kernel.org X-Gm-Message-State: AOJu0YycqM+T5bjGxHBF3ueg6+UspXhT5RnoM1x21LBdYpqSRyAwjLqU +SdYjwQ4US6U9ORLvwT0S8IJslfJMS3MoHztPB1a8N8ZEGcS8VjO78MpxPm2TUzJkJwoFu0Ma4H l7e1DEw3meTfT6HwvV7LWrLmPUDroqBpKoFxlz2XoAmQekLWQKsnLVIerjyr5kXDI425LEUHg+C yoxoynug== X-Gm-Gg: AfdE7clgXEz/oZt1jeFrYg5cUgSGIS4xzjqroRBbrwa8R7dw/HII25RGpAOOVEgPeF4 Sqqx/ZP0TJCmaatgVbMolQflsVrwsK94/3wrHsYQOlMTH7eA3GqR5CEoQ6pMq58I48HLpAkxZe9 oum3uRWi4ZLNqVib6DylwYDuONCmb26Ez8ywywqfI/eQO4jhuedRdeHd9xvNEXiHv1QEsxJTNpN dEZUv+sFgddML+onzJFSDJDvHg+Nep9CauuBzdI0HkLpvKelI43OavmzLA48U9pznnVNG6WH9vz +SBcPUAhbYK/1V2zbIifuBYr7gH9hDb5GRP445jHWiToKiSB6ieh07b+X+WMIh5vdoqUYVARfXB xENuGPICmRJ72boT+F3nHAV8eI5MEenFo+joPJe63lHZm1Tuf8LNdpMstSPCRpI5hAWk= X-Received: by 2002:a17:902:ebc4:b0:2c9:97a7:71ae with SMTP id d9443c01a7336-2ce9f16db14mr78552415ad.41.1783932401503; Mon, 13 Jul 2026 01:46:41 -0700 (PDT) X-Received: by 2002:a17:902:ebc4:b0:2c9:97a7:71ae with SMTP id d9443c01a7336-2ce9f16db14mr78552145ad.41.1783932401131; Mon, 13 Jul 2026 01:46:41 -0700 (PDT) Received: from acelan-Precision-5480 (211-75-139-220.hinet-ip.hinet.net. [211.75.139.220]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ce8217a64bsm49494215ad.13.2026.07.13.01.46.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 01:46:40 -0700 (PDT) Date: Mon, 13 Jul 2026 16:46:35 +0800 From: "Chia-Lin Kao (AceLan)" To: Greg KH Cc: heikki.krogerus@linux.intel.com, bleung@chromium.org, jthies@google.com, myrrhperiwinkle@qtmlabs.xyz, pooja.katiyar@intel.com, abelvesa@kernel.org, yuanhsinte@chromium.org, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 1/3] usb: typec: ucsi: Detect and skip duplicate altmodes from buggy firmware Message-ID: Mail-Followup-To: "Chia-Lin Kao (AceLan)" , Greg KH , heikki.krogerus@linux.intel.com, bleung@chromium.org, jthies@google.com, myrrhperiwinkle@qtmlabs.xyz, pooja.katiyar@intel.com, abelvesa@kernel.org, yuanhsinte@chromium.org, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260612052112.1325812-1-acelan.kao@canonical.com> <20260612052112.1325812-2-acelan.kao@canonical.com> <2026070844-hermit-postwar-9b7c@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2026070844-hermit-postwar-9b7c@gregkh> On Wed, Jul 08, 2026 at 01:45:32PM +0200, Greg KH wrote: > On Fri, Jun 12, 2026 at 01:21:10PM +0800, Chia-Lin Kao (AceLan) wrote: > > Some firmware implementations incorrectly return the same altmode > > multiple times at different offsets when queried via > > UCSI_GET_ALTERNATE_MODES. This causes sysfs duplicate filename errors > > and kernel call traces when the driver attempts to register the same > > altmode twice: > > > > sysfs: cannot create duplicate filename '/devices/.../typec/port0/port0.0/partner' > > typec-thunderbolt port0-partner.1: failed to create symlinks > > typec-thunderbolt port0-partner.1: probe with driver typec-thunderbolt failed with error -17 > > > > The matching rules differ by recipient: > > > > - UCSI_RECIPIENT_CON (port) and UCSI_RECIPIENT_SOP_P (plug): > > Two altmodes with identical SVID and VDO are byte-for-byte > > duplicates and the second has no observable function, so drop it. > > > > - UCSI_RECIPIENT_SOP (partner): > > The typec class binds each partner altmode to a port altmode of > > the same SVID via altmode_match()/device_find_child(), which > > returns the first port altmode with a matching SVID. If the > > partner advertises more altmodes for SVID X than the port > > advertises, the surplus partner altmode(s) collapse onto an > > already-paired port altmode and trigger the > > "duplicate filename .../partner" sysfs error during > > typec_altmode_create_links(). Use the port-side altmode count for > > SVID X as the authoritative cap and reject any partner altmode > > that would exceed it. This preserves legitimate multi-Mode > > partner altmodes (vendor SVIDs that the port really does > > advertise more than once) while filtering the firmware-generated > > duplicates that have no port counterpart, and is therefore > > stricter than a plain SVID+VDO comparison (which still admits the > > Thunderbolt case where firmware reports the same SVID twice with > > different VDOs) without being over-broad like a plain SVID match > > (which would falsely drop legitimate vendor multi-Mode entries). > > > > If a duplicate is detected, skip it and emit a clean warning instead > > of generating a kernel call trace: > > > > ucsi_acpi USBC000:00: con2: Firmware bug: duplicate partner altmode SVID 0x8087 at offset 1, ignoring. > > ucsi_acpi USBC000:00: con2: VDO mismatch: 0x8087a043 vs 0x00000001 > > Can you change the ", ignoring." to ", ignoring but please contact the > BIOS vendor to fix this issue." as they need to get told this, otherwise > this looks like it is a kernel issue. Here is the v7 that just rephrased the warning message. https://lore.kernel.org/lkml/20260713084323.287516-1-acelan.kao@canonical.com/ > > thanks, > > greg k-h