[PATCH v3 4/6] drm/panfrost: Add support for AARCH64_4K page table format

Ariel D'Alessandro ariel.dalessandro at collabora.com
Mon Mar 17 07:30:59 PDT 2025


Boris,

On 3/17/25 10:44 AM, Boris Brezillon wrote:
> On Mon, 17 Mar 2025 09:40:42 -0300
> Ariel D'Alessandro <ariel.dalessandro at collabora.com> wrote:
> 
>> +static int panfrost_mmu_cfg_init(struct panfrost_mmu *mmu,
>> +				  enum io_pgtable_fmt fmt)
>> +{
>> +	struct panfrost_device *pfdev = mmu->pfdev;
>> +
>> +	switch (fmt) {
>> +	case ARM_64_LPAE_S1:
>> +		return mmu_cfg_init_aarch64_4k(mmu);
>> +	case ARM_MALI_LPAE:
>> +		return mmu_cfg_init_mali_lpae(mmu);
>> +	default:
>> +		/* This should never happen */
>> +		return drm_WARN_ON(pfdev->ddev, -EINVAL);
> 
> This won't return -EINVAL, but !!(-EINVAL), AKA true. We should do
> 
> 	default:
> 		drm_WARN(ptdev->ddev, "Invalid pgtable format");
> 		return -EINVAL;
> 
> instead.

Ah, good catch. I missed that from the WARN_ON definition:

         int __ret_warn_on = !!(condition);

Thanks, will fix in v4.

-- 
Ariel D'Alessandro
Software Engineer

Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK 
Registered in England & Wales, no. 5513718




More information about the linux-arm-kernel mailing list