Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3120047pxm; Mon, 28 Feb 2022 12:26:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwazCvc1naz66GiwvIWg7tNSgNZ7fOjQb6cT5KNB1vE4IM1xS5KAD035HxQlz/EfH/gWYx/ X-Received: by 2002:a63:5758:0:b0:34e:b5da:7dac with SMTP id h24-20020a635758000000b0034eb5da7dacmr18555468pgm.515.1646080012710; Mon, 28 Feb 2022 12:26:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646080012; cv=none; d=google.com; s=arc-20160816; b=CQQiLZufCGMmcQng720VEo13Pzis516Dwq2xe1Q7ALrgCBrOAtUS45pqpHFh19GdSH aTLgc4EZAGAoPghbQyUPlvPqnmGVf1aZnJplfzBtf9wH0yCSvoPWng7T64SzmKTYAlu8 4FQQJcYS+PvvwtWsGI3rQuP5TX9oan9jpMnbnvcIxvubHjlg4sXpZmDT2/5Cvwc+buMp hLP3Cue1JiifrH9YD/QnFQnp9aGjjU7MYGbuNixNJ/GOj7UWBfW08vS3iTypbMClLX+L IRCcoXs5CH+WnRDHuxn1RVQGi3YsrWr14nZc2Ol5vVfZulbwPnsl+4nnZu9ACUpJBZL5 wY5g== 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=j7JxniUQ2fmyNDlyJugdPixWnQYjnNP4QE/CWrCO3Nw=; b=pTdLYX0zQf3OsUZ1JgtVgs852PFdD1Hphnkg30aadCBZpjAx55S8yQgzJ4BmIBRpEy 0bVtlJgyPd+GSD9oibEIPo/FvK9HrMjSxlD0bdlWWKtHRugIUMtsdElLI1h45sVys7Yd Jn3lT0ZVU4Q/n2hSq1cWTpHJwQp/7zbm/VXlr9sIa7SRJ3QkcgIKAMq/jWsJitjlG8Rq lm46J/uQgOdJta5ZidFsX6sP7XI6v31sdk39L6xikx55cTsON1pJRbQv0kUj7Kx6N5U0 MywSU1i6P35cXLdxJxnADdcO9jaYKNjxrGAo/ILrVhBoLGfOI3NENwSanjpbmQxvexlg yhhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=evRiHM5R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o11-20020a170902d4cb00b0015025256ef9si11511537plg.333.2022.02.28.12.26.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:26:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=evRiHM5R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 A4A091EEFBB; Mon, 28 Feb 2022 11:44:43 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235646AbiB1SPP (ORCPT + 99 others); Mon, 28 Feb 2022 13:15:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241455AbiB1SJz (ORCPT ); Mon, 28 Feb 2022 13:09:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B7EBB45BC; Mon, 28 Feb 2022 09:50:03 -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 B1E2360915; Mon, 28 Feb 2022 17:50:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1141C340E7; Mon, 28 Feb 2022 17:50:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646070601; bh=BLTmIppxTsWdWze0CZzsQG7uFrPoMqr09GCc5EhtdPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=evRiHM5R7JUuk5QeFvmnkRbF7ql9ZQ7HSpKZLLcqqL0JlIhMkQxfZZ0AuDORcSA/T R3v8kQo8F0iJNAp9bJOJXXMM/j3p0iIKn5qWm2FVZCmU4axJlvTBRaSGjKyNcOvnj0 5JMRLF1xadrv59DGiv2VavR0uu/6PWKbvaKm7HdA= 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.16 148/164] tps6598x: clear int mask on probe failure Date: Mon, 28 Feb 2022 18:25:10 +0100 Message-Id: <20220228172413.258312561@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172359.567256961@linuxfoundation.org> References: <20220228172359.567256961@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(-) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 6d27a5b5e3ca..7ffcda94d323 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -761,12 +761,12 @@ static int tps6598x_probe(struct i2c_client *client) 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 @@ -855,7 +855,8 @@ static int tps6598x_probe(struct i2c_client *client) 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; } -- 2.35.1