Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6154220ybf; Thu, 5 Mar 2020 14:20:16 -0800 (PST) X-Google-Smtp-Source: ADFU+vtFCMwHWNOkf/KnuSI53cIo4sqjQlp3oH5gOFeDsJQ2PlcSKpanPctBsQNSMLYYV4/k5bY7 X-Received: by 2002:a9d:e83:: with SMTP id 3mr72586otj.93.1583446816338; Thu, 05 Mar 2020 14:20:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583446816; cv=none; d=google.com; s=arc-20160816; b=lzjpNNzPwUGd1Hvrb7Pu45/KctFu8yL+DAnDURPTLPAmRLP3dVk1luzwD9mdKTIVsQ 0496tYppdS/6ygm9j4NIhdG0bRLKFbpc/UB3yEiWPw0yeV2vkNxbxFRLm2pSSjO4cf+h AsbI0puqg6o0Znf+KM9wR/7nFqUnflIa1U3sqCTH19gNq+bjGH0McsL4ZoKi4XxsA/gZ +G6F5xB05lWzqcpPajnPQJQtxr+Iu1jpaghAhLmP/kSnknDF0rRw2dUs9IkxtOOZFJMV Wy+D2sTxw1zdKUKh1MZMGqt2g+JbiwZ/xHTYTHEm8xBEM0xQlys6TX6GSODITlJvBTpn dZhQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=KaysUP+3Av+N3rptK3NvGlj/ejFA3gDwE+RY9/HC1SE=; b=u7dIQtLjyey84P9Y4HRMVlqkqPChh/WlprzekZDrza1azCom9a5IdQc4dOEm18rpN9 iWwud9S4gCkz97UrcFfCpXn5rEUKnZ8xhRuw/WH4/ZIXGKyLuTFkc1f8J8bfBgpxTnin OYF7or+dKGtLHI6EkG5wx1gBawq89eDzc53QA3+OyWAI3mG44dxv5+szXnLRn6uTbuTX MkFM88KWySNvVQkvfKS8uEnRPNuXoZCr9aZlECeWC5mnFFfIlywXnFNTeQcbQ1n9KnR6 5wWrbM9N6seiZ9IEmbPXMWMdEX2l21/gVG0XXy4q4MDgeqUIXjVJjrjQxVGFiK016P8l 6LSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cO7lKma5; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l145si213125oih.44.2020.03.05.14.20.03; Thu, 05 Mar 2020 14:20:16 -0800 (PST) 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=@chromium.org header.s=google header.b=cO7lKma5; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726359AbgCEWSV (ORCPT + 99 others); Thu, 5 Mar 2020 17:18:21 -0500 Received: from mail-ua1-f66.google.com ([209.85.222.66]:41851 "EHLO mail-ua1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726191AbgCEWSV (ORCPT ); Thu, 5 Mar 2020 17:18:21 -0500 Received: by mail-ua1-f66.google.com with SMTP id d19so2702277uak.8 for ; Thu, 05 Mar 2020 14:18:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=KaysUP+3Av+N3rptK3NvGlj/ejFA3gDwE+RY9/HC1SE=; b=cO7lKma5P41BEzS5Zq4IgnFZZnd95U39OACyYzmddDkWoykXKe+Dc1zrW6TCjWts4a /MNL7estdbZEtjBHceq0tR2XThzeTxj0qJNzHFevlJ4Clj2em5EaYjSfsuSdCk1X+h5r 8bdYd942qRJya+3QBptQJQH7B8bFN5XRqf0x8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=KaysUP+3Av+N3rptK3NvGlj/ejFA3gDwE+RY9/HC1SE=; b=UWxhC4MGCxtH2J2Uw6Z8YHesmESwZT3ne5IpObvRsNUfkJooTFqykm59EYzsnJidmU C4pKsbwvyL0lusi0osIhHiG7TqyK3pENA7Kv3Ema3eGx17U8za43DDhnqdMpvEj4Goh3 piRFAt8CmaNhawmla9W4XzmsvjAxh+Rzw8eCYMd3DpzmbgYAK2YrtHWBzkwIfwgKndQC duank1KIF8nlxM7rOoSxLry/QQtt3wwRkgYWeWsEb1xMKVgWJnQLRZ0ntQBHeMRVg400 yGP1G79Y016IbsPS+TPuni+yFC8e+GRtdwMkt05/gOdWPHYcO0bj+mRZXJoMk7S6OkG8 uxxQ== X-Gm-Message-State: ANhLgQ3Yg89BqUG86xl9nwBJLvOLGZxw9pF9S9UZKiB/AyVs7dpxv6Qw 6h5TsXhEcuAqvztLBa4zqY7an2Wi2Fs= X-Received: by 2002:ab0:4144:: with SMTP id j62mr20094uad.13.1583446698278; Thu, 05 Mar 2020 14:18:18 -0800 (PST) Received: from mail-vk1-f176.google.com (mail-vk1-f176.google.com. [209.85.221.176]) by smtp.gmail.com with ESMTPSA id q85sm6023365vke.42.2020.03.05.14.18.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Mar 2020 14:18:17 -0800 (PST) Received: by mail-vk1-f176.google.com with SMTP id x62so59208vkg.11 for ; Thu, 05 Mar 2020 14:18:17 -0800 (PST) X-Received: by 2002:a1f:97c8:: with SMTP id z191mr983268vkd.0.1583446696985; Thu, 05 Mar 2020 14:18:16 -0800 (PST) MIME-Version: 1.0 References: <1582889903-12890-1-git-send-email-mkshah@codeaurora.org> <1582889903-12890-4-git-send-email-mkshah@codeaurora.org> <7704638e-b473-d0cf-73ab-2bdb67b636ba@codeaurora.org> In-Reply-To: From: Doug Anderson Date: Thu, 5 Mar 2020 14:18:05 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v9 3/3] soc: qcom: rpmh: Invoke rpmh_flush() for dirty caches To: Maulik Shah Cc: Stephen Boyd , Matthias Kaehlcke , Evan Green , Bjorn Andersson , LKML , linux-arm-msm , Andy Gross , Rajendra Nayak , Lina Iyer , lsrao@codeaurora.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Mar 5, 2020 at 1:41 AM Maulik Shah wrote: >> There are other cases like below which also gets impacted if driver > >> don't cache anything... > >> > >> for example, when we don=E2=80=99t have dedicated ACTIVE TCS ( if we h= ave below > >> config with ACTIVE TCS count 0) > >> qcom,tcs-config =3D , > >> , > >> , > >> > >> Now to send active data, driver may re-use/ re-purpose few of the slee= p > >> or wake TCS, to be used as ACTIVE TCS and once work is done, > >> it will be re-allocated in SLEEP/ WAKE TCS pool accordingly. If driver > >> don=E2=80=99t cache, all the SLEEP and WAKE data is lost when one > >> of TCS is repurposed to use as ACTIVE TCS. > > Ah, interesting. I'll read the code more, but are you expecting this > > type of situation to work today, or is it theoretical for the future? > yes, we have targets which needs to work with this type of situation. My brain is still slowly absorbing all the code, but something tells me that targets with no ACTIVE TCS will not work properly with non-OSI mode unless you change your patches more. Specifically to make the zero ACTIVE TCS case work I think you need a rpmh_flush() call after _ALL_ calls to rpmh_write() and rpmh_write_batch() (even those modifying ACTIVE state). rpmh_write_async() will be yet more interesting because you'd have to flush in rpmh_tx_done() I guess? ...and also somehow you need to inhibit entering sleep mode if an async write was in progress? Maybe easier to just detect the "non-OSI-mode + 0 ACTIVE TCS" case at probe time and fail to probe? -Doug