Re: [PATCH 1/5] mpt3sas: Don't change the dma coherent mask after allocations

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

 



On Tue, Feb 11, 2020 at 05:18:09AM -0500, suganath-prabu.subramani@xxxxxxxxxxxx wrote:
> From: Suganath Prabu S <suganath-prabu.subramani@xxxxxxxxxxxx>
> 
> During driver load ioc->dma_mask is set to 0. Since this
> flag is not set, in _base_config_dma_addressing() driver
> always sets 32 bit DMA and later after allocating memory
> for RDPQ's the dma mask is set to 64/63 bit from
> _base_change_consistent_dma_mask.

Please use up 74 chars for your commit messages.

> +	u64 consistent_dma_mask = DMA_BIT_MASK(64);
>  	if (ioc->is_mcpu_endpoint)

Please keep an empty line after variable declarations.

> +	if (sizeof(dma_addr_t) > 4) {
> +		const u64 required_mask = dma_get_required_mask(&pdev->dev);
> +		if ((required_mask > DMA_BIT_MASK(32)) &&

No need for the braces.

> +		    !pci_set_dma_mask(pdev, consistent_dma_mask) &&
> +		    !pci_set_consistent_dma_mask(pdev,

Please do not use the pci_* functions in new code, but use the
generic DMA ones.

> +		    consistent_dma_mask)) {
> +			ioc->base_add_sg_single = &_base_add_sg_single_64;
> +			ioc->sge_size = sizeof(Mpi2SGESimple64_t);
> +			goto out;
> +		}
> +	}
> +try_32bit:
> +	if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))
> +	    && !pci_set_consistent_dma_mask(pdev,

Wrong coding style.  Also there is no need to fall back to a smaller
mask in modern kernels ever.

In other words: please drop this patch and use the one I submitted
weeks ago, as it gets all these things right.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux