Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1109287rdb; Tue, 19 Sep 2023 22:51:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBY2GxRtB+z77aRp1xe5Yglev8tZgBKerSJe43fnn880q9rYuU2dB0kZf2eTHIAcYkpAMV X-Received: by 2002:aa7:c407:0:b0:51a:3159:53c7 with SMTP id j7-20020aa7c407000000b0051a315953c7mr1266118edq.30.1695189087946; Tue, 19 Sep 2023 22:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695189087; cv=none; d=google.com; s=arc-20160816; b=lgJBeqaxVRcfKyA9vcx7SWu96O0Cs6kLeVXkb0dm3C2BtjgM1In003tv1nPMzjPlK0 ck8lwSIKJML5zgvz+vcy2sYWSafys5J0oT6/QxVxh6CHneYFCRsCuhJVtpp9aAE+lhlI ep4vw4XVEOOyqq5jdITY15sYI/N78iv9xO8rLrE/rRbjNanBmknqsjKpReAzwI9wOpes wVvNW/VmcANzk2/NWx3yS5GcIIOcXfe71wad183i4DvYDDiUAByve1vJ+WX0jAxnivJs mgYnc6kOIPc3VOOv40JCIbKxXMcEayV/bFR3p2xnyEbf7NRZZehzj8bYD7uLPEFNYka8 ls0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=naroMBErSn2t3KbKYiTgYiGNYwV6PHYlOn96MGhMVbU=; fh=eG1t7V5Zo+lkhQEgZ3TbxqcLxo1r1gDJO+b6J10nZ3Y=; b=pXFrh8qZT0rd0TklUh42VS53HaFYq2Z1b6LYVA0tGWDGmOA9AOnHXhPjfvvt9VZbdE iBSCDiElKW+9AkUgTwD36VEQL4g0gsRV+roQSIwrGavIH1/YgqwHopGYWCr4xPfjp4UX Zoobyn//DwjnnZ7xKj+ukmBZuNimU7pzCKwhxKKWV3zx0JG5qZFveDMmBv5PqORUzXzE I5zYf8F8uVAanYZJ7bGhLZ2smZc4EunQkDCFnJ5QVU8XeH/x00L1YYjPVg65lx4X/phW ZbuUPEzTGwdrlU2SXfFzgz8h2pAzBt1y34ng5qlc7MRjvWcGCGuT90Wu5fE4kq1ql9xR HH8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canb.auug.org.au header.s=201702 header.b=eQhvCkGQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canb.auug.org.au Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id s22-20020aa7cb16000000b0052a1a4b685asi11483661edt.472.2023.09.19.22.51.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 22:51:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@canb.auug.org.au header.s=201702 header.b=eQhvCkGQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canb.auug.org.au Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4469B81BFA82; Tue, 19 Sep 2023 18:12:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230466AbjITBM0 (ORCPT + 99 others); Tue, 19 Sep 2023 21:12:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229641AbjITBMY (ORCPT ); Tue, 19 Sep 2023 21:12:24 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5043B3; Tue, 19 Sep 2023 18:12:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canb.auug.org.au; s=201702; t=1695172332; bh=naroMBErSn2t3KbKYiTgYiGNYwV6PHYlOn96MGhMVbU=; h=Date:From:To:Cc:Subject:From; b=eQhvCkGQy6/Zb2WjeJo7Q0LxmIDUIvRrFY3Vv9TAIwmeq0MYlPuzrgfJffsVYAToE mU8tGlAN/uCQhcdWBDbg2hh8080qBybcRGIu9srJg8Mu/29jGnl9Qpv9iNKd34GgQF fbssHai6RLXbVsIb8eypLsQM2l1UQCheHX6a/wCcaWcTUbi2memdDNPwSWFV+7zI37 WAE3/gULCeuT2Pa5MBg6Orm61rPdfFo88ZLx8MukYpErYU+AqoojpCdAAVGE2zgY0a qXyRAZy7d4G+cnreP6M4soU9Yoa4ZSZ9Z9X6AblzWHOwg1PWzQydRTDh7S9cvuEoXZ kggzWQdIXTxag== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Rr0qw0Fyhz4xGM; Wed, 20 Sep 2023 11:12:11 +1000 (AEST) Date: Wed, 20 Sep 2023 11:12:10 +1000 From: Stephen Rothwell To: Daniel Vetter , Intel Graphics , DRI Cc: Ben Skeggs , Karol Herbst , Linux Kernel Mailing List , Linux Next Mailing List , Lyude Paul Subject: linux-next: manual merge of the drm-misc tree with Linus' tree Message-ID: <20230920111210.505e5daa@canb.auug.org.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/o52gEQ/sgnm94h5t6ow.E0z"; protocol="application/pgp-signature"; micalg=pgp-sha256 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 19 Sep 2023 18:12:47 -0700 (PDT) --Sig_/o52gEQ/sgnm94h5t6ow.E0z Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi all, Today's linux-next merge of the drm-misc tree got a conflict in: drivers/gpu/drm/nouveau/nouveau_connector.c between commit: 1b254b791d7b ("drm/nouveau/disp: fix use-after-free in error handling of = nouveau_connector_create") from Linus' tree and commit: 8b7d92cad953 ("drm/nouveau/kms/nv50-: create connectors based on nvkm inf= o") from the drm-misc tree. I fixed it up (I think, see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. --=20 Cheers, Stephen Rothwell diff --cc drivers/gpu/drm/nouveau/nouveau_connector.c index 79ea30aac31f,94498c15b50e..000000000000 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@@ -1295,70 -1303,76 +1303,75 @@@ nouveau_connector_create(struct drm_dev nv_connector->index =3D index; INIT_WORK(&nv_connector->irq_work, nouveau_dp_irq); =20 - /* attempt to parse vbios connector type and hotplug gpio */ - nv_connector->dcb =3D olddcb_conn(dev, index); - if (nv_connector->dcb) { - u32 entry =3D ROM16(nv_connector->dcb[0]); - if (olddcb_conntab(dev)[3] >=3D 4) - entry |=3D (u32)ROM16(nv_connector->dcb[2]) << 16; -=20 - nv_connector->type =3D nv_connector->dcb[0]; - if (drm_conntype_from_dcb(nv_connector->type) =3D=3D - DRM_MODE_CONNECTOR_Unknown) { - NV_WARN(drm, "unknown connector type %02x\n", - nv_connector->type); - nv_connector->type =3D DCB_CONNECTOR_NONE; + if (disp->disp.conn_mask & BIT(nv_connector->index)) { + ret =3D nvif_conn_ctor(&disp->disp, nv_connector->base.name, nv_connect= or->index, + &nv_connector->conn); + if (ret) { - kfree(nv_connector); - return ERR_PTR(ret); ++ goto drm_conn_err; } =20 - /* Gigabyte NX85T */ - if (nv_match_device(dev, 0x0421, 0x1458, 0x344c)) { - if (nv_connector->type =3D=3D DCB_CONNECTOR_HDMI_1) - nv_connector->type =3D DCB_CONNECTOR_DVI_I; + switch (nv_connector->conn.info.type) { + case NVIF_CONN_VGA : type =3D DCB_CONNECTOR_VGA; break; + case NVIF_CONN_DVI_I : type =3D DCB_CONNECTOR_DVI_I; break; + case NVIF_CONN_DVI_D : type =3D DCB_CONNECTOR_DVI_D; break; + case NVIF_CONN_LVDS : type =3D DCB_CONNECTOR_LVDS; break; + case NVIF_CONN_LVDS_SPWG: type =3D DCB_CONNECTOR_LVDS_SPWG; break; + case NVIF_CONN_DP : type =3D DCB_CONNECTOR_DP; break; + case NVIF_CONN_EDP : type =3D DCB_CONNECTOR_eDP; break; + case NVIF_CONN_HDMI : type =3D DCB_CONNECTOR_HDMI_0; break; + default: + WARN_ON(1); + return NULL; } =20 - /* Gigabyte GV-NX86T512H */ - if (nv_match_device(dev, 0x0402, 0x1458, 0x3455)) { - if (nv_connector->type =3D=3D DCB_CONNECTOR_HDMI_1) - nv_connector->type =3D DCB_CONNECTOR_DVI_I; - } + nv_connector->type =3D type; } else { - nv_connector->type =3D DCB_CONNECTOR_NONE; - } + u8 *dcb =3D olddcb_conn(dev, nv_connector->index); =20 - /* no vbios data, or an unknown dcb connector type - attempt to - * figure out something suitable ourselves - */ - if (nv_connector->type =3D=3D DCB_CONNECTOR_NONE) { - struct nouveau_drm *drm =3D nouveau_drm(dev); - struct dcb_table *dcbt =3D &drm->vbios.dcb; - u32 encoders =3D 0; - int i; + if (dcb) + nv_connector->type =3D dcb[0]; + else + nv_connector->type =3D DCB_CONNECTOR_NONE; =20 - for (i =3D 0; i < dcbt->entries; i++) { - if (dcbt->entry[i].connector =3D=3D nv_connector->index) - encoders |=3D (1 << dcbt->entry[i].type); + /* attempt to parse vbios connector type and hotplug gpio */ + if (nv_connector->type !=3D DCB_CONNECTOR_NONE) { + if (drm_conntype_from_dcb(nv_connector->type) =3D=3D + DRM_MODE_CONNECTOR_Unknown) { + NV_WARN(drm, "unknown connector type %02x\n", + nv_connector->type); + nv_connector->type =3D DCB_CONNECTOR_NONE; + } } =20 - if (encoders & (1 << DCB_OUTPUT_DP)) { - if (encoders & (1 << DCB_OUTPUT_TMDS)) - nv_connector->type =3D DCB_CONNECTOR_DP; - else - nv_connector->type =3D DCB_CONNECTOR_eDP; - } else - if (encoders & (1 << DCB_OUTPUT_TMDS)) { - if (encoders & (1 << DCB_OUTPUT_ANALOG)) - nv_connector->type =3D DCB_CONNECTOR_DVI_I; - else - nv_connector->type =3D DCB_CONNECTOR_DVI_D; - } else - if (encoders & (1 << DCB_OUTPUT_ANALOG)) { - nv_connector->type =3D DCB_CONNECTOR_VGA; - } else - if (encoders & (1 << DCB_OUTPUT_LVDS)) { - nv_connector->type =3D DCB_CONNECTOR_LVDS; - } else - if (encoders & (1 << DCB_OUTPUT_TV)) { - nv_connector->type =3D DCB_CONNECTOR_TV_0; + /* no vbios data, or an unknown dcb connector type - attempt to + * figure out something suitable ourselves + */ + if (nv_connector->type =3D=3D DCB_CONNECTOR_NONE && + !WARN_ON(drm->client.device.info.family >=3D NV_DEVICE_INFO_V0_TESL= A)) { + struct dcb_table *dcbt =3D &drm->vbios.dcb; + u32 encoders =3D 0; + int i; +=20 + for (i =3D 0; i < dcbt->entries; i++) { + if (dcbt->entry[i].connector =3D=3D nv_connector->index) + encoders |=3D (1 << dcbt->entry[i].type); + } +=20 + if (encoders & (1 << DCB_OUTPUT_TMDS)) { + if (encoders & (1 << DCB_OUTPUT_ANALOG)) + nv_connector->type =3D DCB_CONNECTOR_DVI_I; + else + nv_connector->type =3D DCB_CONNECTOR_DVI_D; + } else + if (encoders & (1 << DCB_OUTPUT_ANALOG)) { + nv_connector->type =3D DCB_CONNECTOR_VGA; + } else + if (encoders & (1 << DCB_OUTPUT_LVDS)) { + nv_connector->type =3D DCB_CONNECTOR_LVDS; + } else + if (encoders & (1 << DCB_OUTPUT_TV)) { + nv_connector->type =3D DCB_CONNECTOR_TV_0; + } } } =20 @@@ -1367,11 -1387,10 +1386,9 @@@ ret =3D nouveau_bios_parse_lvds_table(dev, 0, &dummy, &dummy); if (ret) { NV_ERROR(drm, "Error parsing LVDS table, disabling\n"); -- kfree(nv_connector); -- return ERR_PTR(ret); ++ goto drm_conn_err; } =20 - funcs =3D &nouveau_connector_funcs_lvds; break; case DRM_MODE_CONNECTOR_DisplayPort: case DRM_MODE_CONNECTOR_eDP: --Sig_/o52gEQ/sgnm94h5t6ow.E0z Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEENIC96giZ81tWdLgKAVBC80lX0GwFAmUKRusACgkQAVBC80lX 0Gz/Jwf9EpFciQytMrB9EGPZlDQNNqcVzmXmhOf9lPP86jVE4c9drE/m/V3hI+HJ +1rtkzxoagrKym44GM5O+lE0ojheWp0hDejTFjAqeBkMGoj/WAzxW7bb8gAjDXkd NNUZcT1EmM9EfbBgH8fvBX2158atvl+82mOAlBpoT1jnEMnR3gQjer+rJN5leVlq TEQl8CB0fkGjqaqTEt/AHh4Wv8/jM5CTrsTUqM3ZBz+ffD/zPYiEFA49PxQX8WHb cllEMe1zIJsR2I//LPTFnmuvRIwC1Ws02STVlb5Sy1LTvbCDEJX1+TpGnuq+Hxl+ 6oZ4vG+hqHnZCyxHLW8mlLVlJAdw8Q== =BmcH -----END PGP SIGNATURE----- --Sig_/o52gEQ/sgnm94h5t6ow.E0z--