From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68316C433B4 for ; Sat, 8 May 2021 07:52:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3013361448 for ; Sat, 8 May 2021 07:52:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230021AbhEHHw4 (ORCPT ); Sat, 8 May 2021 03:52:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbhEHHwy (ORCPT ); Sat, 8 May 2021 03:52:54 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1E03C061574 for ; Sat, 8 May 2021 00:51:53 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id b21so6431833plz.0 for ; Sat, 08 May 2021 00:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Pxp734UlOkRRxunoHCpwvTPDDo/epCxir06qlJaIU9c=; b=A+qUdMSv0ZBpGuTwDxnlbJCY5Q35JWOwTnBzzuyRxwceC6c7WBDKIpmWtjrKyikp+1 Ea/HwhjKjM8Tdlm5XEoQn8i38S6Ow7jM+PmnNK2XvTV81bybiUeXl8HnqIHcghgi6gmk wNPkPDMJFEGkmekhT8+aoQP4ylGIdkZ2ieC0E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Pxp734UlOkRRxunoHCpwvTPDDo/epCxir06qlJaIU9c=; b=ftmwPxGDmGxbujDfqJpAGVtNzzWIhe+TuIXgv8y161UGuDEbZv28PLTJ4QJYhSyBQI vlsvVKYAjTQhLvocbaDrXk2kyfQwvrs9BtTvByk7om6aucjG+nUE6PRdCHKTot7kOl6U /xqdxSOdcJ5QFQREtmlBJTpLFN4kdJe3vEvBl0o47uurXIt/dobiVq2TwO7CMQHsZYx0 L7bj7uk97dGj9renZTKwWLt0XRZ/jKw5SET0DJDm8gqzOnxlTwRKwbc/YOh1Ci3NTWWQ k2lS1IZm6xqfmoL6Hsl2V/vm0fYhKLj98KItRVSi+07AOoFgmcBBvALf6KAzsHaphs2w Z6zA== X-Gm-Message-State: AOAM531xeTnywSLFxq4AtGsoGyYz6vU35Vgaz62IbBI5vkEt3IyKcLkz vnS4d/bjkSEkGmIFX2FDxtvlCQ== X-Google-Smtp-Source: ABdhPJxaBMAzmyl39VfTVwVMp2YZpbT/F0pm0xyG8G2PQRr5Psju/7ZCbR7aahhd7NmJJu1e4pdzQA== X-Received: by 2002:a17:90a:f694:: with SMTP id cl20mr14962788pjb.67.1620460313121; Sat, 08 May 2021 00:51:53 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:ab8b:4a3d:46ab:361c]) by smtp.gmail.com with ESMTPSA id b65sm6345091pga.83.2021.05.08.00.51.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 May 2021 00:51:52 -0700 (PDT) From: Stephen Boyd To: Mark Brown Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Jairaj Arava , Sathyanarayana Nujella , Pierre-Louis Bossart , Shuming Fan , Ranjani Sridharan Subject: [PATCH 1/2] ASoC: rt5682: Disable irq on shutdown Date: Sat, 8 May 2021 00:51:50 -0700 Message-Id: <20210508075151.1626903-1-swboyd@chromium.org> X-Mailer: git-send-email 2.31.1.607.g51e8a6a459-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We cancel the work queues, and reset the device on shutdown, but the irq isn't disabled so the work queues could be queued again. Let's disable the irq during shutdown so that we don't have to worry about this device trying to do anything anymore. This fixes a problem seen where the i2c bus is shutdown at reboot but this device irq still comes in and tries to make another i2c transaction when the bus doesn't work. Cc: Jairaj Arava Cc: Sathyanarayana Nujella Cc: Pierre-Louis Bossart Cc: Shuming Fan Cc: Ranjani Sridharan Fixes: 45a2702ce109 ("ASoC: rt5682: Fix panic in rt5682_jack_detect_handler happening during system shutdown") Signed-off-by: Stephen Boyd --- sound/soc/codecs/rt5682-i2c.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/rt5682-i2c.c b/sound/soc/codecs/rt5682-i2c.c index 93c1603b42f1..8265b537ff4f 100644 --- a/sound/soc/codecs/rt5682-i2c.c +++ b/sound/soc/codecs/rt5682-i2c.c @@ -273,6 +273,7 @@ static void rt5682_i2c_shutdown(struct i2c_client *client) { struct rt5682_priv *rt5682 = i2c_get_clientdata(client); + disable_irq(client->irq); cancel_delayed_work_sync(&rt5682->jack_detect_work); cancel_delayed_work_sync(&rt5682->jd_check_work); base-commit: 9f4ad9e425a1d3b6a34617b8ea226d56a119a717 -- https://chromeos.dev From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0F8EC433ED for ; Sat, 8 May 2021 07:54:01 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DB58D61456 for ; Sat, 8 May 2021 07:53:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB58D61456 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C5F46167B; Sat, 8 May 2021 09:52:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C5F46167B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1620460437; bh=CDK816gb+ascPVi9hHY9IuOu9wDolopS0LS4CH3VdZg=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=Fq6G2JUQSvvmhPpIWfHRy4DoTB/yK4X/aX3aMgxS7PAs8fic85vo48Jx/+gb8WG1F qftkmkTZ79EMVu45TKHUpGNSgO/DO0VV1ubpAXh4Q0ErBdRD/sdBj/x4DOedg5ks/1 zj18q/NPBu+ioZoHavL4UwKPmRh6V1KmEPyBfIbQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 24037F8010B; Sat, 8 May 2021 09:52:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EAA92F80234; Sat, 8 May 2021 09:52:12 +0200 (CEST) Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 454CEF800E8 for ; Sat, 8 May 2021 09:52:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 454CEF800E8 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="A+qUdMSv" Received: by mail-pl1-x635.google.com with SMTP id a11so6397358plh.3 for ; Sat, 08 May 2021 00:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Pxp734UlOkRRxunoHCpwvTPDDo/epCxir06qlJaIU9c=; b=A+qUdMSv0ZBpGuTwDxnlbJCY5Q35JWOwTnBzzuyRxwceC6c7WBDKIpmWtjrKyikp+1 Ea/HwhjKjM8Tdlm5XEoQn8i38S6Ow7jM+PmnNK2XvTV81bybiUeXl8HnqIHcghgi6gmk wNPkPDMJFEGkmekhT8+aoQP4ylGIdkZ2ieC0E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Pxp734UlOkRRxunoHCpwvTPDDo/epCxir06qlJaIU9c=; b=g1GkcLag3SgUJVzvmpFC/TYt20w24psa4lqQ0aR7TEYR1nMMHG5jgulcGpFuouzTaV rySwZn7zSkw/df+JhPTN9YBlaX5j5+MBXTL79fSIh1SMxYDh0ig/yO6GRZNxYUkWuJ8B SQve6ZQnudjMno/gTTp4Iz2E7JTyBwnaIHtbT6ONInXtc2+BKC+RatJh9P7bz09B9YlN w1FGo5yMBfNWqmhx42Ng6kJF9Nh/KMWLjaa+69MHbVSJ6OTy0oCKHANRwpofSS7N7a8c b+xoqedkSrLca+nfJzT/LFU+g0vy/+I4mMb96tfWsixb54rGz09mdJYcLqZQ+0LnEFlr mNKA== X-Gm-Message-State: AOAM533z+eitYYsgsX7iIPsIpLRgDmvhW5/CtjDcnbAfyfKWsLU5KIJs x+f10qVtA4i1Ym4nkRBEkWsYOA== X-Google-Smtp-Source: ABdhPJxaBMAzmyl39VfTVwVMp2YZpbT/F0pm0xyG8G2PQRr5Psju/7ZCbR7aahhd7NmJJu1e4pdzQA== X-Received: by 2002:a17:90a:f694:: with SMTP id cl20mr14962788pjb.67.1620460313121; Sat, 08 May 2021 00:51:53 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:ab8b:4a3d:46ab:361c]) by smtp.gmail.com with ESMTPSA id b65sm6345091pga.83.2021.05.08.00.51.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 May 2021 00:51:52 -0700 (PDT) From: Stephen Boyd To: Mark Brown Subject: [PATCH 1/2] ASoC: rt5682: Disable irq on shutdown Date: Sat, 8 May 2021 00:51:50 -0700 Message-Id: <20210508075151.1626903-1-swboyd@chromium.org> X-Mailer: git-send-email 2.31.1.607.g51e8a6a459-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: alsa-devel@alsa-project.org, Jairaj Arava , linux-kernel@vger.kernel.org, Ranjani Sridharan , Sathyanarayana Nujella , Shuming Fan , Pierre-Louis Bossart X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" We cancel the work queues, and reset the device on shutdown, but the irq isn't disabled so the work queues could be queued again. Let's disable the irq during shutdown so that we don't have to worry about this device trying to do anything anymore. This fixes a problem seen where the i2c bus is shutdown at reboot but this device irq still comes in and tries to make another i2c transaction when the bus doesn't work. Cc: Jairaj Arava Cc: Sathyanarayana Nujella Cc: Pierre-Louis Bossart Cc: Shuming Fan Cc: Ranjani Sridharan Fixes: 45a2702ce109 ("ASoC: rt5682: Fix panic in rt5682_jack_detect_handler happening during system shutdown") Signed-off-by: Stephen Boyd --- sound/soc/codecs/rt5682-i2c.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/rt5682-i2c.c b/sound/soc/codecs/rt5682-i2c.c index 93c1603b42f1..8265b537ff4f 100644 --- a/sound/soc/codecs/rt5682-i2c.c +++ b/sound/soc/codecs/rt5682-i2c.c @@ -273,6 +273,7 @@ static void rt5682_i2c_shutdown(struct i2c_client *client) { struct rt5682_priv *rt5682 = i2c_get_clientdata(client); + disable_irq(client->irq); cancel_delayed_work_sync(&rt5682->jack_detect_work); cancel_delayed_work_sync(&rt5682->jd_check_work); base-commit: 9f4ad9e425a1d3b6a34617b8ea226d56a119a717 -- https://chromeos.dev