Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4373181imw; Tue, 19 Jul 2022 05:33:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t7k9xzzVIS0IfEeJHyMdrScN4K//HrycRB5bieODo4IO0hTxczoCyKTAVwtITpeE8vewkv X-Received: by 2002:aca:90c:0:b0:33a:768b:50d5 with SMTP id 12-20020aca090c000000b0033a768b50d5mr4880053oij.294.1658234034602; Tue, 19 Jul 2022 05:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658234034; cv=none; d=google.com; s=arc-20160816; b=DhFdUvUt2MOxpCfBNX2+D9GTVcV6i/KQ8kyBRsWTM2sACG1sg0yuJJT78QaPnNgJgu /ompMqyaxxa7zgpno7bbVO9rSb4+iwKyRYpnntmWkSlcAevb9/Y0eZ0VpdPkBvj1bIH4 CizCOhnDS8p9MzFS8dWEFf+MXsug65zW2GrecRz2Wbmn8Sd4uu2alnz2X9e+ysHq9PRt aTUQvdMKTCAYPgjXfz1lnH301riZwNKK6fa6hzZyyWHVQcNTfe3YxbeEb3Rj6jtgCAAB 06oKXZZORHQ7Mi8z4VzydYawMDXb4qjz7PQ3PzRfIYjxlCvisvajmW+PrjfS3+Pmpwmf DJng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=C1ifFXvuZ5FxWDG2rs60p6z+z/cBGgDIhSCPktgYPWM=; b=af8yzaOCcOhy8DxaFUsdCXzUwN2kr5TzxXgO0ZdLnJNT0fiqGDk8SxDI59DHO/mr22 2XFSpBqVxqaeJgsG6w5IAPmnu0mu01GCZJP2BQB12gzXLoIwoq/srMJMLs2NBZ1cQX4P wNJu/KQQA/+WvWKZFEM2U0QLp1ZdZMVbnlkYpGqaoN0YY9rQDY5ifLh1RwapkanSC21E 8sa3IaJMYFsucb0zxyEsq+piBukrouEyWvLRSbtz9E4ene5EaM56RWhsjb1t0jEePlrG rNLVFtiI0tc7mKg1TUK7vTHj3w/zxI+0AL6RKUAfSlPndnznO/XziiGDUE/lpgB6R2bb 4dHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0kJnl3dp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i35-20020a056870892300b0010c26841d4fsi9993648oao.10.2022.07.19.05.33.40; Tue, 19 Jul 2022 05:33:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0kJnl3dp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239976AbiGSM0f (ORCPT + 99 others); Tue, 19 Jul 2022 08:26:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240296AbiGSMYu (ORCPT ); Tue, 19 Jul 2022 08:24:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30303501A0; Tue, 19 Jul 2022 05:09:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 196C9B81B8F; Tue, 19 Jul 2022 12:09:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 588AFC36AEC; Tue, 19 Jul 2022 12:09:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232572; bh=ty8/fZeb9Wx787jet+Mgv0EXSgg6yqyH9tM+PhjSJpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0kJnl3dphZpLBQgVSfDQ/Y7W49bYD6hm93gGdOajy1V3S78hgTpzd/84RDUWBmBnT cfuVrZjozItVEYKFCA/NWd/EVynMlnpaVp33iYy7RRdJXSmFN5uxwnn3zlm5wT2NdI B82u4rrhbhpZsy5lzKRVootHjYp+jonKrgOWMTYA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linyu Yuan Subject: [PATCH 5.10 104/112] usb: typec: add missing uevent when partner support PD Date: Tue, 19 Jul 2022 13:54:37 +0200 Message-Id: <20220719114637.073790008@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114626.156073229@linuxfoundation.org> References: <20220719114626.156073229@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linyu Yuan commit 6fb9e1d94789e8ee5a258a23bc588693f743fd6c upstream. System like Android allow user control power role from UI, it is possible to implement application base on typec uevent to refresh UI, but found there is chance that UI show different state from typec attribute file. In typec_set_pwr_opmode(), when partner support PD, there is no uevent send to user space which cause the problem. Fix it by sending uevent notification when change power mode to PD. Fixes: bdecb33af34f ("usb: typec: API for controlling USB Type-C Multiplexers") Cc: stable@vger.kernel.org Signed-off-by: Linyu Yuan Link: https://lore.kernel.org/r/1656662934-10226-1-git-send-email-quic_linyyuan@quicinc.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/class.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -1444,6 +1444,7 @@ void typec_set_pwr_opmode(struct typec_p partner->usb_pd = 1; sysfs_notify(&partner_dev->kobj, NULL, "supports_usb_power_delivery"); + kobject_uevent(&partner_dev->kobj, KOBJ_CHANGE); } put_device(partner_dev); }