Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2513954rwr; Fri, 21 Apr 2023 09:51:46 -0700 (PDT) X-Google-Smtp-Source: AKy350Y1pykQ1wI0PZ1CUq68KCpoEgCz4peUfj3A21VkNzHQ6rSLX7x8d5y1yn1GU8lEriFGd8ro X-Received: by 2002:a17:90a:1d3:b0:245:eb4c:3df8 with SMTP id 19-20020a17090a01d300b00245eb4c3df8mr5295785pjd.2.1682095905833; Fri, 21 Apr 2023 09:51:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682095905; cv=none; d=google.com; s=arc-20160816; b=VghvtUgXqFGt0o2rw7clMFnMnZRdYs4bvwIOGmK9mui1JfHJhDAU+agq1AGC3VxXQE dWwk8EtY/DiJutEqOi5IwudLr2LesoF8Q1vh1S1beiwYFx5hlRVzuvxE2ElMPKvivhV9 1x3zHn60XYSKascB5zShE89z0StDhobtqfbfGDBWBSwVR1bGVbMEfYVNSpWRUmC58cb3 1rVuTJmnTfH4wkl+TOqld3J+gjzhQZepqN/l/ZA8deufYmfz6hZ9W4J0SRV+kOUs8tFr k6uRCb34eF1o+x6sNmAwpvkR87dacQi1bpEJGdcHBbEeRdjs3ry8SJCwIcJKPR8g95ZJ xWZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sbqUma2ZLI3KKcCdIaep9AcRZ0rbFEkxBwd7VQhDn1w=; b=sXuTRsO3ROXWhtAWDTsWHdd1WmbsKpO1zFeeuYJzxUk1z+bcTb5+n1wfHD+lEMHPuL SXswXaz02Aaow6jxvnyzd/zM8lVnk5XuTh3F3oEFnBzORruL+7xMEn8uZEIRwT/jNUQb YijcFP8HdAP0Gq4X9XesDXn1PKaUo59ne7XjV4AubWXBLc9I39GpfBBx3Z31Xar3fv2K WftKR+aSSxH6d4U+nitIQOJHvBBW2oPaOSEC7ENh5iyE97g91tluUCa7iUBVaXAqW/tP TAVvvjW1Is5L3ObAvBPIgVjP/jLGiM2vU4gwYF2UUwnfoR8Ijtc9elPg1x6m599tg3mw Hd3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=AEqDR2es; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w17-20020a17090a8a1100b0023f2e6a146bsi7470522pjn.41.2023.04.21.09.51.31; Fri, 21 Apr 2023 09:51:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=AEqDR2es; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233213AbjDUQsr (ORCPT + 99 others); Fri, 21 Apr 2023 12:48:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233209AbjDUQso (ORCPT ); Fri, 21 Apr 2023 12:48:44 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3364DCC0C; Fri, 21 Apr 2023 09:48:43 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2a8b1b51dbdso17396311fa.0; Fri, 21 Apr 2023 09:48:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682095721; x=1684687721; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=sbqUma2ZLI3KKcCdIaep9AcRZ0rbFEkxBwd7VQhDn1w=; b=AEqDR2esTJbMF4Qk2M4GfO9MiPIPtu+WCDwVh0L7o5f3s3KD9Hxsnc5fmvp0xjUpWU gjBrC+vBKT+5d+xTgN9qfaU3E1neRIVYXye4I8BtGArjFyojlOBftA1WCvh2dZ38N/kf Mkh4gDbnhQahJOHtpUaRtoYMpcswmIUe78U1+LkxcIdbc+pOa+dqgXUo5+5unyZrmM86 hPs7MrIg7+lJqfA1Lc2n7fZMOHNcrdDMiqNCTXzWJCXWWQiQJ/CLErjkck6abXOnVpdk kL9qDvxkvLfNJ9wy/xiHfv8VjiwzuEX8BCK05LaIZuOAatXEpzbc5D7Cwfc6aO8yTlza 5bFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682095721; x=1684687721; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=sbqUma2ZLI3KKcCdIaep9AcRZ0rbFEkxBwd7VQhDn1w=; b=fHy+X+c2fjL9sp3SKoxLga9Y8xacfOjuibSafxdzSsCrpmBLt96PvwysCb8Bn0Qka+ /HXP2jJXNKQstZ9MqALxI9VFynxDWspP0egL4mI/qjWf5pz2EF8mXFyfEabMyruYFN29 3iCeWr8J+qE6iJd9dzB73mglkVvh8cRFNjMm8rZTuPQjf5+G9oVjQGF0RqpU9Sw8/88M 0SuaxzOTgrBReaOHDUST+FxfA4bCgrWrwbDbulB30lYageJZfttFywnY4j7oztnCGU1n 04LyZCxcIpIZ2Dtd+pGxi8x3375OAyxuXwezhlwCRXAmoTVBqjTLDgvnlrpGOZufJYoQ jm4w== X-Gm-Message-State: AAQBX9dnVzrM9lXVVi6iuTYZB7MWbgiS1NuVqNGGmzue3OzUFVLsJh6C 6pC9GPo2BiA9bIKxBqvnw1Q= X-Received: by 2002:a05:651c:1058:b0:2a8:adf6:b0e2 with SMTP id x24-20020a05651c105800b002a8adf6b0e2mr760571ljm.13.1682095721298; Fri, 21 Apr 2023 09:48:41 -0700 (PDT) Received: from mobilestation ([95.79.140.35]) by smtp.gmail.com with ESMTPSA id s26-20020a2e9c1a000000b002a76dd438ddsm656599lji.79.2023.04.21.09.48.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 09:48:40 -0700 (PDT) Date: Fri, 21 Apr 2023 19:48:38 +0300 From: Serge Semin To: David Laight Cc: 'Joy Chakraborty' , Mark Brown , Andy Shevchenko , "linux-spi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "manugautam@google.com" , "rohitner@google.com" Subject: Re: [PATCH v8 5/5] spi: dw: Round of n_bytes to power of 2 Message-ID: <20230421164838.52euobr5ohfyxxti@mobilestation> References: <20230420055131.2048959-1-joychakr@google.com> <20230420055131.2048959-6-joychakr@google.com> <20230421085354.34dwrgr3enlxqhtc@mobilestation> <969a083998224016947f5e77218f4587@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <969a083998224016947f5e77218f4587@AcuMS.aculab.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 21, 2023 at 04:39:30PM +0000, David Laight wrote: > From: Joy Chakraborty > > Sent: 21 April 2023 10:22 > ... > > Sure, I can make the following change in the formatting and send the > > patch series: > > dws->n_bytes = > > roundup_pow_of_two(DIV_ROUND_UP(transfer->bits_per_word, > > BITS_PER_BYTE)); > > Won't checkpatch bleat about that? Why would it? > > Is it ever actually valid for the caller to provide a > value that isn't 8, 16 or 32 ? Judging by this https://elixir.bootlin.com/linux/v6.3-rc7/source/drivers/spi/spi.c#L3630 it is. SPI-controller also supports word lengths within the pre-synthesized range. So it's up to the SPI-peripherals and their protocols what word length to select. -Serge(y) > > I'm sure it looked as though some other lengths/counts > where likely to go badly wrong. > > I know there are times when it is useful to bit-bang 'odd' > numbers of bits - like command+address+delay for fast reads > but that is a sub-32bit transfer so (at least somewhere) > is 1 word but not all the bits. > > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales)