Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3823186ybt; Tue, 23 Jun 2020 11:34:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ0Y7KUksrO54hJl5ubtKdHk3Rnxiw4uteCEvlqCb3JISX8GgQ6jXHkDwaeG6h8F4tPn9J X-Received: by 2002:a17:906:5652:: with SMTP id v18mr20521736ejr.72.1592937258146; Tue, 23 Jun 2020 11:34:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592937258; cv=none; d=google.com; s=arc-20160816; b=wA45nhiEHGeeWsVQ7uX/eVpEIpIVZuJr4o+1jl4EnABGeBFV+ApaR5l/BJ7zAyKPgt Ts2XNCIaRItrrxdYOjITdurEKR8HyS0E/cd5JuaV3dKJe9jiPE3XI51mqAMsPSpP0Bfn Y1vi4IdHViTQc/yWeFCcwdI98kKLvfsP6u6z8ankUTfy4HRNwHnBIIGPuJe7/HB4e2Ln nCcUjIRdpA9ZDyVRG2eVije47+S7DDZ/Y64HX55BNmrLFPMCkfAAGX5r8KTjRabPoY2h HCyzj5qfxUL52VX4jMKV7lzAKBe6Ke+sp9f3kbXLrqNJCKJ+bDO7ycLypAKqm1ems/FB cTPg== 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=nXArtM6MFH13a5YEFYfd8/AUdTrmkkAxpoemUK7l0ys=; b=iP31JoYGVochu382moVa7AGqqGP/JG2QI1Oc+1nV1sOfFOAeceqSx/1kDSGFjJDaIw bpadAjRb43kgvIa/iySRi7FcNnZBqECshq5ZRPN10I2YWMpTlwRggTAy/pHV00OGwH0U qKHxX4v/2LUw5Hb6tarODoYNOnzbQkRou0/BsjpiouN26Y6FU+By4YH7Z+fqTdndy4pq J0OYUujz6Fw64oRBRQL6aao78iFAviYNQMbotW30m4iR08nEUYWKFHRD+SRq8SNAMgdM xkPQfW56kYlBxZF+pXMs6z6+SyKhoMtM72D2JopPOgI/oDBpP6DAm5JHRTSeu6+s+tk6 T9WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=E9kKIYtA; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q17si6223640edc.298.2020.06.23.11.33.54; Tue, 23 Jun 2020 11:34:18 -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=@ti.com header.s=ti-com-17Q1 header.b=E9kKIYtA; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387557AbgFWSbQ (ORCPT + 99 others); Tue, 23 Jun 2020 14:31:16 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:37174 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387435AbgFWSbM (ORCPT ); Tue, 23 Jun 2020 14:31:12 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05NIUvNV060322; Tue, 23 Jun 2020 13:30:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1592937057; bh=nXArtM6MFH13a5YEFYfd8/AUdTrmkkAxpoemUK7l0ys=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=E9kKIYtAbFTUR2xr9ut9ha4Qn5Tz01ev/Yfo3KenvN5dQdzEFFWO6vjqQrEbobbLR Lltw8kcWDVFEK/H4vq+REZQWUK8rEwD2CZxuT6hD02c+aRQO1KaN2AyJweXwHD3Bbg TYBH4FkWeSFIfes1CovtqwBVYKq/lm6Am6kFBskw= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 05NIUvI0038505 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 23 Jun 2020 13:30:57 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 23 Jun 2020 13:30:57 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Tue, 23 Jun 2020 13:30:57 -0500 Received: from pratyush-OptiPlex-790.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05NIUVJI000942; Tue, 23 Jun 2020 13:30:52 -0500 From: Pratyush Yadav To: Tudor Ambarus , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Mark Brown , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Matthias Brugger , Michal Simek , , , , , CC: Pratyush Yadav , Sekhar Nori , Boris Brezillon Subject: [PATCH v10 04/17] spi: spi-mtk-nor: reject DTR ops Date: Wed, 24 Jun 2020 00:00:17 +0530 Message-ID: <20200623183030.26591-5-p.yadav@ti.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200623183030.26591-1-p.yadav@ti.com> References: <20200623183030.26591-1-p.yadav@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Double Transfer Rate (DTR) ops are added in spi-mem. But this controller doesn't support DTR transactions. Since we don't use the default supports_op(), which rejects all DTR ops, do that explicitly in our supports_op(). Signed-off-by: Pratyush Yadav --- drivers/spi/spi-mtk-nor.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/spi/spi-mtk-nor.c b/drivers/spi/spi-mtk-nor.c index d5f393871619..b08d8e9a8ee9 100644 --- a/drivers/spi/spi-mtk-nor.c +++ b/drivers/spi/spi-mtk-nor.c @@ -211,6 +211,12 @@ static bool mtk_nor_supports_op(struct spi_mem *mem, if (op->cmd.buswidth != 1) return false; + /* DTR ops not supported. */ + if (op->cmd.dtr || op->addr.dtr || op->dummy.dtr || op->data.dtr) + return false; + if (op->cmd.nbytes != 1) + return false; + if ((op->addr.nbytes == 3) || (op->addr.nbytes == 4)) { if ((op->data.dir == SPI_MEM_DATA_IN) && mtk_nor_match_read(op)) return true; -- 2.27.0