From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6A87C04EB8 for ; Mon, 10 Dec 2018 10:36:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B73C82082F for ; Mon, 10 Dec 2018 10:36:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B73C82082F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727174AbeLJKgW (ORCPT ); Mon, 10 Dec 2018 05:36:22 -0500 Received: from mail.bootlin.com ([62.4.15.54]:54888 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726146AbeLJKgW (ORCPT ); Mon, 10 Dec 2018 05:36:22 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 7E8C920D92; Mon, 10 Dec 2018 11:36:19 +0100 (CET) Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 3166C20D23; Mon, 10 Dec 2018 11:36:09 +0100 (CET) Date: Mon, 10 Dec 2018 11:36:09 +0100 From: Boris Brezillon To: Schrempf Frieder Cc: Yogesh Narayan Gaur , "linux-mtd@lists.infradead.org" , "marek.vasut@gmail.com" , "broonie@kernel.org" , "linux-spi@vger.kernel.org" , "devicetree@vger.kernel.org" , "robh@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "computersforpeace@gmail.com" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v5 1/5] spi: spi-mem: Add driver for NXP FlexSPI controller Message-ID: <20181210113609.59355f12@bbrezillon> In-Reply-To: References: <1542366701-16065-1-git-send-email-yogeshnarayan.gaur@nxp.com> <1542366701-16065-2-git-send-email-yogeshnarayan.gaur@nxp.com> <20181210111909.35384eee@bbrezillon> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 10 Dec 2018 10:31:57 +0000 Schrempf Frieder wrote: > >> Yes, I need to validate op->addr.nbytes else LUT would going to be programmed for 0 addrlen. > >> I have checked this on the target. > > > > Also agree there. Some operations have 0 address bytes. We could also > > test addr.buswidth, but I'm fine with the addr.nbytes test too. > > The "if (op->addr.nbytes)" is needed of course, but I think the default > case in the switch statement (and for other reasons the whole switch > statement) is not needed and rather a check for op->addr.nbytes > 4 > should be added to nxp_fspi_supports_op(). I wrongly assumed this check > already exists in nxp_fspi_supports_op(). Ok, then this check on the max number of address bytes should indeed be moved to the supports_op() implementation. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Subject: Re: [PATCH v5 1/5] spi: spi-mem: Add driver for NXP FlexSPI controller Date: Mon, 10 Dec 2018 11:36:09 +0100 Message-ID: <20181210113609.59355f12@bbrezillon> References: <1542366701-16065-1-git-send-email-yogeshnarayan.gaur@nxp.com> <1542366701-16065-2-git-send-email-yogeshnarayan.gaur@nxp.com> <20181210111909.35384eee@bbrezillon> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Schrempf Frieder Cc: Yogesh Narayan Gaur , "linux-mtd@lists.infradead.org" , "marek.vasut@gmail.com" , "broonie@kernel.org" , "linux-spi@vger.kernel.org" , "devicetree@vger.kernel.org" , "robh@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "computersforpeace@gmail.com" , "linux-kernel@vger.kernel.org" List-Id: devicetree@vger.kernel.org On Mon, 10 Dec 2018 10:31:57 +0000 Schrempf Frieder wrote: > >> Yes, I need to validate op->addr.nbytes else LUT would going to be programmed for 0 addrlen. > >> I have checked this on the target. > > > > Also agree there. Some operations have 0 address bytes. We could also > > test addr.buswidth, but I'm fine with the addr.nbytes test too. > > The "if (op->addr.nbytes)" is needed of course, but I think the default > case in the switch statement (and for other reasons the whole switch > statement) is not needed and rather a check for op->addr.nbytes > 4 > should be added to nxp_fspi_supports_op(). I wrongly assumed this check > already exists in nxp_fspi_supports_op(). Ok, then this check on the max number of address bytes should indeed be moved to the supports_op() implementation. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FD80C04EB8 for ; Mon, 10 Dec 2018 10:36:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6AFC72082F for ; Mon, 10 Dec 2018 10:36:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EW2R1+wX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6AFC72082F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Qd3acKq53qoN4YcJVq35eYH5AXw35vH6TOAACVPJr3E=; b=EW2R1+wXxVT3WK IJCrZQ5z0k6XQE7U07ddUA1LvTmnDdBDnU3PwAz09yyM4YILRNGh4GAHppr8RZmDhhahTn/w1ynzt a4z9ZpHEc0Z9eBYxMAH41BzI+wcLhN0U/HE3TFU2Jylwaj8A1CnG3fXu6WMg/d+wUReDeKXhP2peT WPo/QYxL6mHXTbU0DBo4ume8mJdNbSP0HsUPzx+4ILHuFcsJn/H1qngsCNux3Yms7TUoXwwga0if5 S7bFgAVrmrcsJijGBj95H3yPR9mGQ2+CkX2hvvA7rdJGPxowCmH1yq14jtnHbb9m9MkGGK6xhmB13 842G4Nt4yzuN1o3vYVEQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWIvU-000315-IV; Mon, 10 Dec 2018 10:36:36 +0000 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWIvO-0002yg-SJ; Mon, 10 Dec 2018 10:36:34 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 7E8C920D92; Mon, 10 Dec 2018 11:36:19 +0100 (CET) Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 3166C20D23; Mon, 10 Dec 2018 11:36:09 +0100 (CET) Date: Mon, 10 Dec 2018 11:36:09 +0100 From: Boris Brezillon To: Schrempf Frieder Subject: Re: [PATCH v5 1/5] spi: spi-mem: Add driver for NXP FlexSPI controller Message-ID: <20181210113609.59355f12@bbrezillon> In-Reply-To: References: <1542366701-16065-1-git-send-email-yogeshnarayan.gaur@nxp.com> <1542366701-16065-2-git-send-email-yogeshnarayan.gaur@nxp.com> <20181210111909.35384eee@bbrezillon> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181210_023631_223194_C9A7CDE6 X-CRM114-Status: GOOD ( 11.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "mark.rutland@arm.com" , "devicetree@vger.kernel.org" , Yogesh Narayan Gaur , "robh@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-spi@vger.kernel.org" , "marek.vasut@gmail.com" , "broonie@kernel.org" , "linux-mtd@lists.infradead.org" , "computersforpeace@gmail.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 10 Dec 2018 10:31:57 +0000 Schrempf Frieder wrote: > >> Yes, I need to validate op->addr.nbytes else LUT would going to be programmed for 0 addrlen. > >> I have checked this on the target. > > > > Also agree there. Some operations have 0 address bytes. We could also > > test addr.buswidth, but I'm fine with the addr.nbytes test too. > > The "if (op->addr.nbytes)" is needed of course, but I think the default > case in the switch statement (and for other reasons the whole switch > statement) is not needed and rather a check for op->addr.nbytes > 4 > should be added to nxp_fspi_supports_op(). I wrongly assumed this check > already exists in nxp_fspi_supports_op(). Ok, then this check on the max number of address bytes should indeed be moved to the supports_op() implementation. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel