Received: by 10.223.164.202 with SMTP id h10csp1021847wrb; Tue, 7 Nov 2017 20:00:40 -0800 (PST) X-Google-Smtp-Source: ABhQp+QdoygJxivGkEFasYCbd4j/owRjnKWsWG00y+H4DxcNdtRndhhjDuEe+347hBM/HQ8iscTN X-Received: by 10.84.229.143 with SMTP id c15mr911391plk.389.1510113639937; Tue, 07 Nov 2017 20:00:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510113639; cv=none; d=google.com; s=arc-20160816; b=D/rYvmIl/gzWmegT2fYQNttYUlRPaWkbLjXxlbmxfBhR6wde6kMVFpNKYV9CHOOk7m ojxGDtIUVDmjI1ybq0Sgb19t1+UbL+0ih8NwuV05AWHo7mEvdGV7E7fi6HuAE1G7xPzy F0Mkx4eeI85d1xQcBeRv9vwluHmBRlHEK/q1UL5IntVVbjIY1cpdGx+V4rXIrpZV4uHk 1ZzbU+1HREB8w0zrd0wK5ePLfZhkg0ReH8gRu9zld9N7bcdSVSMljj6EaCE+r/elw7pZ MuWngAc3M90tJr7l23fnPuUUWC1EmlJQN2e5pzay6Z13Ctc0ycQHMe6+sz6pJqL9U/jP 8u5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=fZofDsE+ASOYhLocmEpFowkroZduPMzigKG/mnbwqY4=; b=J+yjII8gJ8BKj7mh55hY9p9J44D5gjlcU5ijwntd1BYz8Q5j19p6MQhREbbJOorAcc RrK8xBt4brBCXfBVczb9nyPmRkwIEhrKd+chU0kiSesilYiaBjkN0NCiNV9U9Mno8qLi zfQHDe5dl6cRmU9H+j68F1iE49etT9zi4eXDDWvLBIXseOS1KvetaiJ8/pxS5+66iS/e re0K8rVTPCiXb0i+Q+RwB3WwCFzp6E1V9DzFLfUv3VzS6Z5V3aZSZTmo0XbFNESOZ63I ZYSesdza+zSk0ZrQRqFW8AwBFEbvu+Ww/u1pq+y0UDbIBC7V1vGCt0hYzj0AoZ8G8WVf yI1A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a25si2742191pff.55.2017.11.07.20.00.27; Tue, 07 Nov 2017 20:00:39 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754040AbdKHC1j (ORCPT + 90 others); Tue, 7 Nov 2017 21:27:39 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:35242 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752676AbdKHCYL (ORCPT ); Tue, 7 Nov 2017 21:24:11 -0500 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vA82NxZS053529 for ; Tue, 7 Nov 2017 21:24:11 -0500 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 2e3mq3b216-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 07 Nov 2017 21:24:11 -0500 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 7 Nov 2017 19:24:10 -0700 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 7 Nov 2017 19:24:07 -0700 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vA82O7Vf2163042; Tue, 7 Nov 2017 19:24:07 -0700 Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 455C36A03B; Tue, 7 Nov 2017 19:24:07 -0700 (MST) Received: from suka-w540.usor.ibm.com (unknown [9.70.94.25]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP id D17046A03F; Tue, 7 Nov 2017 19:24:06 -0700 (MST) From: Sukadev Bhattiprolu To: Michael Ellerman Cc: Benjamin Herrenschmidt , mikey@neuling.org, hbabu@us.ibm.com, nicholas.piggin@gmail.com, linuxppc-dev@ozlabs.org, Subject: [PATCH v3 05/18] powerpc/vas: Use helper to unpin/close window Date: Tue, 7 Nov 2017 18:23:45 -0800 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510107838-15181-1-git-send-email-sukadev@linux.vnet.ibm.com> References: <1510107838-15181-1-git-send-email-sukadev@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17110802-0004-0000-0000-0000132DAC57 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008029; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000239; SDB=6.00942691; UDB=6.00475552; IPR=6.00722979; BA=6.00005677; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017903; XFM=3.00000015; UTC=2017-11-08 02:24:09 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17110802-0005-0000-0000-000084C849A2 Message-Id: <1510107838-15181-6-git-send-email-sukadev@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-07_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1711080027 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use a helper to have the hardware unpin and mark a window closed. Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/platforms/powernv/vas-window.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/platforms/powernv/vas-window.c b/arch/powerpc/platforms/powernv/vas-window.c index 8ab8a82..95622a9 100644 --- a/arch/powerpc/platforms/powernv/vas-window.c +++ b/arch/powerpc/platforms/powernv/vas-window.c @@ -1101,6 +1101,20 @@ static void poll_window_castout(struct vas_window *window) } /* + * Unpin and close a window so no new requests are accepted and the + * hardware can evict this window from cache if necessary. + */ +static void unpin_close_window(struct vas_window *window) +{ + u64 val; + + val = read_hvwc_reg(window, VREG(WINCTL)); + val = SET_FIELD(VAS_WINCTL_PIN, val, 0); + val = SET_FIELD(VAS_WINCTL_OPEN, val, 0); + write_hvwc_reg(window, VREG(WINCTL), val); +} + +/* * Close a window. * * See Section 1.12.1 of VAS workbook v1.05 for details on closing window: @@ -1114,8 +1128,6 @@ static void poll_window_castout(struct vas_window *window) */ int vas_win_close(struct vas_window *window) { - u64 val; - if (!window) return 0; @@ -1131,11 +1143,7 @@ int vas_win_close(struct vas_window *window) poll_window_busy_state(window); - /* Unpin window from cache and close it */ - val = read_hvwc_reg(window, VREG(WINCTL)); - val = SET_FIELD(VAS_WINCTL_PIN, val, 0); - val = SET_FIELD(VAS_WINCTL_OPEN, val, 0); - write_hvwc_reg(window, VREG(WINCTL), val); + unpin_close_window(window); poll_window_castout(window); -- 2.7.4 From 1583511381046363018@xxx Wed Nov 08 15:15:33 +0000 2017 X-GM-THRID: 1582421552117032341 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread