Subject: Re: [PATCH net-next 06/10] amd-xgbe: Set DMA mask based on hardware register value

From: Tom Lendacky <[email-masked]>
Date: Thu, 19 Mar 2015 12:40:05 -0500

On 03/19/2015 12:32 PM, David Laight wrote:
> From: Tom Lendacky
>> The hardware supplies a value that indicates the DMA range that it
>> is capable of using. Use this value rather than hard-coding it in
>> the driver.
> ...
>> +	/* Translate the address width setting into actual number */
>> +	switch (hw_feat->dma_width) {
>> +	case 0:
>> +		hw_feat->dma_width = 32;
>> +		break;
>> +	case 1:
>> +		hw_feat->dma_width = 40;
>> +		break;
>> +	case 2:
>> +		hw_feat->dma_width = 48;
>> +		break;
>> +	}
>> +
>
> I see a glaring problem should the hardware ever return 3.

Except this version of the hardware can't return a 3 and any future
versions will have a different device tree id or ACPI id and won't
match this driver (or the driver will be updated at that point to
support the newer versions).  I could have it default to 32 if you
feel it's really needed, though.

Thanks,
Tom

> 	David