From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.66]) by mx.groups.io with SMTP id smtpd.web11.33198.1591004282086611268 for ; Mon, 01 Jun 2020 02:38:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@vmware.com header.s=selector2 header.b=pbvJsi2g; spf=pass (domain: vmware.com, ip: 40.107.220.66, mailfrom: awarkentin@vmware.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YvunY42QNZg381PgfMh3b6w9qPZUh2Qmgk1QpVraXmD3Omue2D2gZL6wTzRXSY/xTDxwLQiL5sC3xOGlo/OZZExj1JgoRTd2zmgTTBngvD1O/gS6tFP3wKqMj4Cq040csRqSNptWdFjurrv+9HQAkvwI11YhM8JUN2hS3y8Tdsjyc+5Ipoxjvj9DZgevdPQLf42OUkPRv2H6gHmLGUU8kF4yHqir14RJ7erjQiT9Szqck7OmNY6WdF1/9+9qW36ueqtZ8hvMOv7lCJfjqWqal5iHPRoXcTPpznv0Rk8bEGoQOtxHA1mPvCua1BRFggMkAF2wL/ZV9TxGbtOsWlVQdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zlattdFNoorRy4Kiz7VNwo1c+F2uZWQO19kBFgHImuQ=; b=Epcf4w1UkAAPtpUWj4PO7y5f5WIXhzUdVlNGIBcmgRrjfASFbfKFA9RgHFzhKa48y2hFKYinzElctzcftHcsFr9JHH2NZss1i/UUcb3oKow5Xa+JRg+9722mWOWp6MrLbAA++S6Kltxh5p4vA4DH9QY4DYLoUJBw7XrTTM5C1aGgSMyZCTYSfJ9HYgbCJagaKkIX+uOq0w3kfzpUOlVox/FWgbBzxOgYXjq6FRi7PLCFQt5v0ra0XH5my30pr6XBpVHVorLc0C2tm0XNSXfTlzSJWSck2lQlv2yROQQ39QuNp17kZs1/IepY4ICztcAJs/UxEvOxW7OB6UO/Bi2oyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zlattdFNoorRy4Kiz7VNwo1c+F2uZWQO19kBFgHImuQ=; b=pbvJsi2g3WOsn3expylUe/7M5ihl5rDIFljSfFimnshw65LlRtQmjPBGUdwpDEA4W3l+0TWSu6hQIZdLqVrY4fyvsPDtmKZujQc+p68eHRRzKfxIFsBciAhd6kIHj+33GAwQ2woJbfLkuhze2TyLjlWd6Zy76Fg+MIXU9OwiLUg= Received: from BN6PR05MB3411.namprd05.prod.outlook.com (2603:10b6:405:43::23) by BN6PR05MB3554.namprd05.prod.outlook.com (2603:10b6:405:44::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.8; Mon, 1 Jun 2020 09:37:59 +0000 Received: from BN6PR05MB3411.namprd05.prod.outlook.com ([fe80::e1ef:31eb:c802:aef0]) by BN6PR05MB3411.namprd05.prod.outlook.com ([fe80::e1ef:31eb:c802:aef0%3]) with mapi id 15.20.3066.007; Mon, 1 Jun 2020 09:37:59 +0000 From: "Andrei Warkentin" To: Andrei Warkentin , "devel@edk2.groups.io" , "ard.biesheuvel@arm.com" CC: "leif@nuviainc.com" , "pete@akeo.ie" , "philmd@redhat.com" Subject: Re: [edk2-devel] [edk2-platforms][PATCH 1/1] Pi4: notify VPU to load xHCI firmware before XhciDxe binds Thread-Topic: [edk2-devel] [edk2-platforms][PATCH 1/1] Pi4: notify VPU to load xHCI firmware before XhciDxe binds Thread-Index: AQHWN8PGcDRborSj20GhI8UKAP4qe6jDVPiAgAAquV0= Date: Mon, 1 Jun 2020 09:37:59 +0000 Message-ID: References: <20200601032130.95634-1-andrey.warkentin@gmail.com>,<3121e7a6-afb7-038e-4fcd-5a317d3194e9@arm.com> In-Reply-To: <3121e7a6-afb7-038e-4fcd-5a317d3194e9@arm.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=vmware.com; x-originating-ip: [98.214.99.181] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 508c1fde-3528-4ef6-b4df-08d8060f7905 x-ms-traffictypediagnostic: BN6PR05MB3554: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0421BF7135 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: g93glbqpaFqaAD9frdzdr+6/zuUxJRPjGZtTgY4j6Xgvn1RuiaR6Y+HtQncxJqlwEJLTMDYVm/j+LdTrBsPkqIBr9CagLvka3mMXNuI0xshM9pB1Tc8yV1Q4fzk7xZffn1y5RqA+JIp5+jJmVuuMIFMWjmvukVXYTC6ulxX4ryF8EtewIFAxZYfXgFtvF5k5w8hIM7uxGSR6/h4da/xQlaB876I4cQWWjJoWhborXaF7Y+JF7u5Y1EpvElDQ765oEEFECHT5fb2o192TfXpO7dWV9lCJl6XHbvzXhGj2D/xzMvW9JFStdaPpK7R9H+kcct+p3dQX6zYSQXe4rBawXg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR05MB3411.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(346002)(136003)(396003)(39860400002)(376002)(4326008)(55016002)(9686003)(66446008)(4744005)(64756008)(66946007)(66556008)(66476007)(76116006)(5660300002)(19627405001)(6506007)(26005)(54906003)(316002)(110136005)(2906002)(33656002)(7696005)(186003)(8936002)(71200400001)(52536014)(86362001)(83380400001)(8676002)(478600001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: 7kD+z7n/ChjTGBdXv0mNoCOGB/AIZiQrszUFVH4KniMO89tlnovuYbYpfm7GArBVFflitSUNONJToKmTtWraR/9Ag/7ENznDFiHxmLMmrN98F+FfmMk/hURnfuop6QTb85K2DRM876ul2ogsDZhDtWRzYmobDbcNJ7hvxxmAwKloixp+MeY9UiK36Ikm4fTrdkSYooTmncS1754rFcq7fv7WF/tP2P3HMDQMA6QhLeQ1kiv68ZlT+j7LV8nF2Q4GbilAfqYAgWkTcG5Gopk2J6G6IyKmcyU27OqObrOX1HQO2/oYmxlRGLUS73flPit53xHQ6vdwZBHks3wFuIxGeoQLUuBZzdAzvojKvVGkf0Rdb43RW3+/0Sgil7L8lEz2T+sQybO3SoDAF8xnBjoTZkbS1qnweMUi27CI2nMuQ0V0qZeupsWJyhxE9QuAsTzoOIbeGT0pvNhX8vNevSZ8JGT9/yZd0UpJxzM/rCvbDm0= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 508c1fde-3528-4ef6-b4df-08d8060f7905 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jun 2020 09:37:59.6489 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: zC525PO71D1U/S/4aaQcKF/FLUEaXF8MM25VSQCGNpWKkHxKS81hA4F60GZDcQvebPrrvt+7jJi+7rgie9TDtQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR05MB3554 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BN6PR05MB341168A240AACAB7D4E40A44B98A0BN6PR05MB3411namp_" --_000_BN6PR05MB341168A240AACAB7D4E40A44B98A0BN6PR05MB3411namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Ard, The xHCI controller is initialized with its microcode by the VPU firmware, = if I understood correctly, synchronously. When RPI_MBOX_NOTIFY_XHCI_RESET fini= shes, the XHCI controller is ready to go. So this is not any more unsafe than any of the other mailbox calls. To be h= onest, I think RpiFirmwareDxe should be cleaned up to replace the useless s= pinlocks (there's no multiprocessing component) with a TPL manip (I checked= SynchonizationLib and it doesn't touch the TPL) Applying your other feedback now... A ________________________________ From: devel@edk2.groups.io on behalf of Ard Biesheuv= el via groups.io > + > + Status =3D MailboxTransaction (Cmd->BufferHead.BufferSize, RPI_MBOX_VC= _CHANNEL, &Result); > + So this pokes the XHCI controller via its config space? Is it safe to do that without raising the TPL? What happens if another config space access occurs concurrently? A --_000_BN6PR05MB341168A240AACAB7D4E40A44B98A0BN6PR05MB3411namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi Ard,

The xHCI controller is initialized with its microcode by the VPU firmware, = if
I understood correctly, synchronously. When RPI_MBOX_NOTIFY_XHCI_RESET= finishes, the XHCI controller is ready to go.

So this is not any more unsafe than any of the other mailbox calls. To be h= onest, I think RpiFirmwareDxe should be cleaned up to replace the useless s= pinlocks (there's no multiprocessing component) with a TPL manip (I checked= SynchonizationLib and it doesn't touch the TPL)

Applying your other feedback now...

A

From: devel@edk2.groups.io = <devel@edk2.groups.io> on behalf of Ard Biesheuvel via groups.io <= ard.biesheuvel=3Darm.com@groups.io>

> +
> +  Status =3D MailboxTransaction (Cmd->BufferHead.BufferSi= ze, RPI_MBOX_VC_CHANNEL, &Result);
> +

So this pokes the XHCI controller via its config space? Is it safe to do that without raising the TPL? What happens if another config space
access occurs concurrently?

A
--_000_BN6PR05MB341168A240AACAB7D4E40A44B98A0BN6PR05MB3411namp_--