Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3117894pxm; Mon, 28 Feb 2022 12:23:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxP5Yu1arRUoZvCTkgaXC7rUA7azxaB7j9Rh+v9rybPEIVF74twD+zTpigpYWyCzeW8mqqE X-Received: by 2002:a05:6a00:22cc:b0:4e0:58dc:e489 with SMTP id f12-20020a056a0022cc00b004e058dce489mr23558220pfj.58.1646079829968; Mon, 28 Feb 2022 12:23:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646079829; cv=none; d=google.com; s=arc-20160816; b=ZtFGUMOYM5yM8JVf6oELs7gQBC3J/efpjCQMr+Mq4YFl7AwRwvcTnbTqhFckLJVpM2 FcIReu+77coga7Q40Kqj45GCWsFtSTHTQScSqcR/bafCPnCcLRqk71hBhtyk7KdwKAEj U12sxYcltXS0UixGaFz3u55le6GsRUmANgpWiEM11EpGvau1FwmIcZjvI02Mh0r2iJ8U G6WRcVqoD9lQ13Zms6w+rMJB7yxeCnBaUfRJYLCj3nzniC5Xy1dluCmnGoo7Ogp3o4GM vt1EXiTumVm6rTQETX9hl9k45LfmX1rS/CoX/8lDOWO4TTQYJE73wSy7KfdebLsvwZ94 QVTQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9DLbgxTjV2ArY5nz88m/S8EqG4aSW8qnk697FwsPBPc=; b=wbScegjqbsQpvHx2Y7My32e1NO3PN0qNlIc8SaBtHpH8YhZKSZyGK9VET9rFnrFu5K bv7/YlW6Eqw0p5kV5ZswmnKLmIb0HlpzMsMP8o0ftgloVPV19FJr40F6/6MGGb3ujtiZ ZG6/AL593UXLyQCQIO2GV/lVAv0ygtqiL/LD1BV6GhJkj7Nsnsf5y9MngN8YUVdkwC3S XzPXW4iEUkyV2qHht8ZUzQvcNViEpw3+52bjaiJEkJpxTYNaei8Sek/BXZZidgorP54B q/1WeVh0r90oND9e4kirdn/5iTDmigAyD+gjJ+W096HL53de4ilagC3+2AnUEqSR/HJM Pb1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sifSREfi; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y1-20020a631801000000b00372a1d645e5si10549062pgl.585.2022.02.28.12.23.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:23:49 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sifSREfi; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B84DF1C57DE; Mon, 28 Feb 2022 11:42:50 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239342AbiB1SAR (ORCPT + 99 others); Mon, 28 Feb 2022 13:00:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240176AbiB1Rx5 (ORCPT ); Mon, 28 Feb 2022 12:53:57 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 625D9B1096; Mon, 28 Feb 2022 09:41:47 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 12A5A609EE; Mon, 28 Feb 2022 17:41:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D465C340E7; Mon, 28 Feb 2022 17:41:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646070102; bh=Jr5Pyk+otoV6gfQcM3bxSHkPqT76vEIXtzQ45AJ/KPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sifSREfif1hDBgXId+ENa+aEk+HpFlg66HceEK7JmwD99l3KEEE2ADtG9oUQ1QtYu uPLtqbQBJLvdBe3mymrNKLFeLgsHT/AoYnMR17l427F2fygrmWo+oI6wuE3jyBCejZ Hb3FvRorN2QPq+3fQVxgV9flm2xYhmB3ExKFAm/c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sven Peter , Heikki Krogerus , Jens Axboe Subject: [PATCH 5.15 124/139] tps6598x: clear int mask on probe failure Date: Mon, 28 Feb 2022 18:24:58 +0100 Message-Id: <20220228172400.668857813@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172347.614588246@linuxfoundation.org> References: <20220228172347.614588246@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Jens Axboe commit aba2081e0a9c977396124aa6df93b55ed5912b19 upstream. The interrupt mask is enabled before any potential failure points in the driver, which can leave a failure path where we exit with interrupts enabled but the device not live. This causes an infinite stream of interrupts on an Apple M1 Pro laptop on USB-C. Add a failure label that's used post enabling interrupts, where we mask them again before returning an error. Suggested-by: Sven Peter Cc: stable Reviewed-by: Heikki Krogerus Signed-off-by: Jens Axboe Link: https://lore.kernel.org/r/e6b80669-20f3-06e7-9ed5-8951a9c6db6f@kernel.dk Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/tipd/core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -618,12 +618,12 @@ static int tps6598x_probe(struct i2c_cli ret = tps6598x_read32(tps, TPS_REG_STATUS, &status); if (ret < 0) - return ret; + goto err_clear_mask; trace_tps6598x_status(status); ret = tps6598x_read32(tps, TPS_REG_SYSTEM_CONF, &conf); if (ret < 0) - return ret; + goto err_clear_mask; /* * This fwnode has a "compatible" property, but is never populated as a @@ -712,7 +712,8 @@ err_role_put: usb_role_switch_put(tps->role_sw); err_fwnode_put: fwnode_handle_put(fwnode); - +err_clear_mask: + tps6598x_write64(tps, TPS_REG_INT_MASK1, 0); return ret; }