Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4633C54EAA for ; Fri, 27 Jan 2023 02:18:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233190AbjA0CSL (ORCPT ); Thu, 26 Jan 2023 21:18:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231720AbjA0CSE (ORCPT ); Thu, 26 Jan 2023 21:18:04 -0500 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBD4B37577 for ; Thu, 26 Jan 2023 18:18:01 -0800 (PST) Received: by mail-pl1-x62b.google.com with SMTP id 5so3653082plo.3 for ; Thu, 26 Jan 2023 18:18:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:from:to:cc:subject:date:message-id:reply-to; bh=lMVAZlW0IYTlsO+hearMStOBvXO+3eEDK56o4sM6Xsc=; b=gs7kq1T2SwEnqkawHRKqRL72rrTza9PXtB4nUHO6zDd+gmcPYj+GTGBqSSvCFDO5hh yrYr8yLw1jACZpBm4sqYGzSrEJlmnJYV+waUtLvLreZriR7VR1AJ8Xt85GW3CdboyXyS bYNxmiX5NluomONHFja4NA5VO1Oixd0xaP77c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lMVAZlW0IYTlsO+hearMStOBvXO+3eEDK56o4sM6Xsc=; b=5ogPJHXa7aPQtvY5PFZ8YHPPo4B/U6kor2NvqdWTKEv+wUbkfu4sqC6rsU5bzPeelY 2k6sFVCJi5ETkFj43iC/byG+16rZvYI/gt+YMMNIcTtzJgrRT6+VQo9kAKkiiYSEMFYE FDtGHoLUbENNUEJCarMA2FwZPOrwBAzgo9sEwnY2VYPKteRbueQNp7wAKCEBMkwvIxSh FJgHSCpcxMIKBWYgtBVwA1n1DQZayOunEtJQrF1FKzdg/0qoJWYC8FgLIRZh2u4BpeLi 6QCJtRSpbgS5crd9ZezTTMgsldoCRWaayZjBTTyLat1J0pwVuQmJSngwPUyGFXr33eYQ HvNw== X-Gm-Message-State: AFqh2kqZhL7Yd2bS06fUQk0L1Sl00RWCqa6k1RDsbDuRt3lQpiXgvitK MIC1CqB/6FjrFocZqdB945wlOpp45l575eCxyFmamAce1jeBEtPZKYl7EEZR6Q5palYynlFr1l6 z0g5hv1ajYBDBU9QNPqMWMZZPTi28aB3a8EzR6n1d9eiS/u1Cue1CauQi06u0OA/gMB7ydBUgTZ SsefRdXrcchOw= X-Google-Smtp-Source: AMrXdXseNqAgP9wCNRzhf2QziSFajnJYJ+k9DdTvEhhfSPPyez1pwdhk8QQorkFeNd/PCThepPLPOA== X-Received: by 2002:a17:902:b48f:b0:189:b4d0:aee with SMTP id y15-20020a170902b48f00b00189b4d00aeemr34267897plr.67.1674785880869; Thu, 26 Jan 2023 18:18:00 -0800 (PST) Received: from bcacpedev-irv-3.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id n12-20020a1709026a8c00b0019603cb63d4sm1599027plk.280.2023.01.26.18.17.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jan 2023 18:18:00 -0800 (PST) Subject: Re: [PATCH v2 13/14] spi: bcmbca-hsspi: Add driver for newer HSSPI controller To: Jonas Gorski Cc: Linux SPI List , Broadcom Kernel List , tomer.yacoby@broadcom.com, kursad.oney@broadcom.com, dregan@mail.com, f.fainelli@gmail.com, anand.gore@broadcom.com, dan.beygelman@broadcom.com, joel.peshkin@broadcom.com, kernel test robot , Mark Brown , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230124221218.341511-1-william.zhang@broadcom.com> <20230124221218.341511-14-william.zhang@broadcom.com> From: William Zhang Message-ID: <2f4c0e38-af4a-8b01-8327-b6d6b666780c@broadcom.com> Date: Thu, 26 Jan 2023 18:17:58 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="0000000000008813fd05f3357953" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0000000000008813fd05f3357953 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 01/26/2023 07:16 AM, Jonas Gorski wrote: >> +static void bcmbca_hsspi_set_cs(struct bcmbca_hsspi *bs, unsigned int cs, >> + bool active) >> +{ >> + u32 reg; >> + >> + /* No cs orerriden needed for SS7 internal cs on pcm based voice dev */ >> + if (cs == 7) >> + return; >> + >> + mutex_lock(&bs->bus_mutex); >> + >> + if (active) { >> + /* activate cs by setting the override bit and active value bit*/ >> + reg = __raw_readl(bs->spim_ctrl); >> + reg |= BIT(cs+SPIM_CTRL_CS_OVERRIDE_SEL_SHIFT); > > Doesn't checkpatch complain about missing spaces around the operator (+)? > Nope... >> + reg &= ~BIT(cs+SPIM_CTRL_CS_OVERRIDE_VAL_SHIFT); >> + if (bs->cs_polarity & BIT(cs)) >> + reg |= BIT(cs+SPIM_CTRL_CS_OVERRIDE_VAL_SHIFT); > > Does the CS_OVERRIDE_VAL get reset on clearing the OVERRIDE_SEL bit or > it is persistent? If the latter, you could initialize its value in > bcmbca_hsspi_setup() and then this becomes: > > reg = _raw_readl(bs->spim_ctrl); > if (active) > reg |= BIT(cs+SPIM_CTRL_CS_OVERRIDE_SEL_SHIFT); > else > reg &= ~BIT(cs + SPIM_CTRL_CS_OVERRIDE_SEL_SHIFT); > __raw_writel(reg, bs->spim_ctrl); > > and you can drop the cs_polarity field. > > No. So I will try this optimization and see if that actually works in the controller. >> + __raw_writel(reg, bs->spim_ctrl); >> + } else { >> + /* clear the cs override bit */ >> + reg = __raw_readl(bs->spim_ctrl); >> + reg &= ~BIT(cs+SPIM_CTRL_CS_OVERRIDE_SEL_SHIFT); >> + __raw_writel(reg, bs->spim_ctrl); >> + } >> + >> + mutex_unlock(&bs->bus_mutex); >> +} >> + --0000000000008813fd05f3357953 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQcAYJKoZIhvcNAQcCoIIQYTCCEF0CAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg3HMIIFDTCCA/WgAwIBAgIQeEqpED+lv77edQixNJMdADANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0yMDA5MTYwMDAwMDBaFw0yODA5MTYwMDAwMDBaMFsxCzAJBgNVBAYT AkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTEwLwYDVQQDEyhHbG9iYWxTaWduIEdDQyBS MyBQZXJzb25hbFNpZ24gMiBDQSAyMDIwMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA vbCmXCcsbZ/a0fRIQMBxp4gJnnyeneFYpEtNydrZZ+GeKSMdHiDgXD1UnRSIudKo+moQ6YlCOu4t rVWO/EiXfYnK7zeop26ry1RpKtogB7/O115zultAz64ydQYLe+a1e/czkALg3sgTc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