From patchwork Mon Oct 9 21:00:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: RD Babiera X-Patchwork-Id: 150327 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp2118253vqo; Mon, 9 Oct 2023 14:01:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGr8jsni4IilFh+lTWjx4KMi395Rx1c7ApetTNOAyU5518l6N3dIztQt90duFg4kG5Il40g X-Received: by 2002:a05:6a20:842a:b0:154:6480:83b4 with SMTP id c42-20020a056a20842a00b00154648083b4mr16152096pzd.14.1696885286888; Mon, 09 Oct 2023 14:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696885286; cv=none; d=google.com; s=arc-20160816; b=pcCIFz+3jHmKhOOM/ff0U0lL0WLtEgINW0dTY6xEaEBRDurl8DWzv/heYCY85mPYNn YmYZyTPa6bH0cMhORTTpRQUacPfApcsYvJbkfYocGpy3xsmENqDs4zzBzRtrYauw21S4 6PphhbFBiY4DWtIn5RgEGIRyXD/p6RQfuMOan9M0+r/hXtj+KcoLwEJiQS5anAE92DRa j8QPtWOhgEJnQKDsdTLbGNa2oKGdtNbUWUsZ+BkljEjxI28B1Jv7y62dUoRNOZh3U4G+ zRMgmybacYJpmsFNWLiS8aY8WnvP6C3ZUL9kYa28oUfoo2+jFA/x+XtbVXf5chK87NNa 7rAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=qyOEdilfHw6B6k4i/Hrpjck7dAiRB3VXEglYZeWU0vY=; fh=CXVp9DhKSU9XegQD/PENw0LbarAye+WzcCLPkuvPOGI=; b=o4OFHZjvStjgtiYewbI85OhDmKMcDI32rDhOj5vhWLhms1yeoNKDuWloRec0TyqmkW oo5XcRy9wqGdpOG0fp+QB7LXpfXZpuLBj1CQC2i5EmU+Ex1UnUaccYXQTqWREvj21tkc aowaQeoYD26y/UapMvCzangykAuf4yMwzq/duPpR8Fme0kLlqloml904EQ53leEbljCF yyNbIqwWS9SbL6uRPp35eKCea2ZmwfA9WqK9VdqjW9ceUjqLp1tPooA2d7vjGK6GOEa1 wcUjkVcQwkwk4R6qzLEXpQ0B7BFEie1pzj/Ke/Lm0pLNEHbjfcWIZ0yczwY7aIVEEWZO nYSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=RDqhhdTF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id u24-20020a63b558000000b0055793097dbesi10585089pgo.469.2023.10.09.14.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 14:01:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=RDqhhdTF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D41498116E62; Mon, 9 Oct 2023 14:01:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378026AbjJIVBI (ORCPT + 19 others); Mon, 9 Oct 2023 17:01:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234587AbjJIVBH (ORCPT ); Mon, 9 Oct 2023 17:01:07 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91B72A3 for ; Mon, 9 Oct 2023 14:01:03 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5a7aa816c5bso11107477b3.1 for ; Mon, 09 Oct 2023 14:01:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696885263; x=1697490063; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=qyOEdilfHw6B6k4i/Hrpjck7dAiRB3VXEglYZeWU0vY=; b=RDqhhdTFJzDEWkrgAFSXv2TAkzjlNIv0utTHzAf1vat4jLqL467f1eyWhCms0hrpuU XeEDnmllu4x+r0VCYVazUpQToTfOagFhQ2g8pPIlNkW0clkiws5TjjVYWFy8mr4gGAUv gjRPZTJedhMwI12slCQP7JwNwLTHqalGIfkJtm0eSwLTEvJsIfSpJ36R60m+AWeeH3Vq 1wEEd5dlMghdsNwAMjhpG55/sE2VptzL0BOHG1fbk9f+TYVR6/JUpw148RAzCYGdr0L7 SHb2p5N2sg+JzUMVZZwRvIO1Rj2/shaTkqPbgeW2JoXyD4+htb4qoMnd/0OLaQRUDcNW bW1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696885263; x=1697490063; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=qyOEdilfHw6B6k4i/Hrpjck7dAiRB3VXEglYZeWU0vY=; b=Sg7TdxGJDCThkcoAk43jRl0FyQGx9dl+HAU2F3ADCC3m1xAjinFsxkFTSvenPE63dB 9f6z7tFpKuzAHo5q8U5fF9PvtNt21h8cSpo5z4Oryf99jGsYPXWCGO3TEEdPnka14CLJ P7PpBi4IDDuv25V0V/0mqoKEDa+SXluBlks9sypHEf61m6Aqb9+Tjqgh2Odymeg8Ed6N Y9g3g74onRZQHFEa/GPXxAxDC5llnMu8R+mz81WPWmtSpSEfhTL6/JoedlKhVsxVK5PR NU43Ut66lWDOfVc32owt6klXby3XAbpM5RFMXTNf34Pr5q4WHtndERo4P0Zr+B5tuflc TyBw== X-Gm-Message-State: AOJu0Yzjr2alTqnPSm8iSR7v/rhfSey70NrmQad4DDx5qvJ1U7sn1GK4 KkmHo4qhRgEeHBNOm1vjvD1T4vH46sNVg2E= X-Received: from rdbabiera.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:18a8]) (user=rdbabiera job=sendgmr) by 2002:a81:c14a:0:b0:5a7:aab1:96a9 with SMTP id e10-20020a81c14a000000b005a7aab196a9mr37078ywl.6.1696885262787; Mon, 09 Oct 2023 14:01:02 -0700 (PDT) Date: Mon, 9 Oct 2023 21:00:58 +0000 Mime-Version: 1.0 X-Developer-Key: i=rdbabiera@google.com; a=openpgp; fpr=639A331F1A21D691815CE090416E17CA2BBBD5C8 X-Developer-Signature: v=1; a=openpgp-sha256; l=1373; i=rdbabiera@google.com; h=from:subject; bh=naOIDwmSOXGmB0NeKgkfBkGNyY1AcsJZAkoLxfJAvY4=; b=owGbwMvMwCFW0bfok0KS4TbG02pJDKkqWZyV4e0cCiJFf8M0b/3MzIv2XfV/aa2ZucelhMbUB WwzXh/qKGVhEONgkBVTZNH1zzO4cSV1yxzOGmOYOaxMIEMYuDgFYCIcnAx/ZSSaD5g46di9/9R0 r/b1VJ44i2ydZaw3Ezd4Scww9pqqzvBP80lb4eKKcJsTypG9fPO5bv/dMcWJ/2LbyudhXJz6PSb cAA== X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog Message-ID: <20231009210057.3773877-2-rdbabiera@google.com> Subject: [PATCH v1] usb: typec: altmodes/displayport: Signal hpd low when exiting mode From: RD Babiera To: heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org Cc: badhri@google.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, RD Babiera , stable@vger.kernel.org X-Spam-Status: No, score=-4.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 09 Oct 2023 14:01:24 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779313186332590407 X-GMAIL-MSGID: 1779313186332590407 Upon receiving an ACK for a sent EXIT_MODE message, the DisplayPort driver currently resets the status and configuration of the port partner. The hpd signal is not updated despite being part of the status, so the Display stack can still transmit video despite typec_altmode_exit placing the lanes in a Safe State. Set hpd to low when a sent EXIT_MODE message is ACK'ed. Fixes: 0e3bb7d6894d ("usb: typec: Add driver for DisplayPort alternate mode") Cc: stable@vger.kernel.org Signed-off-by: RD Babiera Acked-by: Heikki Krogerus --- drivers/usb/typec/altmodes/displayport.c | 5 +++++ 1 file changed, 5 insertions(+) base-commit: 1053c4a4b8fcbd28386e80347e7c82d4d617e352 diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c index f503cb4cd721..718da02036d8 100644 --- a/drivers/usb/typec/altmodes/displayport.c +++ b/drivers/usb/typec/altmodes/displayport.c @@ -307,6 +307,11 @@ static int dp_altmode_vdm(struct typec_altmode *alt, typec_altmode_update_active(alt, false); dp->data.status = 0; dp->data.conf = 0; + if (dp->hpd) { + drm_connector_oob_hotplug_event(dp->connector_fwnode); + dp->hpd = false; + sysfs_notify(&dp->alt->dev.kobj, "displayport", "hpd"); + } break; case DP_CMD_STATUS_UPDATE: dp->data.status = *vdo;