From patchwork Wed Sep 13 03:17:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Yeong X-Patchwork-Id: 138574 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp826127vqx; Tue, 12 Sep 2023 20:20:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHSFCOEejINYtsKxDvCOC0okdc4lRxUCIyFXi5g14fDBuZuxyo9r4eXOh/p6FnboIOjsXw4 X-Received: by 2002:a9d:4d92:0:b0:6b9:c5b5:6a96 with SMTP id u18-20020a9d4d92000000b006b9c5b56a96mr1574424otk.6.1694575204998; Tue, 12 Sep 2023 20:20:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694575204; cv=none; d=google.com; s=arc-20160816; b=0GXUdf+WfpcwBjNi+0EbLXYEDyKOJywPdS6jiJv6vzMqNTMMTqLvAQP7bxDVLzPZGg J7bvIH+yXE3ExZxt0Dt7QaCKYeO3lUS3kNisSAXIrMl5THqsoSIgdjUkzpfMqqYkIiwc ue9MxtbpM94mht8HlntHNjadiqaKhWu+rQge0toHxxJbBa+gT9EwwgK2XdCm55abqsQU i6Op/1ty/R/sAPbdl9fYOdA1iztppP9MClQw2R5eK5KOi6dA7bdxpnqk1cQVNCwNd+Wx HsBt0Qm9UCc/+F4vm4BfwUT8sNr/Jyx3zeGyQ+K8uLEXAq6yLmK4CLmFfzyjaSjlpYAV zMsQ== 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; bh=Np5g+nPC/OgAdpJjL1AdzmbieZypqO30zEAuyJiyklQ=; fh=BsCAHsNtWIbD8zqEmrC4mP0yqH2A/0t3ZboNjYt++fE=; b=yzyBdCZXnH8NDbT5/uxm2nk5pqTT0DC0/h/7TtC0y92MO3viliA17I3fCRbZPrbl2k a9bYT5exU9V0e92w6LH9eHYRB4jHtEYzCqxtHXd6LRmG64IeIRDMDauTr1YuYIxybyjP cQb+oAxQxtsZMGZbmGLSUuTP/ojs7qxmeUwTc5G993410kFKJ2ko0b/ibZ+Q2pw6JQtN ZkDMaCVJcGrg6p76CeU80+iQJ7ELP3Tq70G2NQPml01VQJVFgdMygwQokFc01TFfsj2P JtpY16twiRFHO6gZb9zMrcR7qgYAn9t/ZsRLMz5GMfcDP9hUjGjZo9VSTKRRJ9pB7cjd IfQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id o12-20020a63fb0c000000b00564f4a7f70asi9210614pgh.412.2023.09.12.20.20.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:20:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id D299381ED4B9; Tue, 12 Sep 2023 20:19:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237203AbjIMDTB convert rfc822-to-8bit (ORCPT + 36 others); Tue, 12 Sep 2023 23:19:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234151AbjIMDS7 (ORCPT ); Tue, 12 Sep 2023 23:18:59 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B25761724; Tue, 12 Sep 2023 20:18:54 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 0EF318159; Wed, 13 Sep 2023 11:18:53 +0800 (CST) Received: from EXMBX066.cuchost.com (172.16.7.66) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 13 Sep 2023 11:18:52 +0800 Received: from localhost.localdomain (202.188.176.82) by EXMBX066.cuchost.com (172.16.6.66) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 13 Sep 2023 11:18:50 +0800 From: Joshua Yeong To: , CC: , , , , Joshua Yeong Subject: [PATCH v2 1/1] i3c: master: cdns: Fix reading status register Date: Wed, 13 Sep 2023 11:17:45 +0800 Message-ID: <20230913031743.11439-2-joshua.yeong@starfivetech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230913031743.11439-1-joshua.yeong@starfivetech.com> References: <20230913031743.11439-1-joshua.yeong@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [202.188.176.82] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX066.cuchost.com (172.16.6.66) X-YovoleRuleAgent: yovoleflag 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 (fry.vger.email [0.0.0.0]); Tue, 12 Sep 2023 20:19:06 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 fry.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776890890304658271 X-GMAIL-MSGID: 1776890890304658271 IBIR_DEPTH and CMDR_DEPTH should read from status0 instead of status1. Cc: stable@vger.kernel.org Fixes: 603f2bee2c54 ("i3c: master: Add driver for Cadence IP") Signed-off-by: Joshua Yeong Reviewed-by: Miquel Raynal --- drivers/i3c/master/i3c-master-cdns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/drivers/i3c/master/i3c-master-cdns.c b/drivers/i3c/master/i3c-master-cdns.c index 49551db71bc9..8f1fda3c7ac5 100644 --- a/drivers/i3c/master/i3c-master-cdns.c +++ b/drivers/i3c/master/i3c-master-cdns.c @@ -191,7 +191,7 @@ #define SLV_STATUS1_HJ_DIS BIT(18) #define SLV_STATUS1_MR_DIS BIT(17) #define SLV_STATUS1_PROT_ERR BIT(16) -#define SLV_STATUS1_DA(x) (((s) & GENMASK(15, 9)) >> 9) +#define SLV_STATUS1_DA(s) (((s) & GENMASK(15, 9)) >> 9) #define SLV_STATUS1_HAS_DA BIT(8) #define SLV_STATUS1_DDR_RX_FULL BIT(7) #define SLV_STATUS1_DDR_TX_FULL BIT(6) @@ -1623,13 +1623,13 @@ static int cdns_i3c_master_probe(struct platform_device *pdev) /* Device ID0 is reserved to describe this master. */ master->maxdevs = CONF_STATUS0_DEVS_NUM(val); master->free_rr_slots = GENMASK(master->maxdevs, 1); + master->caps.ibirfifodepth = CONF_STATUS0_IBIR_DEPTH(val); + master->caps.cmdrfifodepth = CONF_STATUS0_CMDR_DEPTH(val); val = readl(master->regs + CONF_STATUS1); master->caps.cmdfifodepth = CONF_STATUS1_CMD_DEPTH(val); master->caps.rxfifodepth = CONF_STATUS1_RX_DEPTH(val); master->caps.txfifodepth = CONF_STATUS1_TX_DEPTH(val); - master->caps.ibirfifodepth = CONF_STATUS0_IBIR_DEPTH(val); - master->caps.cmdrfifodepth = CONF_STATUS0_CMDR_DEPTH(val); spin_lock_init(&master->ibi.lock); master->ibi.num_slots = CONF_STATUS1_IBI_HW_RES(val);