All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sricharan R <sricharan@codeaurora.org>
To: Abhishek Sahu <absahu@codeaurora.org>,
	dwmw2@infradead.org, computersforpeace@gmail.com,
	boris.brezillon@free-electrons.com, marek.vasut@gmail.com,
	richard@nod.at, cyrille.pitchen@wedev4u.fr, robh+dt@kernel.org,
	mark.rutland@arm.com
Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	andy.gross@linaro.org, architt@codeaurora.org
Subject: Re: [PATCH 05/14] qcom: mtd: nand: allocate bam transaction
Date: Mon, 3 Jul 2017 13:52:03 +0530	[thread overview]
Message-ID: <906da0d9-2ef7-583a-4008-4f444eaa340b@codeaurora.org> (raw)
In-Reply-To: <1498720566-20782-6-git-send-email-absahu@codeaurora.org>

Hi Abhishek,

<..>

> +/* Allocates and Initializes the BAM transaction */
> +static struct bam_transaction *
> +alloc_bam_transaction(struct qcom_nand_controller *nandc, unsigned int num_cw)
> +{
> +	struct bam_transaction *bam_txn;
> +
> +	bam_txn = devm_kzalloc(nandc->dev, sizeof(*bam_txn), GFP_KERNEL);
> +
> +	if (!bam_txn)
> +		return NULL;
> +
> +	bam_txn->bam_ce =
> +		devm_kzalloc(nandc->dev, sizeof(*bam_txn->bam_ce) *
> +			     num_cw * QPIC_PER_CW_MAX_CMD_ELEMENTS, GFP_KERNEL);
> +	if (!bam_txn->bam_ce)
> +		return NULL;
> +
> +	bam_txn->cmd_sgl =
> +		devm_kzalloc(nandc->dev, sizeof(*bam_txn->cmd_sgl) * num_cw *
> +			     QPIC_PER_CW_MAX_CMD_SGL, GFP_KERNEL);
> +	if (!bam_txn->cmd_sgl)
> +		return NULL;
> +
> +	bam_txn->data_sg =
> +		devm_kzalloc(nandc->dev, sizeof(*bam_txn->data_sg) *
> +			     num_cw * QPIC_PER_CW_MAX_DATA_SGL, GFP_KERNEL);
> +	if (!bam_txn->data_sg)
> +		return NULL;
> +
> +	nandc->max_cwperpage = num_cw;
> +
> +	return bam_txn;
> +}
> +
>  static inline struct qcom_nand_host *to_qcom_nand_host(struct nand_chip *chip)
>  {
>  	return container_of(chip, struct qcom_nand_host, chip);
> @@ -1868,6 +1958,8 @@ static int qcom_nand_host_setup(struct qcom_nand_host *host)
>  	mtd_set_ooblayout(mtd, &qcom_nand_ooblayout_ops);
>  
>  	cwperpage = mtd->writesize / ecc->size;
> +	nandc->max_cwperpage = max_t(unsigned int, nandc->max_cwperpage,
> +					cwperpage);
>  
>  	/*
>  	 * DATA_UD_BYTES varies based on whether the read/write command protects
> @@ -2010,6 +2102,19 @@ static int qcom_nandc_alloc(struct qcom_nand_controller *nandc)
>  			dev_err(nandc->dev, "failed to request cmd channel\n");
>  			return -ENODEV;
>  		}
> +
> +		/*
> +		 * Initially allocate BAM transaction to read ONFI param page.
> +		 * After detecting all the devices, this BAM transaction will
> +		 * be freed and the next BAM tranasction will be allocated with
> +		 * maximum codeword size
> +		 */
> +		nandc->bam_txn = alloc_bam_transaction(nandc, 1);
> +		if (!nandc->bam_txn) {
> +			dev_err(nandc->dev,
> +				"failed to allocate bam transaction\n");
> +			return -ENOMEM;
> +		}
>  	}
>  
>  	INIT_LIST_HEAD(&nandc->desc_list);
> @@ -2153,6 +2258,17 @@ static int qcom_probe_nand_devices(struct qcom_nand_controller *nandc)
>  	if (list_empty(&nandc->host_list))
>  		return -ENODEV;
>  
> +	if (nandc->dma_bam_enabled) {
> +		free_bam_transaction(nandc);
> +		nandc->bam_txn = alloc_bam_transaction(nandc,
> +						       nandc->max_cwperpage);

 Somehow, looks like something is missing because, nandc->max_cwperpage passed from
 here is used in alloc_bam_transaction, but it is assigned in the same function ?

Regards,
 Sricharan

-- 
"QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

  parent reply	other threads:[~2017-07-03  8:22 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29  7:15 [PATCH 00/14] Add QCOM QPIC NAND support Abhishek Sahu
2017-06-29  7:15 ` Abhishek Sahu
2017-06-29  7:15 ` [PATCH 03/14] qcom: mtd: nand: Fixed config error for BCH Abhishek Sahu
2017-06-29  9:49   ` Marek Vasut
2017-07-03 19:47     ` Boris Brezillon
2017-07-17  6:38       ` Abhishek Sahu
2017-07-17  6:38         ` Abhishek Sahu
     [not found]   ` <1498720566-20782-4-git-send-email-absahu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-07-03  6:25     ` Sricharan R
2017-07-03  6:25       ` Sricharan R
2017-06-29  7:15 ` [PATCH 04/14] qcom: mtd: nand: reorganize nand devices probing Abhishek Sahu
2017-06-29  7:15   ` Abhishek Sahu
2017-06-29  7:15 ` [PATCH 05/14] qcom: mtd: nand: allocate bam transaction Abhishek Sahu
     [not found]   ` <1498720566-20782-6-git-send-email-absahu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-06-29  9:50     ` Marek Vasut
2017-06-29  9:50       ` Marek Vasut
     [not found]       ` <659d69fd-ae7c-b566-ccab-aca2a3efe178-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-07-17  6:42         ` Abhishek Sahu
2017-07-17  6:42           ` Abhishek Sahu
2017-07-03  8:22   ` Sricharan R [this message]
     [not found]     ` <906da0d9-2ef7-583a-4008-4f444eaa340b-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-07-17  6:44       ` Abhishek Sahu
2017-07-17  6:44         ` Abhishek Sahu
     [not found] ` <1498720566-20782-1-git-send-email-absahu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-06-29  7:15   ` [PATCH 01/14] qcom: mtd: nand: Add driver data for QPIC DMA Abhishek Sahu
2017-06-29  7:15     ` Abhishek Sahu
2017-06-29  9:46     ` Marek Vasut
2017-07-03  4:38     ` Archit Taneja
2017-07-03 19:41       ` Boris Brezillon
2017-07-17  6:11         ` Abhishek Sahu
     [not found]           ` <bfb3d3c466e60fa08f969ea485870ba4-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-07-17  7:22             ` Boris Brezillon
2017-07-17  7:22               ` Boris Brezillon
2017-07-17  8:49               ` Abhishek Sahu
2017-07-17  8:49                 ` Abhishek Sahu
2017-07-03  6:21     ` Sricharan R
2017-06-29  7:15   ` [PATCH 02/14] qcom: mtd: nand: add and initialize QPIC DMA resources Abhishek Sahu
2017-06-29  7:15     ` Abhishek Sahu
2017-06-29  9:48     ` Marek Vasut
     [not found]       ` <01e12a9a-4f3b-1bde-473a-3cbe3f72ef74-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-07-17  6:36         ` Abhishek Sahu
2017-07-17  6:36           ` Abhishek Sahu
     [not found]     ` <1498720566-20782-3-git-send-email-absahu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-07-03  5:17       ` Archit Taneja
2017-07-03  5:17         ` Archit Taneja
2017-07-17  6:26         ` Abhishek Sahu
2017-07-03  6:24       ` Sricharan R
2017-07-03  6:24         ` Sricharan R
2017-07-03  6:32       ` Sricharan R
2017-07-03  6:32         ` Sricharan R
2017-06-29  7:15   ` [PATCH 06/14] qcom: mtd: nand: add bam dma descriptor handling Abhishek Sahu
2017-06-29  7:15     ` Abhishek Sahu
     [not found]     ` <1498720566-20782-7-git-send-email-absahu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-07-04  6:10       ` Archit Taneja
2017-07-04  6:10         ` Archit Taneja
     [not found]         ` <021637c8-8ce5-c54e-0254-41caa475063c-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-07-17  6:47           ` Abhishek Sahu
2017-07-17  6:47             ` Abhishek Sahu
2017-06-29  7:16   ` [PATCH 09/14] qcom: mtd: nand: BAM support for read page Abhishek Sahu
2017-06-29  7:16     ` Abhishek Sahu
2017-07-04  9:40     ` Archit Taneja
2017-07-10 14:15       ` Sricharan R
2017-07-17  7:17       ` Abhishek Sahu
2017-06-29  7:16   ` [PATCH 13/14] qcom: mtd: nand: support for QPIC version 1.5.0 Abhishek Sahu
2017-06-29  7:16     ` Abhishek Sahu
2017-07-04  9:57     ` Archit Taneja
     [not found]       ` <d6566f4e-c55b-18ed-611b-35bc191b2f5f-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-07-17  7:32         ` Abhishek Sahu
2017-07-17  7:32           ` Abhishek Sahu
2017-06-29  7:15 ` [PATCH 07/14] qcom: mtd: nand: support for passing flags in transfer functions Abhishek Sahu
2017-06-29  9:52   ` Marek Vasut
     [not found]   ` <1498720566-20782-8-git-send-email-absahu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-07-04  6:49     ` Archit Taneja
2017-07-04  6:49       ` Archit Taneja
2017-07-10 14:10       ` Sricharan R
     [not found]         ` <70776f79-6d51-5544-8be8-38e62b7c073e-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-07-17  6:59           ` Abhishek Sahu
2017-07-17  6:59             ` Abhishek Sahu
2017-06-29  7:16 ` [PATCH 08/14] qcom: mtd: nand: Add support for additional CSRs Abhishek Sahu
2017-07-04  6:54   ` Archit Taneja
2017-07-17  7:10     ` Abhishek Sahu
2017-06-29  7:16 ` [PATCH 10/14] qcom: mtd: nand: support for QPIC Page read/write Abhishek Sahu
     [not found]   ` <1498720566-20782-11-git-send-email-absahu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-07-04  9:44     ` Archit Taneja
2017-07-04  9:44       ` Archit Taneja
2017-07-17  7:25       ` Abhishek Sahu
2017-07-10 14:18     ` Sricharan R
2017-07-10 14:18       ` Sricharan R
2017-07-17  7:36       ` Abhishek Sahu
2017-06-29  7:16 ` [PATCH 11/14] qcom: mtd: nand: BAM raw read and write support Abhishek Sahu
2017-06-29  7:16 ` [PATCH 12/14] qcom: mtd: nand: change register offset defines with enums Abhishek Sahu
2017-07-04  9:55   ` Archit Taneja
     [not found]     ` <a8961294-c72b-035c-0924-f0f901821ea4-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-07-17  7:31       ` Abhishek Sahu
2017-07-17  7:31         ` Abhishek Sahu
2017-06-29  7:16 ` [PATCH 14/14] qcom: mtd: nand: programmed NAND_DEV_CMD_VLD register Abhishek Sahu

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=906da0d9-2ef7-583a-4008-4f444eaa340b@codeaurora.org \
    --to=sricharan@codeaurora.org \
    --cc=absahu@codeaurora.org \
    --cc=andy.gross@linaro.org \
    --cc=architt@codeaurora.org \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=richard@nod.at \
    --cc=robh+dt@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.