Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7804268rwl; Fri, 30 Dec 2022 15:15:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXvk28vjEIFKOTsuF5rQKrSfjFRhiCO/b6bbAgzRMDThYUl+1/j4NrmLycMwBNSce1Y1/092 X-Received: by 2002:a05:6a20:1bc2:b0:ad:e765:9554 with SMTP id cv2-20020a056a201bc200b000ade7659554mr35285014pzb.55.1672442133488; Fri, 30 Dec 2022 15:15:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672442133; cv=none; d=google.com; s=arc-20160816; b=tz+HPmK6E36de76fKsVHEAyvFc6+b2+qOtC3zB0NjTQQmrKhw9rGhmXwdXAzro+5Fi BvD0/cPNKV6UEwTnIcrPNJ2uvcy4fX1a9ee4LTeA1PYG6Yxza38b25twX/UYcFwiuy58 hwXIsnhJQORvqYRCIyVqzwp2Y5zqs7Ae3sQaG+GShaJKy0TAlOoLXTmSGdnTI/fK+bbG RuWd76m1GUFsF/BdsMQr1Om58KPm2JdSfuhZuXmiOeDVdyHcOnjmShA+VFsPKJAnvEli oTbsNgqHe95cUjlA437A67JoA0tRXrgYLlwp5TWB6QNJ4Pk+U71OdROgd0Q0R4GGXwxm niNw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=VopeNteg8qTfq7SnHIn61T/3OkDE4RtaebULuCvY+/I=; b=DCdHMg1FTqu7D5h8UvSLFLgIDdcyQKw+vpw1GWFJAFmBbFMdYWhqN28kcUBETzeBV1 5/UbuwmiyDRbKMhFrmPcO4LSVY18YksXxy1mij/5B5jFg4I227ryhZN+ClJ8rxMxYXJO /2RLIbHVVzmGjWrFftmJcXSZH+lrPzctJB1aCBzSZIc74z2uhaY7/s2et6lpYou2OAbo K7qpLrX4Mdy4Gto+aYiz0gFmNVlDQyKz6OVHIoHAX+S88x/ToRicCXpje5bZToXla9tq uzQqLThC3dw8vUky+eK999STuuvmxRsqlsLMKDw3dhx2zpSC0g4vhf9MLRy4zb683W9e expA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PriBcqBU; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q31-20020a17090a752200b0021306464b66si22273215pjk.28.2022.12.30.15.15.24; Fri, 30 Dec 2022 15:15:33 -0800 (PST) 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=@linaro.org header.s=google header.b=PriBcqBU; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235599AbiL3WdM (ORCPT + 62 others); Fri, 30 Dec 2022 17:33:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbiL3WdL (ORCPT ); Fri, 30 Dec 2022 17:33:11 -0500 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50A021C90C for ; Fri, 30 Dec 2022 14:33:09 -0800 (PST) Received: by mail-io1-xd36.google.com with SMTP id i83so11745191ioa.11 for ; Fri, 30 Dec 2022 14:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VopeNteg8qTfq7SnHIn61T/3OkDE4RtaebULuCvY+/I=; b=PriBcqBUPdb+qVozoBjNUwxgXonhwruGyDKU3JkS9eAI5UkdJ8Fc0mWlxMhg3pCT5b fRFHhGikYFTealH91qzl3EeX2n+QgLmFNIP7ykLLma+AWephk3mmGktXHAVyEoRQWCyj XsD7TvbIRx/mUAVEIALc/1U8BsuQos0gPfqsa2s/+6G5qmPAjO6nffVhAGNqeMCi9r3f 9bhJ2TqLmFZo3LML57XI97HeBdtuCQz+Cm3WJQtfK+w/y20rB4cPFbioA7d6n7orvdlu 5PECM5sUmZU1FnaX53WTbwWvm5TiWSmZGM1l5mIPWwdUX2NW/YceCUCX/FzyFlxF5Rru bO9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VopeNteg8qTfq7SnHIn61T/3OkDE4RtaebULuCvY+/I=; b=wJU0eFXlkFPJofXcxNDKwXBHRftH8DH5lCF6Gzowd9mHyFiFcDVA8j+Mq+6TeEbFi4 Lb2cqNq+uaMVeoQ5oVfF1cQ5EjEKlv2jFXaGUlWolC3lBdvj8Jd/a2Y4SnzIZnYAwbRq a9eC1Ct2EblfQwCzOc2k6KkZDQ51VZnFoO5voQnX7qkOSyJ2u1corORme5XgXaHbpGDB MkDEhaI6UTMC0mogzkxnt7Eg2o7gngW/1OtgYgdZU9sbHxUvRcPwQO4nNPSEaFL1LZRR dpeIvknFSJmMxtH7nF+IoYy5uS7B0peD56WfQ9mjO2EO/ad73k45w4D6ZSjR1ubO4QFf qwzA== X-Gm-Message-State: AFqh2koaaI63sA8d6yRKlc2yiZUJf3RfL31B0x99xLkbSPIHir75AozH 2uZuwLrx4VcLBO1zxc3WOGV20kMVJf77X0VS X-Received: by 2002:a6b:8f82:0:b0:6eb:da60:be0b with SMTP id r124-20020a6b8f82000000b006ebda60be0bmr22779039iod.4.1672439588657; Fri, 30 Dec 2022 14:33:08 -0800 (PST) Received: from presto.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id k130-20020a6bba88000000b006e0577610e2sm8269658iof.45.2022.12.30.14.33.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Dec 2022 14:33:08 -0800 (PST) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: caleb.connolly@linaro.org, mka@chromium.org, evgreen@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net] net: ipa: use proper endpoint mask for suspend Date: Fri, 30 Dec 2022 16:33:04 -0600 Message-Id: <20221230223304.2137471-1-elder@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 It is now possible for a system to have more than 32 endpoints. As a result, registers related to endpoint suspend are parameterized, with 32 endpoints represented in one more registers. In ipa_interrupt_suspend_control(), the IPA_SUSPEND_EN register offset is determined properly, but the bit mask used still assumes the number of enpoints won't exceed 32. This is a bug. Fix it. Fixes: f298ba785e2d ("net: ipa: add a parameter to suspend registers") Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_interrupt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index a49f66efacb87..d458a35839cce 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -132,10 +132,10 @@ static void ipa_interrupt_suspend_control(struct ipa_interrupt *interrupt, u32 endpoint_id, bool enable) { struct ipa *ipa = interrupt->ipa; + u32 mask = BIT(endpoint_id % 32); u32 unit = endpoint_id / 32; const struct ipa_reg *reg; u32 offset; - u32 mask; u32 val; WARN_ON(!test_bit(endpoint_id, ipa->available)); @@ -148,7 +148,6 @@ static void ipa_interrupt_suspend_control(struct ipa_interrupt *interrupt, offset = ipa_reg_n_offset(reg, unit); val = ioread32(ipa->reg_virt + offset); - mask = BIT(endpoint_id); if (enable) val |= mask; else -- 2.34.1