Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2422361rdh; Sun, 29 Oct 2023 15:56:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAchu7x0uKMFluOkpVSu+6scZj7AwjZxQmxqulufOxtLhR6t56UCGE+138e4YDBnhU91XQ X-Received: by 2002:a05:6358:6f8d:b0:134:eb97:ea01 with SMTP id s13-20020a0563586f8d00b00134eb97ea01mr13310335rwn.27.1698620185927; Sun, 29 Oct 2023 15:56:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698620185; cv=none; d=google.com; s=arc-20160816; b=0B8AJjhXtdOjrwFbsbEBgv8qbSHAgaUKHd6ggRZBokKQcWtiApo+m/N6yR/vRzn7C5 GWqxc1oMu2fJ2tsdrEv5YUGTnvzeH7cY1iKbqgCO8/sT/x3fJvsdL41/3y9F4Kel+jzW SUUuZo9lDM3Ol+44cQJQHLejmzi0PNtXovtsXQeK7BGTJjzDMJaLuBUzhBVo+7Z3ycCJ Q5DmjolStiAORPaikcx8CZFfBiVvvNwlITLaDORAzhkcEO2s17Q2FAwW6/8NiTcrvcZ3 s/rp0KCw/Kt9HE+QpfYAe7AGa/kRUqAH17K7iRBcDY7vD9o++aYJF4/EaSgmHdm/cybx 8RBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bpB+u7R1VuEVmlUm05tplpK62MwYUZrpLwDgKxGPZK4=; fh=YRfVAWCmyKdJtcNRR+a4GVB18M9tqsTfGqZLUEUv8uE=; b=rwdFz4rgfCmTx6iJVLkKfxna+unRgFN7pu05Z5Dl6v7w9O+PtFnAlXXyYuqdtss96y FFh+2hh8+CPoU2r0eZSuuJeLb0f4yUnBupIhmMUM2n61UHX1mCVt7r5PNb9rqeVjjE4X a7u/Mq4CD2pNouyhHxFdBniKnCskVPlb324XdaPWsmzhuRHNzy0HL7R5NDulA5lpMrKy YhHSOjli8HuFKyJyPQIFmiXhT2seolBg9IxlhqRwVa7A+qtdCM7/GnSxqrv4Ch3Y7rG+ 6fzQ8Vdd3XgSYyXWb59q6+MVtUYxxjIWc/z42V7ZZGUJABm1S6PGkkmarUOLCbUiUXPB waxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZEoKsDQe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id l13-20020a170902f68d00b001b9e9edea43si4207147plg.552.2023.10.29.15.56.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 15:56:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZEoKsDQe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 5F6A88087E3B; Sun, 29 Oct 2023 15:56:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231194AbjJ2Wzy (ORCPT + 99 others); Sun, 29 Oct 2023 18:55:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231202AbjJ2WzU (ORCPT ); Sun, 29 Oct 2023 18:55:20 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58B57D3; Sun, 29 Oct 2023 15:55:07 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF3F2C433CC; Sun, 29 Oct 2023 22:55:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698620106; bh=z+73B1DIL61o1DugN4c5cLyJNVGWOV+lpmfTf8JmyFI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZEoKsDQeHl+fniX6Lyw4iJe3GUH+iMWEYMHZHWDpiVQPLhPM3YfULc3SLzNvXolvH ZOiEnnMVULrRwJPibImUsKV0ApPyPU5xWyFS18tiqR1rXl6VpKAbtG4JNzxB2rDiqP +oROlUWkNYdXNP2tUbK9bNvhmZzwtTkAAOmt7unyE8YDdn/BWIyWRmg1jx4sihegFi jR0eVAs1XZoT0VGFENXh05/VRmefdO6okMi9WeAaq14i/quzRTy+MO8DH8tyvnbxYF eDTR7xoJ+ir1KVbJwhpVNxFTb50gpkGt0K3IDkB5nqs18vUw4x9iFzjxekOzjijC+7 K7qUSPkTU2a+Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "William A. Kennington III" , Mark Brown , Sasha Levin , avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, openbmc@lists.ozlabs.org, linux-spi@vger.kernel.org Subject: [PATCH AUTOSEL 6.5 16/52] spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0 Date: Sun, 29 Oct 2023 18:53:03 -0400 Message-ID: <20231029225441.789781-16-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231029225441.789781-1-sashal@kernel.org> References: <20231029225441.789781-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.5.9 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 29 Oct 2023 15:56:17 -0700 (PDT) From: "William A. Kennington III" [ Upstream commit 2ec8b010979036c2fe79a64adb6ecc0bd11e91d1 ] We don't want to use the value of ilog2(0) as dummy.buswidth is 0 when dummy.nbytes is 0. Since we have no dummy bytes, we don't need to configure the dummy byte bits per clock register value anyway. Signed-off-by: "William A. Kennington III" Link: https://lore.kernel.org/r/20230922182812.2728066-1-william@wkennington.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-npcm-fiu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-npcm-fiu.c b/drivers/spi/spi-npcm-fiu.c index eb353561509a8..01a2b9de18b7f 100644 --- a/drivers/spi/spi-npcm-fiu.c +++ b/drivers/spi/spi-npcm-fiu.c @@ -353,8 +353,9 @@ static int npcm_fiu_uma_read(struct spi_mem *mem, uma_cfg |= ilog2(op->cmd.buswidth); uma_cfg |= ilog2(op->addr.buswidth) << NPCM_FIU_UMA_CFG_ADBPCK_SHIFT; - uma_cfg |= ilog2(op->dummy.buswidth) - << NPCM_FIU_UMA_CFG_DBPCK_SHIFT; + if (op->dummy.nbytes) + uma_cfg |= ilog2(op->dummy.buswidth) + << NPCM_FIU_UMA_CFG_DBPCK_SHIFT; uma_cfg |= ilog2(op->data.buswidth) << NPCM_FIU_UMA_CFG_RDBPCK_SHIFT; uma_cfg |= op->dummy.nbytes << NPCM_FIU_UMA_CFG_DBSIZ_SHIFT; -- 2.42.0