Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp118180ybg; Mon, 8 Jun 2020 18:06:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzidu3XJJQPgXEZtUDqxzJN4zLoSSCv/lRkydwzbjX09dYWBGxK2BwHfkFIjYpwc+inAw/l X-Received: by 2002:a17:906:9a02:: with SMTP id ai2mr22591256ejc.97.1591664809646; Mon, 08 Jun 2020 18:06:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664809; cv=none; d=google.com; s=arc-20160816; b=lysOu/BltRS72WyPUMDiEf5HEMrPXs+IzecExm4577PlHPxuD/e9VY4NEVYMPTdU/S dxCcFUwqxRX2MQC7LQy+rIdTrxJmMSWiqfck+dtXDKYtPaeaiGAY+RiwrVViRX8VH8C/ rvq38H4txTV5VzD75tYqHjOm+EEaauBV0In+Et/caq8gqR3Yf4Icw+XZly5XnTm5kBP/ t2zY/iB0axquupHUaS4R43hVAdWnib1uzAokBeM4ZFIjECv3+Hx4BksZw+6s5DXf1sj3 RcG3wSYPDMwZtpDTVfu6YtOH0+gDjSUHCoG4ojpPGvA6KyxE3i4xiudW2DpvyfRl0Goi 2DCw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BZ1lhabGs6yXNd4Eu+WRlEUSFkc5r8glz6Tjt9L+3f8=; b=H2rsvLh/MTsEjn+ybSQ+0qMvaUlhq2nV2VJ8K6qdVbJkDYkUV3HujPcFaNayPEpgvT GYljsclmZLzBXDgyBfu7c/m3ihEGmRsa6dfDIQKdHH4Hp5Zo53LshzCOkeKg/C+qtdlE rV15NKSErHtZ5iSEkdd+JhVpapikENBQeo24ECxNTC38wx0JRd1PfTObvVZl2egn/lgt MuLUiKS0lmauoTGLPsGB3QwO0S+u4e78FkfKcvWihGmkMGdRXAuPosvrAArZqfyp3IyM RQEd8wlUQG3aznEqvuT//RozydQSajGVK7CHquOYInYG1dreW/25vGjOxxsQ5u2K0ydQ rsCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Qw225oKv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm9si12491977ejc.624.2020.06.08.18.06.26; Mon, 08 Jun 2020 18:06:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Qw225oKv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727877AbgFHXHX (ORCPT + 99 others); Mon, 8 Jun 2020 19:07:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:50458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727105AbgFHXG4 (ORCPT ); Mon, 8 Jun 2020 19:06:56 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 40E6720842; Mon, 8 Jun 2020 23:06:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657616; bh=l4UrxZfPytW7PlaB2VeAq30RXCOzD1wa7DQI7P+EKhQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qw225oKv1tBngdkVT2YvDqZlHfZBpcNREI7ipI6UPfl9PXNVki0m6kAhUmTywou3O UQj5JgYkHpOzJ8VOPgcD07vEdRB2IZkQi2+qJL6Ib68fY2K5RNDdDvt/PZXbtzuE7w 90vxWZFDKQqb0CvzhsnwxVQ5NAmC7ykz8dZPDuHA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ioana Ciornei , Li Yang , "David S . Miller" , Sasha Levin , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.7 038/274] soc: fsl: dpio: properly compute the consumer index Date: Mon, 8 Jun 2020 19:02:11 -0400 Message-Id: <20200608230607.3361041-38-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ioana Ciornei [ Upstream commit 7596ac9d19a9df25707ecaac0675881f62dd8c18 ] Mask the consumer index before using it. Without this, we would be writing frame descriptors beyond the ring size supported by the QBMAN block. Fixes: 3b2abda7d28c ("soc: fsl: dpio: Replace QMAN array mode with ring mode enqueue") Signed-off-by: Ioana Ciornei Acked-by: Li Yang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/soc/fsl/dpio/qbman-portal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/fsl/dpio/qbman-portal.c b/drivers/soc/fsl/dpio/qbman-portal.c index 804b8ba9bf5c..23a1377971f4 100644 --- a/drivers/soc/fsl/dpio/qbman-portal.c +++ b/drivers/soc/fsl/dpio/qbman-portal.c @@ -669,6 +669,7 @@ int qbman_swp_enqueue_multiple_direct(struct qbman_swp *s, eqcr_ci = s->eqcr.ci; p = s->addr_cena + QBMAN_CENA_SWP_EQCR_CI; s->eqcr.ci = qbman_read_register(s, QBMAN_CINH_SWP_EQCR_CI); + s->eqcr.ci &= full_mask; s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size, eqcr_ci, s->eqcr.ci); -- 2.25.1