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

Re: [PATCH 1/3] swiotlb: don't panic when the swiotlb buffer can't be allocated


  • To: <hch@xxxxxx>, <iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx>
  • From: <Conor.Dooley@xxxxxxxxxxxxx>
  • Date: Fri, 13 May 2022 07:47:01 +0000
  • Accept-language: en-IE, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none
  • 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ha+S6QZVIMC4KSypJ/PoMugEFPcY4uAaecmyl3QehRE=; b=dihUw7QjXxmKxTt3HaIElDL9gmtBA60lo5HGdMv2eGOrw51mIEzZRMiMSmaX/AHK5YabqPUOnuu8vJEDOW/cDu4RTZo00HUmOQp/5zkaaJ99EZUMz/qPT8UGlKY523u8wFx6HoErR4BrkOVO7qhtnAPQWfT4sAVAWL8IdfeKzZChsnigaDs+lS1qYFn9q4ZrsQw75opf5yNPrExDiZAS0Ia6ylvsS+h21l2z617PMM4syhmH57zBgl/XPTeq1sWnbYw9oSJAfhMSIvajjayyGh7w0RGoUPIbfK09//xAR4jqsiTzgPqWAdbtnmHS/8rvtlyIdtG9E1Dc2iFSnchsWw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eCSjzpcS7HAsXPeUb9rGftPkxaxgATsJTcdPytMHEwDvJV+p8FgApLw7dvx6mHcznm63jaEyGbebgfj53NtI8lUPuhewxHPrs7206PXcS+Lrab6Ev/Z6MjAxORfjMFBA3ZycEfAd086Q19Mv8HZrYKyppycdmIx5roTjDsA2HK54TGX3HSM3chtGp9Xq3qgqdoDLrVDTd9nAnEGgZHNlsreaJSBFADKS3izSHS/8UOy+CWTNaAIOK9vy4Qb8bq430kBlOgqpzit/Shxv1SuIqRXorydl0PX9tzX2vOAScWE4sz/C1xqqFpvVX+9+gffPkk9huuy22KTmw/6GsgGszg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microchip.com;
  • Cc: <sstabellini@xxxxxxxxxx>, <boris.ostrovsky@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 13 May 2022 07:50:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYZTbP/7RHBCbSm02P2TeeL38cb60ccGmA
  • Thread-topic: [PATCH 1/3] swiotlb: don't panic when the swiotlb buffer can't be allocated

On 11/05/2022 13:58, Christoph Hellwig wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the 
> content is safe
> 
> For historical reasons the switlb code paniced when the metadata could
> not be allocated, but just printed a warning when the actual main
> swiotlb buffer could not be allocated.  Restore this somewhat unexpected
> behavior as changing it caused a boot failure on the Microchip RISC-V
> PolarFire SoC Icicle kit.
> 
> Fixes: 6424e31b1c05 ("swiotlb: remove swiotlb_init_with_tbl and 
> swiotlb_init_late_with_tbl")
> Reported-by: Conor Dooley <Conor.Dooley@xxxxxxxxxxxxx>
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> Tested-by: Conor Dooley <Conor.Dooley@xxxxxxxxxxxxx>

FWIW:
Acked-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>

> ---
>   kernel/dma/swiotlb.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
> index e2ef0864eb1e5..3e992a308c8a1 100644
> --- a/kernel/dma/swiotlb.c
> +++ b/kernel/dma/swiotlb.c
> @@ -254,8 +254,10 @@ void __init swiotlb_init_remap(bool addressing_limit, 
> unsigned int flags,
>                  tlb = memblock_alloc(bytes, PAGE_SIZE);
>          else
>                  tlb = memblock_alloc_low(bytes, PAGE_SIZE);
> -       if (!tlb)
> -               panic("%s: failed to allocate tlb structure\n", __func__);
> +       if (!tlb) {
> +               pr_warn("%s: failed to allocate tlb structure\n", __func__);
> +               return;
> +       }
> 
>          if (remap && remap(tlb, nslabs) < 0) {
>                  memblock_free(tlb, PAGE_ALIGN(bytes));
> --
> 2.30.2
> 


 


Rackspace

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