From: Christoph Hellwig <hch@infradead.org>
To: suganath-prabu.subramani@broadcom.com
Cc: linux-scsi@vger.kernel.org, sreekanth.reddy@broadcom.com,
kashyap.desai@broadcom.com, sathya.prakash@broadcom.com,
martin.petersen@oracle.com
Subject: Re: [PATCH 1/5] mpt3sas: Don't change the dma coherent mask after allocations
Date: Tue, 25 Feb 2020 10:37:06 -0800 [thread overview]
Message-ID: <20200225183706.GB6261@infradead.org> (raw)
In-Reply-To: <1581416293-41610-2-git-send-email-suganath-prabu.subramani@broadcom.com>
On Tue, Feb 11, 2020 at 05:18:09AM -0500, suganath-prabu.subramani@broadcom.com wrote:
> From: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
>
> 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.
next prev parent reply other threads:[~2020-02-25 18:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-11 10:18 [PATCH 0/5] mpt3sas: Fix changing coherent mask after allocation suganath-prabu.subramani
2020-02-11 10:18 ` [PATCH 1/5] mpt3sas: Don't change the dma coherent mask after allocations suganath-prabu.subramani
2020-02-25 18:37 ` Christoph Hellwig [this message]
2020-02-11 10:18 ` [PATCH 2/5] mpt3sas: Rename function name is_MSB_are_same suganath-prabu.subramani
2020-02-11 10:18 ` [PATCH 3/5] mpt3sas: Code Refactoring suganath-prabu.subramani
2020-02-11 10:18 ` [PATCH 4/5] mpt3sas: Handle RDPQ DMA allocation in same 4g region suganath-prabu.subramani
2020-02-25 18:42 ` Christoph Hellwig
2020-02-27 12:41 ` Sreekanth Reddy
2020-03-05 9:10 ` Sreekanth Reddy
[not found] ` <CA+RiK67RquZitjQrh=yGcdunAOZaOhS90xGk3Mco2rm-ZHrEYA@mail.gmail.com>
2020-03-18 6:53 ` Suganath Prabu Subramani
2020-03-19 13:09 ` Christoph Hellwig
2020-03-20 3:30 ` Suganath Prabu Subramani
2020-02-11 10:18 ` [PATCH 5/5] mpt3sas: Update version to 33.101.00.00 suganath-prabu.subramani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200225183706.GB6261@infradead.org \
--to=hch@infradead.org \
--cc=kashyap.desai@broadcom.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sathya.prakash@broadcom.com \
--cc=sreekanth.reddy@broadcom.com \
--cc=suganath-prabu.subramani@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox