[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SA1PR12MB719909C3C49CEA0FACB2DF76B0132@SA1PR12MB7199.namprd12.prod.outlook.com>
Date: Thu, 9 Jan 2025 22:46:20 +0000
From: Ankit Agrawal <ankita@...dia.com>
To: Alex Williamson <alex.williamson@...hat.com>
CC: Jason Gunthorpe <jgg@...dia.com>, Yishai Hadas <yishaih@...dia.com>,
"shameerali.kolothum.thodi@...wei.com"
<shameerali.kolothum.thodi@...wei.com>, "kevin.tian@...el.com"
<kevin.tian@...el.com>, Zhi Wang <zhiw@...dia.com>, Aniket Agashe
<aniketa@...dia.com>, Neo Jia <cjia@...dia.com>, Kirti Wankhede
<kwankhede@...dia.com>, "Tarun Gupta (SW-GPU)" <targupta@...dia.com>, Vikram
Sethi <vsethi@...dia.com>, Andy Currid <acurrid@...dia.com>, Alistair Popple
<apopple@...dia.com>, John Hubbard <jhubbard@...dia.com>, Dan Williams
<danw@...dia.com>, "Anuj Aggarwal (SW-GPU)" <anuaggarwal@...dia.com>, Matt
Ochs <mochs@...dia.com>, "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 3/3] vfio/nvgrace-gpu: Check the HBM training and C2C
link status
Thanks Alex for the review.
>> +static int nvgrace_gpu_check_device_status(struct pci_dev *pdev)
>
> "nvgrace_gpu_wait_device_ready()"?
Ok, I'll rename it.
>> +{
>> + void __iomem *io;
>> + int time_elasped;
>> +
>> + io = pci_iomap(pdev, 0, ~0UL);
>
> The documentation is unclear here, but existing code suggests passing 0
> here rather than -1 to map the full BAR. It ends up being equivalent
> since the code doesn't error attempting to map longer than the BAR, but
> there's no reason to add a bad example.
Ack, will change to use 0.
>> + }
>> + msleep(POLL_QUANTUM_MS);
>> + }
>
> time_after() would simplify things here. I'd also suggest a common
> exit path.
Understood, will change.
>> +
>> + pci_iounmap(pdev, io);
>> + return -ENODEV;
>
> ETIME could work for the error code too. Thanks,
Ack.
Powered by blists - more mailing lists