From patchwork Mon Feb 12 05:15:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 127924 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp2878781ljc; Sun, 11 Feb 2018 21:17:03 -0800 (PST) X-Google-Smtp-Source: AH8x224/j0071+sQ16F1trF3yZODRxt44zzAiXipzbS6tdgDWAPKhH4KdwtquUMAo1Qyf/Y+e2mT X-Received: by 10.101.67.135 with SMTP id m7mr8198270pgp.301.1518412623394; Sun, 11 Feb 2018 21:17:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518412623; cv=none; d=google.com; s=arc-20160816; b=KBAMbA2fH9hr5ifx6KtNQmpF2NNEkppFJuUc+CSpaOsKAJUn2GIE6mrxsp6JEfU5Mf aZDw5ZdejPvbaWc0XlOOQRomQxuNg4tIA7pgX3JCVysCjAJbfJLPWiZzUVMZ7Yq21FxG yWw8aBIde1r4mPD4gSwUcxsro+URtu947q/aowBeGFHGrzOyponF0bReNvMAM9K0d5HF LJRWFBY/HFfJAzqLXFS9k2HWjpBvqSwLYicVU5adERLbcYFkzCx7zFNdDrnyWIrU1Kyw dutnifqX4H487AqKM9x0FvjR8F9PKHuBhz7nk9MPHGN3lXwO09d3eN/27rnktC45GQKr NrQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=MYdGqp103d8nmWsHSrPHO5NXaQAoNcJ/DoFsNasl6Lk=; b=N6G52GwurqGLp4qEErjeW3d2VNPThnKmZkkDxNeRyQ06vg7SyobcQdPgvmOMAoDlxF oC+21glcrRlXL2mOBqzD3d4O9nHk/g+cRAq+6B+yRjc1EDcY+5XpaMqGPPqAs+POpOHt Rd3psYZhvBb3DYETVmaoaK/JBmCsDH+xiBIH6zpofnU85WnTfhu1ZfUZvhlUSXmwuOGb WsA8hqEcYO1GNJfmAs9krks0py6aeaz6lQ2to66sAg27f5LUqVXM46Rboiz+jmL29vdg Wmv9meSseBesJDvBaPzCRjz/lscFT4tT5SyptcMB7DcVrpULgb+ipVi3L9hP5kCKjRNl P1/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=se5a8H40; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 q75si5779712pfq.220.2018.02.11.21.17.03; Sun, 11 Feb 2018 21:17:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=se5a8H40; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932479AbeBLFQ4 (ORCPT + 6 others); Mon, 12 Feb 2018 00:16:56 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:42825 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753827AbeBLFQs (ORCPT ); Mon, 12 Feb 2018 00:16:48 -0500 Received: by mail-pl0-f67.google.com with SMTP id 11so4533921plc.9; Sun, 11 Feb 2018 21:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=fVb/4ZYwd0aQQdz/78YYDB4VKsqTJlQtipgZ6TsbkJY=; b=se5a8H40r+EnWx+tu7XgTJfYXqn6E3KIj+ctJd279rQQivoGJ+Kpcl2+J++EZG9/WZ dFT4Cb2MfR6BfI7lVR9ItVe1nisfWuobjC6J4Rb5+yhOiFV5QcSW6X9t3fhnfJi6a1bD ZK/YMXq2EPEiAQSy9AROqk122Ffsk3ztXDbVGP0liyDoOAZGltTiTEPTQh48heaI8cdn J7uABwxbKr3ZqtZhlASrwVaO/ryo3c7BhpHvVDid3Kigdoxl4Hity/pKVROaD7p1K2tP BO8PLZd9mZ+J953s2wVduMecAEnZyQT5JbUwFrb594Gvqp85QEyeP/3WppwtRor1j8ma //XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=fVb/4ZYwd0aQQdz/78YYDB4VKsqTJlQtipgZ6TsbkJY=; b=EYOmDRPkF4sSFnqzQ+KZyzBbgJRMe21tacjwftE8OEDpYqxC8RYXZx/q1ic+ELvwlA bxMMTZDGFH2VzSivpl64XUPvnkJhN+rRr7qMz3Wv/ve6yMCS1qBI2IhbRJTbxlYCESBi IskG/IJRiteOC65YQpQDm2qyTC+zj7C60RpI9xwGWQytdabTzY3UZ0xCKeSAK3bx9EFc m9Sz+8qtFaENe9hEiru2N9IP6hcxX5355WyRnxOIRUVIv4VsNrkhEIHVoYB9pXiBIHv9 TDm5zvFKu5JdHHIY48LGStY4286RW8/aRqAc+g9dSt4NmNiQ4RZdKyqevC4Ig8kBQnz+ 7tbQ== X-Gm-Message-State: APf1xPDOoKoj/WENZzJXX0j7AvmozCNIhslHQdMlYMvrHxbQ8+7T5xJ8 2SCcAYskYdUkSwwuSZAZO+o= X-Received: by 2002:a17:902:b608:: with SMTP id b8-v6mr9751194pls.404.1518412607800; Sun, 11 Feb 2018 21:16:47 -0800 (PST) Received: from aurora.jms.id.au ([203.0.153.9]) by smtp.gmail.com with ESMTPSA id w71sm8817939pfd.184.2018.02.11.21.16.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 11 Feb 2018 21:16:47 -0800 (PST) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Mon, 12 Feb 2018 15:46:40 +1030 From: Joel Stanley To: Greg Kroah-Hartman , Rob Herring , Mark Rutland Cc: Eddie James , Jeremy Kerr , Christopher Bostic , Brad Bishop , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 04/10] fsi: Fix one and two byte bus reads/writes Date: Mon, 12 Feb 2018 15:45:43 +1030 Message-Id: <20180212051549.8575-5-joel@jms.id.au> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180212051549.8575-1-joel@jms.id.au> References: <20180212051549.8575-1-joel@jms.id.au> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Eddie James Address checker fixed to allow one and two byte reads/writes. Address alignments for each size verified. Signed-off-by: Edward James Signed-off-by: Christopher Bostic Acked-by: Jeremy Kerr Signed-off-by: Joel Stanley --- drivers/fsi/fsi-core.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) -- 2.15.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 6e5aa9b26665..e5dfece248a5 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -656,10 +656,13 @@ static int fsi_slave_init(struct fsi_master *master, int link, uint8_t id) /* FSI master support */ static int fsi_check_access(uint32_t addr, size_t size) { - if (size != 1 && size != 2 && size != 4) - return -EINVAL; - - if ((addr & 0x3) != (size & 0x3)) + if (size == 4) { + if (addr & 0x3) + return -EINVAL; + } else if (size == 2) { + if (addr & 0x1) + return -EINVAL; + } else if (size != 1) return -EINVAL; return 0;