Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3295164imm; Tue, 29 May 2018 04:54:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpgJ6Q0QRoUoLqv/zmlGHrUhPVes5b6w08Dzd0nCPGmz27EBTS/JhO+VE0lxDM5ycxdWtFF X-Received: by 2002:a17:902:8647:: with SMTP id y7-v6mr17064480plt.86.1527594857391; Tue, 29 May 2018 04:54:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527594857; cv=none; d=google.com; s=arc-20160816; b=YNAw3jeBwcsmd6tSIjXwbY74/5LVOJAGf+SgyWm2hps0TPag3dhe+WY6wfPDTGjcZq hHaGGAyTAjz48jteWyQ51FV8hnOmpn3dcHZGqaREmaqBrV1npBlrQCIrnHcHQVV4pZJO ljrzyrn5mFzNV2IbWGP1y+9Zno5sipMoaHFkO3DQRtDeBFRxteI5Okmk5rfR5nHp3Yjh iIFCQ7ZqwIcpdP0BYYloLDqLiE3Jy7r9uSNUj3ZubvJWsbuq0f2jxFuf48h2+WV5L3/1 qz/YnQnguwex1xuomF1m2AOSvh4XK4P4fHW/ikonSvaoufgkr8+Iq26gJ6rJWLwogGGO Ipxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=7aKGUOeXKB07hc+XCjTCxq35PCGss/Oi3f0SyaDGTsQ=; b=zF+1ZvQBCE2ZblXbV+qbSMvdclLEHai6P36oZlOuaKCrNbZsflKaLYQ1b2BoKx6RtY vRsyNFxu3nwOuLDuZxwiUmVZHGk6PQukgdKS9A0S2IRIKH9Yk3CmiaVTG1isqNcJs8TW w0dxDxpvNXcrh4UNko/hptzVWHzu/JfQR9EvzVm/b9mfrqQo5LnmEsqeMLsNOJaA7RcP K0Rkdv3RGkUrNSasOvPvxyS5EVf8/ukrXS+pkVZfTnPn73TnfmhZttLYVlTeupX3/nXI uGzYko6e7okvs+ut6rubGwucf7KL0MCjVA513gMdOArgD0oy5/CcbPSNEeiyG0eU89LN TH/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AKbbkp2Z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v37-v6si32235599plg.426.2018.05.29.04.54.03; Tue, 29 May 2018 04:54:17 -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=@linaro.org header.s=google header.b=AKbbkp2Z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933475AbeE2LwE (ORCPT + 99 others); Tue, 29 May 2018 07:52:04 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:39609 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933315AbeE2Lv7 (ORCPT ); Tue, 29 May 2018 07:51:59 -0400 Received: by mail-it0-f68.google.com with SMTP id c3-v6so18116654itj.4 for ; Tue, 29 May 2018 04:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=7aKGUOeXKB07hc+XCjTCxq35PCGss/Oi3f0SyaDGTsQ=; b=AKbbkp2ZHK2mDh0142mkLquCV8FkaDz/7uO7eJo1koJW7kawg8pg9HRe8U940mFT2K Q+MJYaD2hp4djYxdAaNQ4/LvuDp0oZJqlmmTbCsoGrCemw52z5+mOU2koViGETuYBlYI hknEnZopa5p+d53yaWl+h96YY69icDvLzd0zc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7aKGUOeXKB07hc+XCjTCxq35PCGss/Oi3f0SyaDGTsQ=; b=LTVnBpuwHOxGqu/gQMp7KhQ25B0Zwl/B2sg7iUMx8WzgiZeaBlLo7vbwoGLRgPbBBN pEYgFjjTnPnLH3xiYewU7+BKtNR0UPF2dKX0/c9ihsFG7TgKfPWZ+bU4ARdmi23cXBQS ROtcLt5g0qdTdLyHIP4AqjfIj+2w126PQ2Nxz6VOivWGwxb8V+ZWIzMiIRZ/aogGTTG5 lirt/5ejw3lxT4Er93hPSyRPL4yOPH+YSVNLcoIfq8sKcTFNyMFkpLv3KVoHEKDH5yPT 1uHOFLPnUGOJd7Wn6ZgoAPHvN+d7ANE+Vrn51wDXY9oHwi18ipzQR0BMtLmpLUehED3L zwJg== X-Gm-Message-State: ALKqPwctKXII8VWC8i/xt9TrSUYgwKRBX0FG6oKRFvQiFsEAC3Euy/Lf C1t2K2wIy3AzSStkEjCCFTggTSkCWlE= X-Received: by 2002:a24:cfc4:: with SMTP id y187-v6mr14831370itf.26.1527594718961; Tue, 29 May 2018 04:51:58 -0700 (PDT) Received: from [172.22.22.26] (c-71-195-29-92.hsd1.mn.comcast.net. [71.195.29.92]) by smtp.googlemail.com with ESMTPSA id q22-v6sm11639531iob.65.2018.05.29.04.51.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 May 2018 04:51:58 -0700 (PDT) Subject: Re: [PATCH 5/5] remoteproc: Introduce prepare and unprepare for subdevices To: Arnaud Pouliquen , ohad@wizery.com, bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180515205345.8090-1-elder@linaro.org> <20180515205345.8090-6-elder@linaro.org> <3580eff5-56ef-c2a0-c8eb-c27850598587@st.com> From: Alex Elder Message-ID: Date: Tue, 29 May 2018 06:51:57 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <3580eff5-56ef-c2a0-c8eb-c27850598587@st.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/29/2018 04:16 AM, Arnaud Pouliquen wrote: . . . >> +unroll_preparation: >> + list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node) { >> + if (subdev->unprepare) >> + subdev->unprepare(subdev); >> + } > Here you could call rproc_unprepare_subdevices instead of duplicating > the code. I thought the same thing, but it won't work because we only want to unprepare those devices that were successfully prepared. Here we are unwinding the work that was partially done; in rproc_unprepare_subdevices() *all* subdevices have their unprepare function called. -Alex