[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 5/7] xen/arm: rcar4: add delay after programming ATU


  • To: Grygorii Strashko <grygorii_strashko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Date: Wed, 12 Mar 2025 11:29:22 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hNDDTH8qzdmuqss7yRTXM86xM2fPKlepigqawWcrZ6g=; b=YhZa7ybyb+Y7Lzd/aoBGPvoEXtBHl8jSp9u/2rLNRF8FRgt5wAxuCWKxly8ffslYJlWb7McwuKl0160u02awkhr04Rlw4jsofNrT4cgW9BFFcVWLT4XnQECaNXwtLiSSuWYC1blJzyXk78xZ1hKRFZgtESgRxsgSYoBtdz0uoTHsQA725sir9V/5XumAjX/yu/m6qrNs82CQTXNMvbZCoPOHhfPNHBmby3RA9wEOOhAd0VacHZubql3fcJSqmLC9lPbzKPoBqAYU59Tz2NR1qkDkNG1oj7aMNSAzzHFg2lQnpeG/7A9Nc3pLD2xa9Y5P75ntVASATN7zhJhalO2nBw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WOWWH6ixB+2D8mIJtofK8Qc++zt9W/9S/nX7tIh5lZjkzGYfJNLBLIVK+6ew19j0dm1lpNOmJmTt4ThQ9OCrTBusav5i8CF0rxibT5DIESh79E4abk0lbToLGmX1kHqnDT2xUV9tnNCXN+O9Kg6Rbqn0wOdW6NJo/GIgURUrMzpCKxF+u4aBWMF/ffqnf2utT/jPdO8V6yuXY517lspChG7UzVdf/0p+IGuZiknbi5NzbYdRsSZfMOnLuCKym++GemGPLBr7BKfpKzQxvVbIx9nLLkbM8qUOv6Lm6MViiHezXUqcb0AICNfgnTYzuwVhMUUmsxh1AvZrgUead9GOSA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Wed, 12 Mar 2025 11:29:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbkm/V+s7gEh8jVE2kSVeMpYb04rNvSZEAgAAVjoA=
  • Thread-topic: [PATCH v2 5/7] xen/arm: rcar4: add delay after programming ATU


On 12.03.25 12:12, Grygorii Strashko wrote:
> 
> 
> On 11.03.25 12:24, Mykyta Poturai wrote:
>> From: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
>>
>> For some reason, we need a delay before accessing ATU region after
>> we programmed it. Otherwise, we'll get erroneous TLP.
>>
>> There is a code below, which should do this in proper way, by polling
>> CTRL2 register, but according to documentation, hardware does not
>> change this ATU_ENABLE bit at all.
>>
>> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
>> Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
>> ---
>> v1->v2:
>> * rebased
>> ---
>>   xen/arch/arm/pci/pci-designware.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/xen/arch/arm/pci/pci-designware.c 
>> b/xen/arch/arm/pci/pci-designware.c
>> index 6ab03cf9b0..def2c12d63 100644
>> --- a/xen/arch/arm/pci/pci-designware.c
>> +++ b/xen/arch/arm/pci/pci-designware.c
>> @@ -194,6 +194,11 @@ static void 
>> dw_pcie_prog_outbound_atu_unroll(struct pci_host_bridge *pci,
>>       dw_pcie_writel_ob_unroll(pci, index, PCIE_ATU_UNR_REGION_CTRL2,
>>                                PCIE_ATU_ENABLE);
>> +    /*
>> +     * HACK: We need to delay there, because the next code does not
>> +     * work as expected on S4
>> +     */
>> +    mdelay(1);
> 
> It seems like a HACK to WA some platform issue, but in its current form it
> will affect all DW PCI compatible platforms.
> 
> So, it is required a proper solution for the affected platform to be 
> found, or
> some sort of DW PCI "quirk"s processing code be introduced.
> 
> I'd recommend to drop this patch for now from this series.
> 
>>       /*
>>        * Make sure ATU enable takes effect before any subsequent config
>>        * and I/O accesses.
> 
> BR,
> -grygorii

Hi Grygorii

After some further investigations I have retested this on V4H, and it 
seems to work fine without delays. Considering this and the issue with 
static variables and multiple PCI hosts I think I will drop ATU related 
workarounds until some proper quirks handling system is established.

-- 
Mykyta

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.