From nobody Fri Apr 3 02:23:02 2026 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 12E00C54EE9 for ; Sat, 17 Sep 2022 14:03:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229642AbiIQODc (ORCPT ); Sat, 17 Sep 2022 10:03:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbiIQOD3 (ORCPT ); Sat, 17 Sep 2022 10:03:29 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0F022BB00 for ; Sat, 17 Sep 2022 07:03:28 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28HDswAC031443; Sat, 17 Sep 2022 09:03:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=lKY8j0vzKxC7NFBZD8JvtgkQHrhbXHdKGnrRODBlXW4=; b=d+i7lvHIPmIFmVDH8w8AjoEDw7g87Bjwo02CXaz4sFeNQ9Woe4dsTxpBWe4Wmo8bWqf6 JZLbNe1t1lwp5z+8rY4e0ApXoK6xkulnwLVXoRrYsUBN1ebRZZ2rePPWBnuIa0/tlsjg hMKCf9X7vDsLVF6V6gbaFBUWxtYyyexT55gmN55tLpt7uHlsW/uZZc43aujpzfZrCNG9 Ho5EoQM/oAitMvOvpuFczpdGyQrRLFHdkpv8K1dMJ2nvQCVUFBNXufHpc2QCu99wT3nl lTGSUCTSxcFbQznBmA6UM0FEj4QkBDmi4TK8HzrkRmS07X2ob8TwPLVQZFkQ2zCyRypd Yw== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3jnanmg86h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 17 Sep 2022 09:03:07 -0500 Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.12; Sat, 17 Sep 2022 09:03:05 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.12 via Frontend Transport; Sat, 17 Sep 2022 09:03:05 -0500 Received: from debianA11184.ad.cirrus.com (unknown [198.61.65.112]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id D3B112BA; Sat, 17 Sep 2022 14:02:58 +0000 (UTC) From: Richard Fitzgerald To: , , , CC: , , , Richard Fitzgerald Subject: [PATCH] soundwire: bus: Fix wrong port number in sdw_handle_slave_alerts() Date: Sat, 17 Sep 2022 15:02:56 +0100 Message-ID: <20220917140256.689678-1-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: _oA7DauQ6_eVTiTbkbYThvi38yUvu3GH X-Proofpoint-ORIG-GUID: _oA7DauQ6_eVTiTbkbYThvi38yUvu3GH X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" for_each_set_bit() gives the bit-number counting from 0 (LSbit=3D=3D0). When processing INTSTAT2, bit 0 is DP4 so the port number is (bit + 4). Likewise for INTSTAT3 bit 0 is DP11 so port number is (bit + 11). Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart --- drivers/soundwire/bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index 8eded1a55227..df0ae869ee51 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -1622,7 +1622,7 @@ static int sdw_handle_slave_alerts(struct sdw_slave *= slave) port =3D buf2[0] & SDW_SCP_INTSTAT2_PORT4_10; for_each_set_bit(bit, &port, 8) { /* scp2 ports start from 4 */ - port_num =3D bit + 3; + port_num =3D bit + 4; sdw_handle_port_interrupt(slave, port_num, &port_status[port_num]); @@ -1634,7 +1634,7 @@ static int sdw_handle_slave_alerts(struct sdw_slave *= slave) port =3D buf2[1] & SDW_SCP_INTSTAT3_PORT11_14; for_each_set_bit(bit, &port, 8) { /* scp3 ports start from 11 */ - port_num =3D bit + 10; + port_num =3D bit + 11; sdw_handle_port_interrupt(slave, port_num, &port_status[port_num]); --=20 2.30.2