Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20539757rwd; Thu, 29 Jun 2023 03:53:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlE4yzxOGWo1cQfCaTu9L6rK4ttJerb6ZU3sjbvaA6rdUDzlVQMcLpZy6Ku/mPJuK363nj+C X-Received: by 2002:a17:903:228b:b0:1b8:5fb4:1c85 with SMTP id b11-20020a170903228b00b001b85fb41c85mr431815plh.16.1688036004065; Thu, 29 Jun 2023 03:53:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688036004; cv=none; d=google.com; s=arc-20160816; b=kZxHCOmxENELK8BaBiOz5UHrWPW43/V8Wqxj7ymBJ9nV2fil+ad5TaSopxURKmpZs/ vLEgpyf9uNb4SmgRg9+eD/3OFRaR7tSN9QbAWr+gDcWTGNvM9sY1w+sAOS2hczrzPGHI KYolB77avPvQc6cFule9e1WKgD2lkyJ79kmLDOdCp1u9NpBg2RON79OPWFs1cdT10PQA eS0VKXyY807jaMwM857HKitq4MGLrV+y3iho/h8vkCP5r4RKUXPM7QlbzvCOXqDTob4D YDptT2HJSBQvAqHdJJQvUn+d4HbMvvxDW+i+C9ZHahFGwGju7dwjGAMv+CkmNzjm9vBa dP1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=cg96e17bU45KdpRSwKq71ZYYzGfr5n9YeoZFby+w6cM=; fh=hB4Wd8exgauwVW8GpT+yD1aOfn06Ckk/BUvXqGysBp8=; b=ODEJ1zossf3bzjGydGoosSLOPYiASpaFSnEMQnoMq0UQ8QjObUv0Qh7cvJ4SfNkXyy Vh+xbl5AShGWXULOYUtcDySi1rfvTQR1m80dAFKWq15fO9uVDGXh1t/Yq133gWsJ/Y+Y gjEo5jDdPBB2SknAMO40zwoPSbo0DbncM0ohk1micYrJ2afSnssaigZQd41kqn1BANz1 Mmkk7ssi4pKUJD9I61jf1NA+DUPN4UOvViesn5ZAnBeWktNTp+biUW7qWJUvkNZZojiz uM8VX62AdH6D8rIKlyhNJfs+sZOqrj2CcmFikU9/ulkAh/q63lbF11tIam5YM1GZSy/m oC0Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n13-20020a170902f60d00b001b3dd46d4fesi10510058plg.66.2023.06.29.03.53.11; Thu, 29 Jun 2023 03:53:24 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230036AbjF2KWg convert rfc822-to-8bit (ORCPT + 99 others); Thu, 29 Jun 2023 06:22:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230119AbjF2KWe (ORCPT ); Thu, 29 Jun 2023 06:22:34 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1602C131 for ; Thu, 29 Jun 2023 03:22:31 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-156-pPX-EROVOembC7vWITh1PA-1; Thu, 29 Jun 2023 11:22:15 +0100 X-MC-Unique: pPX-EROVOembC7vWITh1PA-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 29 Jun 2023 11:21:06 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Thu, 29 Jun 2023 11:21:06 +0100 From: David Laight To: 'Mark Brown' CC: 'Sameer Pujar' , "robh+dt@kernel.org" , "krzk+dt@kernel.org" , "thierry.reding@gmail.com" , "lgirdwood@gmail.com" , "perex@perex.cz" , "tiwai@suse.com" , "jonathanh@nvidia.com" , "mkumard@nvidia.com" , "sheetal@nvidia.com" , "alsa-devel@alsa-project.org" , "devicetree@vger.kernel.org" , "linux-tegra@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Oder Chiou Subject: RE: [PATCH v2 3/5] ASoC: rt5640: Fix sleep in atomic context Thread-Topic: [PATCH v2 3/5] ASoC: rt5640: Fix sleep in atomic context Thread-Index: AQHZqkh8hA8hSCOxA0KruUap8XcLma+hdFowgAAKboCAABMH0A== Date: Thu, 29 Jun 2023 10:21:06 +0000 Message-ID: <953c899d04e543f681e44daad4ec2ff7@AcuMS.aculab.com> References: <1688015537-31682-1-git-send-email-spujar@nvidia.com> <1688015537-31682-4-git-send-email-spujar@nvidia.com> <550e5c8f-0bfb-4ffc-9a43-1ecb153c6a02@sirena.org.uk> In-Reply-To: <550e5c8f-0bfb-4ffc-9a43-1ecb153c6a02@sirena.org.uk> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,PDS_BAD_THREAD_QP_64, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Mark Brown > Sent: 29 June 2023 11:11 > > On Thu, Jun 29, 2023 at 08:38:09AM +0000, David Laight wrote: > > From: Sameer Pujar > > > > Following prints are observed while testing audio on Jetson AGX Orin which > > > has onboard RT5640 audio codec: > > > > > > BUG: sleeping function called from invalid context at kernel/workqueue.c:3027 > > > in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 0, name: swapper/0 > > > My 'gut feel' is that this will just move the problem elsewhere. > > > If the ISR is responsible for adding audio buffers (etc) then it is > > also not unlikely that the scheduling delays in running a threaded ISR > > will cause audio glitches if the system is busy. > > What makes you think this is anything to do with audio glitches? The > bug is literally what is described, it is not valid to sleep in atomic > contexts and if we ever actually try things are likely to go badly. What I mean is that deferring the ISR to process context is likely to generate audio glitches on a busy system. I realise that sleeping in an ISR goes badly wrong. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)