From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760219AbbJ3SIO (ORCPT ); Fri, 30 Oct 2015 14:08:14 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:37051 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760201AbbJ3SIM (ORCPT ); Fri, 30 Oct 2015 14:08:12 -0400 Subject: Re: [PATCH 1/2] dma: add Qualcomm Technologies HIDMA management driver To: Andy Shevchenko , Mark Rutland References: <1446174501-8870-1-git-send-email-okaya@codeaurora.org> <20151030150025.GF31073@leverpostej> Cc: dmaengine , timur@codeaurora.org, cov@codeaurora.org, jcm@redhat.com, Rob Herring , Pawel Moll , Ian Campbell , Kumar Gala , Vinod Koul , Dan Williams , devicetree , "linux-kernel@vger.kernel.org" From: Sinan Kaya Message-ID: <5633B207.5030505@codeaurora.org> Date: Fri, 30 Oct 2015 14:08:07 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/30/2015 1:59 PM, Andy Shevchenko wrote: > On Fri, Oct 30, 2015 at 5:00 PM, Mark Rutland wrote: >> On Thu, Oct 29, 2015 at 11:08:12PM -0400, Sinan Kaya wrote: >>> The Qualcomm Technologies HIDMA device has been designed >>> to support virtualization technology. The driver has been >>> divided into two to follow the hardware design. The management >>> driver is executed in hypervisor context and is the main >>> managment for all channels provided by the device. The >>> channel driver is exected in the guest OS context. >>> > >>> +#if IS_ENABLED(CONFIG_ACPI) >>> +static const struct acpi_device_id qcom_hidma_mgmt_acpi_ids[] = { >>> + {"QCOM8060"}, >>> + {}, >>> +}; >>> +#endif >> >> How do DMA engines work with ACPI? >> >> How are client relationships defined? > > The ACPI tables DSDT and CSRT (more info here: > http://www.acpi.info/links.htm) defines properties. > > DSDT: > per DMAC: the resources > per client: FixedDMA descriptor that contains channel / request line pair. > > CSRT: > necessary table to map which DMAC provides which request line, thus > request line numbering are global on platform. > > When DMAC driver is probed in the running system it should call as > well registration function from acpi-dma.c. > > All clients when use new DMA slave API gets channel automatically > based on their FixedDMA property. > > So, above is how it should be done. Didn't actually checked what this > driver does. > I was going to reply to all the questions in one pass but let me handle piece by piece. Here are some facts. - This hardware supports memcpy and memset only. - Memset feature was removed from the kernel sometime around 3.14. So no memset support in this driver either. - The hardware does not support DMA slave support - The goal is to provide an interface to DMA engine framework for memcpy optimization so that the rest of the kernel drivers and applications make use of the hardware. CSRT is an Intel specific ACPI table for slave devices. It was decided by Linaro that CSRT will not be supported for ARM64. There were some discussions in ACPI forums to define a similar table for ARM64 but we are not there today and this hardware does not support slave interface. ACPI enumeration is just like any other platform device. The driver gets looked up by a QCOM specific HID and the driver gets probed with the rest of the arguments in DSM object similar to device-tree attributes. The code uses device functions so the driver is not aware of where the parameters are coming from. -- 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