public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>,
	linux-arm-msm@vger.kernel.org, coresight@lists.linaro.org,
	Mao Jinlong <jinlmao@codeaurora.org>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Stephen Boyd <swboyd@chromium.org>,
	linux-arm-kernel@lists.infradead.org,
	Mike Leach <mike.leach@linaro.org>
Subject: Re: [PATCH] coresight: tmc-etr: Check if page is valid before dma_map_page()
Date: Mon, 23 Nov 2020 11:10:30 -0700	[thread overview]
Message-ID: <20201123181030.GC104873@xps15> (raw)
In-Reply-To: <ad83c4bd-dc24-c412-c5f7-b51ca1f22588@arm.com>

On Mon, Nov 23, 2020 at 10:46:56AM +0000, Suzuki K Poulose wrote:
> On 11/23/20 10:21 AM, Sai Prakash Ranjan wrote:
> > From: Mao Jinlong <jinlmao@codeaurora.org>
> > 
> > alloc_pages_node() return should be checked before calling
> > dma_map_page() to make sure that valid page is mapped or
> > else it can lead to aborts as below:
> > 
> >   Unable to handle kernel paging request at virtual address ffffffc008000000
> >   Mem abort info:
> >   <snip>...
> >   pc : __dma_inv_area+0x40/0x58
> >   lr : dma_direct_map_page+0xd8/0x1c8
> > 
> >   Call trace:
> >    __dma_inv_area
> >    tmc_pages_alloc
> >    tmc_alloc_data_pages
> >    tmc_alloc_sg_table
> >    tmc_init_etr_sg_table
> >    tmc_alloc_etr_buf
> >    tmc_enable_etr_sink_sysfs
> >    tmc_enable_etr_sink
> >    coresight_enable_path
> >    coresight_enable
> >    enable_source_store
> >    dev_attr_store
> >    sysfs_kf_write
> > 
> > Fixes: 99443ea19e8b ("coresight: Add generic TMC sg table framework")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Mao Jinlong <jinlmao@codeaurora.org>
> > Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
> 
> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> 

Applied - thanks

Mathieu

> > ---
> >   drivers/hwtracing/coresight/coresight-tmc-etr.c | 2 ++
> >   1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c
> > index 525f0ecc129c..a31a4d7ae25e 100644
> > --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c
> > +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c
> > @@ -217,6 +217,8 @@ static int tmc_pages_alloc(struct tmc_pages *tmc_pages,
> >   		} else {
> >   			page = alloc_pages_node(node,
> >   						GFP_KERNEL | __GFP_ZERO, 0);
> > +			if (!page)
> > +				goto err;
> >   		}
> >   		paddr = dma_map_page(real_dev, page, 0, PAGE_SIZE, dir);
> >   		if (dma_mapping_error(real_dev, paddr))
> > 
> > base-commit: c04e5d7bbf6f92a346d6b36770705e7f034df42d
> > 
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2020-11-23 18:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201123102133.18979-1-saiprakash.ranjan@codeaurora.org>
2020-11-23 10:46 ` [PATCH] coresight: tmc-etr: Check if page is valid before dma_map_page() Suzuki K Poulose
2020-11-23 18:10   ` Mathieu Poirier [this message]

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=20201123181030.GC104873@xps15 \
    --to=mathieu.poirier@linaro.org \
    --cc=coresight@lists.linaro.org \
    --cc=jinlmao@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.leach@linaro.org \
    --cc=saiprakash.ranjan@codeaurora.org \
    --cc=stable@vger.kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=swboyd@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox