[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 11 Nov 2019 09:51:19 +0530
From: Vinod Koul <vkoul@...nel.org>
To: Peter Ujfalusi <peter.ujfalusi@...com>
Cc: robh+dt@...nel.org, nm@...com, ssantosh@...nel.org,
dan.j.williams@...el.com, dmaengine@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, grygorii.strashko@...com,
lokeshvutla@...com, t-kristo@...com, tony@...mide.com,
j-keerthy@...com
Subject: Re: [PATCH v4 02/15] soc: ti: k3: add navss ringacc driver
On 01-11-19, 10:41, Peter Ujfalusi wrote:
> From: Grygorii Strashko <grygorii.strashko@...com>
> +config TI_K3_RINGACC
> + tristate "K3 Ring accelerator Sub System"
> + depends on ARCH_K3 || COMPILE_TEST
> + depends on TI_SCI_INTA_IRQCHIP
> + default y
You want to get an earful from Linus? We dont do default y on new stuff,
never :)
> +struct k3_ring_rt_regs {
> + u32 resv_16[4];
> + u32 db; /* RT Ring N Doorbell Register */
> + u32 resv_4[1];
> + u32 occ; /* RT Ring N Occupancy Register */
> + u32 indx; /* RT Ring N Current Index Register */
> + u32 hwocc; /* RT Ring N Hardware Occupancy Register */
> + u32 hwindx; /* RT Ring N Current Index Register */
nice comments, how about moving them up into kernel-doc style? (here and
other places as well)
> +struct k3_ring *k3_ringacc_request_ring(struct k3_ringacc *ringacc,
> + int id, u32 flags)
> +{
> + int proxy_id = K3_RINGACC_PROXY_NOT_USED;
> +
> + mutex_lock(&ringacc->req_lock);
> +
> + if (id == K3_RINGACC_RING_ID_ANY) {
> + /* Request for any general purpose ring */
> + struct ti_sci_resource_desc *gp_rings =
> + &ringacc->rm_gp_range->desc[0];
> + unsigned long size;
> +
> + size = gp_rings->start + gp_rings->num;
> + id = find_next_zero_bit(ringacc->rings_inuse, size,
> + gp_rings->start);
> + if (id == size)
> + goto error;
> + } else if (id < 0) {
> + goto error;
> + }
> +
> + if (test_bit(id, ringacc->rings_inuse) &&
> + !(ringacc->rings[id].flags & K3_RING_FLAG_SHARED))
> + goto error;
> + else if (ringacc->rings[id].flags & K3_RING_FLAG_SHARED)
> + goto out;
> +
> + if (flags & K3_RINGACC_RING_USE_PROXY) {
> + proxy_id = find_next_zero_bit(ringacc->proxy_inuse,
> + ringacc->num_proxies, 0);
> + if (proxy_id == ringacc->num_proxies)
> + goto error;
> + }
> +
> + if (!try_module_get(ringacc->dev->driver->owner))
> + goto error;
should this not be one of the first things to do?
> +
> + if (proxy_id != K3_RINGACC_PROXY_NOT_USED) {
> + set_bit(proxy_id, ringacc->proxy_inuse);
> + ringacc->rings[id].proxy_id = proxy_id;
> + dev_dbg(ringacc->dev, "Giving ring#%d proxy#%d\n", id,
> + proxy_id);
> + } else {
> + dev_dbg(ringacc->dev, "Giving ring#%d\n", id);
> + }
how bout removing else and doing common print?
--
~Vinod
Powered by blists - more mailing lists