Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5530870imm; Mon, 23 Jul 2018 01:04:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfQyFPB60XpJPIV8HT6o8eiNbRtYEp8ZVvOde+d99+osNtc0BBFnT0s2x4UN1RnpDwbCpdp X-Received: by 2002:a62:5d55:: with SMTP id r82-v6mr12250078pfb.150.1532333073719; Mon, 23 Jul 2018 01:04:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532333073; cv=none; d=google.com; s=arc-20160816; b=nEI3A0yPFpTCh+jrtIMP4MW0NCA7qC+CB5teBc5DeLj1pHBIlApClrhWNK3pMOj+6A igkbX5cxNuHhQd1O2gvGMcNO5QiGfpHXxcbCnSbOtm1i41nOFhwDlcdQZLA8qT6MSwqP 39s9jTe70xmharLp4hFYYZ6/pTEO8HA+FKCppfiXPJUY67OyouOlcsxPpjCdpiMKbaSb Db/Y+91hs0yK2Fbho570xQu6HoLqF8TqGAH7FSMHr05WL8JUDaDsfDy2mQ/DgaZl21sX iIIeOdsAb6B9Q6NK2K4syQfGn6+4/4d/CM4dPtw62BXYDyabwh//REe4EIOCnaL+Kypl 0sjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=mzJjFI186k84Lo8BIDM2LMg7/d1IornPK1v3y2dJ5D8=; b=O5dyvCgyUfav1aMF8aGWtxkKYEm9b/d4xUznfTlSB6ZyUDO3iwxl3o3wHN5hQo3J+l SrqOlpMrloOWIlvP2+S9RzD7KDwaDS3nMpRm3urF191xMjVcm6FJqoEnB/80x2czk2+q k2wpo/HGsdpJb3SIx6LgqIEWJbIUQqYyusH96PKdjsUjE8ZVwvivbnmoxFo9Gq5xdFjm BA3lOpR3/UA0jqmHcKmpxk/ZekSKcb4M0ez6tS3zSrJVvK/yd+i9NlEdHHAtpSZ3fmRR ajticdLnKGyaUGybiQcXUkSjDYSmcTL8ccNo01Kea6BqgbZ0PEvQ0vJCKs7DtOTM8VXy /s0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=YT++G0EE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e132-v6si8292130pfg.171.2018.07.23.01.04.19; Mon, 23 Jul 2018 01:04:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=YT++G0EE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388021AbeGWJDU (ORCPT + 99 others); Mon, 23 Jul 2018 05:03:20 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:52328 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387908AbeGWJDU (ORCPT ); Mon, 23 Jul 2018 05:03:20 -0400 Received: by mail-it0-f65.google.com with SMTP id p4-v6so162239itf.2 for ; Mon, 23 Jul 2018 01:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=mzJjFI186k84Lo8BIDM2LMg7/d1IornPK1v3y2dJ5D8=; b=YT++G0EEATNJ8KhBdsAr7m8gShXO0ZyPOta0MmokgNZGAJHcn5hUVA+X38z09QztRk zlcy0zcOARMNJ5RkNfL6it6BwL7Q6HnXW5jAOlO1YQrXGsxp7exh5NnhT1z9j3MB53xh d6hfZLTdwqWihCqXVa0WTxWycDLdETgCqv1ovca9qTrM2lTYIcE8l89azZE4Srho0TO2 2Zr3ONRV5zsoJaPXKijitGd/GV687z/GlysH1cq5ihmIrmkHCE72KdfRZOOyxMxohF17 kEhPNXIEqw2/TZI6fbjPer0zigilEh1lEYrSyCKOaHDJOqq6BJfp4VtkryS0XkBBhwzS EZfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=mzJjFI186k84Lo8BIDM2LMg7/d1IornPK1v3y2dJ5D8=; b=hVuK9LDo4tCsepHUC220qCwQ7EFDdqW9NAhE7sewOFAVnxwbXVWW98QsykNdQmSbH1 1U9h+PdJBz0tAtbHcLDs3VvjoYDP/jJKV43ouMFGGLZ6w8ENRidkrLMC46v67gdHutka G0BKnZa1kYdEpuK7fjXUm1DpwT/Omua6KTwa6xd+ry57B7per7hV5i+1Ku/78uZwstM7 cZ0jN9Tp11PVEmmu6GPMbrqG7KVgOera6Jg7ac5x490dDrKCN5Z1uMdiK04RSq6BDNFJ ZuhUMwXfHo2pcZdpIs69EUXIFoCwFwM6pc+rmR6qrZfi7ct8Okjruehhl25jRFoZE0OM Dh+A== X-Gm-Message-State: AOUpUlGNHWA9RAxoR1fkCnx1bSKnAV6O9OOHwHcDsba7lWxWZ4tagWIV DpYe8RZsZT9Qm8BgfZetuL5STG6bnugffjzxUGYytWbt X-Received: by 2002:a24:e48c:: with SMTP id o134-v6mr9595482ith.125.1532333001446; Mon, 23 Jul 2018 01:03:21 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5e:9402:0:0:0:0:0 with HTTP; Mon, 23 Jul 2018 01:03:20 -0700 (PDT) In-Reply-To: <20180621073706.22812-2-brgl@bgdev.pl> References: <20180621073706.22812-1-brgl@bgdev.pl> <20180621073706.22812-2-brgl@bgdev.pl> From: Bartosz Golaszewski Date: Mon, 23 Jul 2018 10:03:20 +0200 Message-ID: Subject: Re: [PATCH v7 1/4] remoteproc/davinci: use the reset framework To: Sekhar Nori , Kevin Hilman , Rob Herring , Mark Rutland , Russell King , David Lechner , Michael Turquette , Stephen Boyd , Ohad Ben-Cohen , Bjorn Andersson Cc: Linux ARM , devicetree , Linux Kernel Mailing List , linux-clk , linux-remoteproc@vger.kernel.org, Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-06-21 9:37 GMT+02:00 Bartosz Golaszewski : > From: Bartosz Golaszewski > > Switch to using the reset framework instead of handcoded reset routines > we used so far. > > Signed-off-by: Bartosz Golaszewski > Reviewed-by: Sekhar Nori > Reviewed-by: Philipp Zabel > --- > drivers/remoteproc/da8xx_remoteproc.c | 34 +++++++++++++++++++++++---- > 1 file changed, 29 insertions(+), 5 deletions(-) > > diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c > index b668e32996e2..76c06b70a1c6 100644 > --- a/drivers/remoteproc/da8xx_remoteproc.c > +++ b/drivers/remoteproc/da8xx_remoteproc.c > @@ -10,6 +10,7 @@ > > #include > #include > +#include > #include > #include > #include > @@ -20,8 +21,6 @@ > #include > #include > > -#include /* for davinci_clk_reset_assert/deassert() */ > - > #include "remoteproc_internal.h" > > static char *da8xx_fw_name; > @@ -72,6 +71,7 @@ struct da8xx_rproc { > struct da8xx_rproc_mem *mem; > int num_mems; > struct clk *dsp_clk; > + struct reset_control *dsp_reset; > void (*ack_fxn)(struct irq_data *data); > struct irq_data *irq_data; > void __iomem *chipsig; > @@ -138,6 +138,7 @@ static int da8xx_rproc_start(struct rproc *rproc) > struct device *dev = rproc->dev.parent; > struct da8xx_rproc *drproc = (struct da8xx_rproc *)rproc->priv; > struct clk *dsp_clk = drproc->dsp_clk; > + struct reset_control *dsp_reset = drproc->dsp_reset; > int ret; > > /* hw requires the start (boot) address be on 1KB boundary */ > @@ -155,7 +156,12 @@ static int da8xx_rproc_start(struct rproc *rproc) > return ret; > } > > - davinci_clk_reset_deassert(dsp_clk); > + ret = reset_control_deassert(dsp_reset); > + if (ret) { > + dev_err(dev, "reset_control_deassert() failed: %d\n", ret); > + clk_disable_unprepare(dsp_clk); > + return ret; > + } > > return 0; > } > @@ -163,8 +169,15 @@ static int da8xx_rproc_start(struct rproc *rproc) > static int da8xx_rproc_stop(struct rproc *rproc) > { > struct da8xx_rproc *drproc = rproc->priv; > + struct device *dev = rproc->dev.parent; > + int ret; > + > + ret = reset_control_assert(drproc->dsp_reset); > + if (ret) { > + dev_err(dev, "reset_control_assert() failed: %d\n", ret); > + return ret; > + } > > - davinci_clk_reset_assert(drproc->dsp_clk); > clk_disable_unprepare(drproc->dsp_clk); > > return 0; > @@ -232,6 +245,7 @@ static int da8xx_rproc_probe(struct platform_device *pdev) > struct resource *bootreg_res; > struct resource *chipsig_res; > struct clk *dsp_clk; > + struct reset_control *dsp_reset; > void __iomem *chipsig; > void __iomem *bootreg; > int irq; > @@ -268,6 +282,15 @@ static int da8xx_rproc_probe(struct platform_device *pdev) > return PTR_ERR(dsp_clk); > } > > + dsp_reset = devm_reset_control_get_exclusive(dev, NULL); > + if (IS_ERR(dsp_reset)) { > + if (PTR_ERR(dsp_reset) != -EPROBE_DEFER) > + dev_err(dev, "unable to get reset control: %ld\n", > + PTR_ERR(dsp_reset)); > + > + return PTR_ERR(dsp_reset); > + } > + > if (dev->of_node) { > ret = of_reserved_mem_device_init(dev); > if (ret) { > @@ -287,6 +310,7 @@ static int da8xx_rproc_probe(struct platform_device *pdev) > drproc = rproc->priv; > drproc->rproc = rproc; > drproc->dsp_clk = dsp_clk; > + drproc->dsp_reset = dsp_reset; > rproc->has_iommu = false; > > ret = da8xx_rproc_get_internal_memories(pdev, drproc); > @@ -309,7 +333,7 @@ static int da8xx_rproc_probe(struct platform_device *pdev) > * *not* in reset, but da8xx_rproc_start() needs the DSP to be > * held in reset at the time it is called. > */ > - ret = davinci_clk_reset_assert(drproc->dsp_clk); > + ret = reset_control_assert(dsp_reset); > if (ret) > goto free_rproc; > > -- > 2.17.1 > Hi Bjorn, Sekhar, I'm not seeing this patch in next, did you agree on how to pick it up for 4.19? Thanks in advance, Bartosz