Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp26951pxb; Mon, 8 Feb 2021 14:08:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLucDO66at9IFAsH0kRaCkGZ2pIlsJcyHoJKTbaEZ+iEeomeUNuKQbVOn4VByT4F+0Sx/T X-Received: by 2002:a05:6402:270e:: with SMTP id y14mr19197075edd.322.1612822138029; Mon, 08 Feb 2021 14:08:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612822138; cv=none; d=google.com; s=arc-20160816; b=AKUILYp92oddPMrv98S1BtBoXqJWS/rXXMDJR0ehsd2xhwA3ZlWWe6G4s0TV9kt4ce IDPZBcU3YjdN5sffuQx/xWYO9CPL8TSNY/z25HvPura2twidhwGdZ4bMxvEWNNMq6T+l u7zPw6MVBpx94GsgfLrM9Y+V+cMc9NCGCCYu8ux+EJ7k8FUOEutAzVomUKCjiHvXrZA0 hZPxdmKh3lVR5okEknlDkQ9mgPW/SvpdugmxVPiWSb81TtJx5Uh3jRnHh7Yu5muWOkp0 vgPhQ2ATRd0YRaaybpcjrTAehIz/LADFqPeoEn7H/SAWD6x683TEglvUmZH8r15zr73O FGUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=d45fruyMe2LIRicqFUcbjfSPAJ46rlT885i916wbg1M=; b=pkj8amQNvqwcf2seQIetVssJj1A8KIBmmTTsg4pn3IYUfc+7E5VjvKLQZ7lD4DxT/i dNs8TJLE039aiRLzhODDAlhAVBDdOK8ixX6I+n/bSxHR6myF+Sqbr/8RP9EwOzcNcpWv 3OWCTSDeQiNrq803GEULfB0g/IC7+u3F7qb+0OQP5A6KCZEaq1rKT/aQpgkTQiq01Ng8 Cr5LdzH72kGSXSxSXiCJ7SD5nddoBhJh0namz0E+JPHIVmOn4c84jlXaUYIyww8r1MpG /R8kGZgMSZxEvohdTUi5YZbPAGDCu+CvVW1F/5IE25+4r8WPvxPAOlW9h+TCg5uG06/a fmYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Rs/SGVlc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e6si14921092edz.98.2021.02.08.14.08.33; Mon, 08 Feb 2021 14:08:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Rs/SGVlc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230265AbhBHWH4 (ORCPT + 99 others); Mon, 8 Feb 2021 17:07:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:44366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230090AbhBHWHy (ORCPT ); Mon, 8 Feb 2021 17:07:54 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2DA0664E27; Mon, 8 Feb 2021 22:07:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612822034; bh=d45fruyMe2LIRicqFUcbjfSPAJ46rlT885i916wbg1M=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=Rs/SGVlc5JYIWflp/bjz/2kv7Uf1Wopy2HTaSlo5yvxmjcx03ByKlXeJA4I3EZFx0 0TIZZuY/TVTqaNtl1sjKQ9jP0jlB914X6JY40yQGOqRJO+nLq403dOcGt0r06mTxf4 5sIAqMmgtFm5cau9bko2C0wJ5k3RdnEjcC9a+glDrQLIXVLcc3roEuoRyMUCW78r3J 5fDZ7TXSfC3QRdMcqjREvl7Pf81ICj7YFN4ui9/p358cgzui19iRDpfoSPLtQuDPYF jJQgJPQULDCXSOOQEyREvnsEJYXkytV7uzeUQy85yUALxtIA0eCiHeyoVibDN+72kK L7Uy7fJLn0tAw== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <1612812784-26369-1-git-send-email-subbaram@codeaurora.org> References: <1612812784-26369-1-git-send-email-subbaram@codeaurora.org> Subject: Re: [PATCH] spmi: spmi-pmic-arb: Fix hw_irq overflow From: Stephen Boyd Cc: linux-arm-msm@vger.kernel.org, David Collins , Subbaraman Narayanamurthy , stable@vger.kernel.org To: Subbaraman Narayanamurthy , linux-kernel@vger.kernel.org Date: Mon, 08 Feb 2021 14:07:12 -0800 Message-ID: <161282203270.4168818.14030280893762596656@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Subbaraman Narayanamurthy (2021-02-08 11:33:04) > Currently, when handling the SPMI summary interrupt, the hw_irq > number is calculated based on SID, Peripheral ID, IRQ index and > APID. This is then passed to irq_find_mapping() to see if a > mapping exists for this hw_irq and if available, invoke the > interrupt handler. Since the IRQ index uses an "int" type, hw_irq > which is of unsigned long data type can take a large value when > SID has its MSB set to 1 and the type conversion happens. Because > of this, irq_find_mapping() returns 0 as there is no mapping > for this hw_irq. This ends up invoking cleanup_irq() as if > the interrupt is spurious whereas it is actually a valid > interrupt. Fix this by using the proper data type (u32) for id. >=20 > Cc: stable@vger.kernel.org > Signed-off-by: Subbaraman Narayanamurthy > --- Applied to spmi-next