linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: okaya@codeaurora.org (Sinan Kaya)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V13 10/10] vfio, platform: add QTI HIDMA reset driver
Date: Mon, 1 Feb 2016 10:51:23 -0500	[thread overview]
Message-ID: <56AF7EFB.9040108@codeaurora.org> (raw)
In-Reply-To: <56AF7C9D.4070600@linaro.org>

On 2/1/2016 10:41 AM, Eric Auger wrote:
> Hi Sinan,

>> +
>> +	trreg = vdev->regions[0];
>> +	if (!trreg.ioaddr) {
>> +		trreg.ioaddr =
>> +			ioremap_nocache(trreg.addr, trreg.size);
> this is going to leak. See "vfio: platform: reset: calxedaxgmac: fix
> ioaddr leak".

Thanks, I was following what other drivers were doing and got hit by the same problem :)

>> +		if (!trreg.ioaddr)
>> +			return -ENOMEM;
>> +	}
>> +
>> +	evreg = vdev->regions[1];
>> +	if (!evreg.ioaddr) {
>> +		evreg.ioaddr =
>> +			ioremap_nocache(evreg.addr, evreg.size);
> same here
I'll take care of it.

>> +		if (!evreg.ioaddr)
>> +			return -ENOMEM;
>> +	}
>> +
> I understood the device is a kind of SR-IOV platform device. When the VF
> gets reset are there any interactions with the management driver? Is it
> handled by HW?

There is no communication between the management interface and the DMA channels. 
Management interface is just a runtime platform resource allocator. 

"if you pay more, you get more DMA bandwidth. Otherwise, you get to share the channel 
with other users"

The DMA channels can be reset independent of other DMA channels or the management HW. 
This is a HW feature.

> 
> Best Regards
> 
> Eric
>> +	/* disable IRQ */
>> +	writel(0, evreg.ioaddr + EVCA_IRQ_EN_OFFSET);
>> +
>> +	/* reset both transfer and event channels */
>> +	val = readl(trreg.ioaddr + TRCA_CTRLSTS_OFFSET);
>> +	val &= ~(CH_CONTROL_MASK << 16);
>> +	val |= CH_RESET << 16;
>> +	writel(val, trreg.ioaddr + TRCA_CTRLSTS_OFFSET);
>> +
>> +	ret = readl_poll_timeout(trreg.ioaddr + TRCA_CTRLSTS_OFFSET, val,
>> +				 HIDMA_CH_STATE(val) == CH_DISABLED, 1000,
>> +				 10000);
>> +	if (ret)
>> +		return ret;
>> +
>> +	val = readl(evreg.ioaddr + EVCA_CTRLSTS_OFFSET);
>> +	val &= ~(CH_CONTROL_MASK << 16);
>> +	val |= CH_RESET << 16;
>> +	writel(val, evreg.ioaddr + EVCA_CTRLSTS_OFFSET);
>> +
>> +	ret = readl_poll_timeout(evreg.ioaddr + EVCA_CTRLSTS_OFFSET, val,
>> +				 HIDMA_CH_STATE(val) == CH_DISABLED, 1000,
>> +				 10000);
>> +	if (ret)
>> +		return ret;
>> +
>> +	pr_info("HIDMA channel reset\n");
>> +	return 0;
>> +}
>> +module_vfio_reset_handler("qcom,hidma", NULL,
>> +			  vfio_platform_qcomhidma_reset);
>> +
>> +MODULE_LICENSE("GPL v2");
>> +MODULE_DESCRIPTION("Reset support for Qualcomm Technologies HIDMA device");
>>
> 


-- 
Sinan Kaya
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

      reply	other threads:[~2016-02-01 15:51 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29 22:35 [PATCH V13 00/10] dma: add Qualcomm Technologies HIDMA driver Sinan Kaya
2016-01-29 22:35 ` [PATCH V13 01/10] dma: qcom_bam_dma: move to qcom directory Sinan Kaya
2016-01-29 22:35 ` [PATCH V13 02/10] dma: hidma: Add Device Tree binding Sinan Kaya
2016-01-29 22:35 ` [PATCH V13 03/10] dma: add Qualcomm Technologies HIDMA management driver Sinan Kaya
2016-01-29 22:35 ` [PATCH V13 04/10] dma: add Qualcomm Technologies HIDMA channel driver Sinan Kaya
2016-01-29 22:35 ` [PATCH V13 05/10] dma: qcom_hidma: implement lower level hardware interface Sinan Kaya
2016-01-29 22:35 ` [PATCH V13 06/10] dma: qcom_hidma: add debugfs hooks Sinan Kaya
2016-01-29 22:35 ` [PATCH V13 07/10] dma: qcom_hidma: add support for object hierarchy Sinan Kaya
2016-01-29 22:35 ` [PATCH V13 08/10] dma: qcom_hidma: read the channel id from HW Sinan Kaya
2016-02-01 15:14   ` Rob Herring
2016-02-03 18:32     ` Sinan Kaya
2016-02-01 15:35   ` Mark Rutland
2016-02-01 15:46     ` Sinan Kaya
2016-02-03 18:32     ` Sinan Kaya
2016-02-03 18:36       ` Mark Rutland
2016-02-03 18:46         ` Sinan Kaya
2016-02-07 15:04         ` Sinan Kaya
2016-02-09 21:01           ` Sinan Kaya
2016-01-29 22:35 ` [PATCH V13 09/10] vfio, platform: add support for ACPI while detecting the reset driver Sinan Kaya
2016-01-30 12:52   ` kbuild test robot
2016-01-31 13:53   ` Sinan Kaya
2016-02-01 16:08   ` Eric Auger
2016-02-01 16:16     ` Sinan Kaya
2016-02-01 16:29       ` Eric Auger
2016-02-01 16:44         ` Sinan Kaya
2016-02-01 16:49           ` Timur Tabi
2016-02-01 16:56             ` Sinan Kaya
2016-02-03 18:38         ` Sinan Kaya
2016-01-29 22:35 ` [PATCH V13 10/10] vfio, platform: add QTI HIDMA " Sinan Kaya
2016-02-01 15:41   ` Eric Auger
2016-02-01 15:51     ` Sinan Kaya [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=56AF7EFB.9040108@codeaurora.org \
    --to=okaya@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).