From patchwork Sun Jun 6 02:56:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 455077 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, URIBL_BLOCKED, 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 9732CC47082 for ; Sun, 6 Jun 2021 02:58:10 +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 C9380613F7 for ; Sun, 6 Jun 2021 02:58:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9380613F7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sakamocchi.jp 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 793E01715; Sun, 6 Jun 2021 04:57:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 793E01715 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1622948286; bh=J0JVC8IrNFhvCSeNwrD98/SSkhP6t+CoTG4Dp2zAyMk=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=RNNT7rkhF6GeSDWLJ2shMvrSVIGqNz4JoHO2RGdSCNp8sYRL3daHCFfseIi66cH+T +1k3lOWV7KqIFSzh2MsTIEGCMAZL3j2V3WbVyR1k7VBCsfYHZWTB4MySASOTWjBPW3 rHbsXnseS6ZuKnGfdT9m8Jr51BTMZAc1saM2vW+U= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0737DF80103; Sun, 6 Jun 2021 04:57:15 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DEC78F80218; Sun, 6 Jun 2021 04:57:13 +0200 (CEST) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9CA61F80103 for ; Sun, 6 Jun 2021 04:57:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9CA61F80103 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="GP93Xprs"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="HyZiwDDP" Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 478BA1ADE; Sat, 5 Jun 2021 22:56:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 05 Jun 2021 22:56:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=UhIxHU70sGBKj4UvNzYu+U5RD1 I5cMjzJs+YyMzavL0=; b=GP93Xprsk6Zi3X3jdR4vZiF5QKTIuonc4OJf9w8DVC dFPeuzdQ+LSZKpKZA4GTxux95PfdwYN+Xg7su9No9yusEADIlfMC3NVhnN2iH836 o6qeuuF36HQLCKL4zvAG57rD+/GS1y3WYVjQfW1MBqa2gr8mPekhfoEq3TLc6F4z no+2yOE8dVOD18maNjS8wIBiFOff7I8kJqDzswQ5D48oLpdZ21IurJSJrR8GHmIW itFUs/GMVXF84SHv1vugLfV7IAG8euSkU1Lh1wl14A/e7cL397PpObkrDjO597oO oqXpFqSnfh7eR66nEGRRkNA654N2QPXwjNgKxYGUlNlg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=UhIxHU70sGBKj4UvN zYu+U5RD1I5cMjzJs+YyMzavL0=; b=HyZiwDDPgD/E3Qjuht+eGeIRgrc7qmdUS QPkMiUoHMJyjYUGuQzS+Bz3Crvtg634U7c7gJFUxvZ5yr9Vzg0tp3wX6kCU+41Yq Y9m8tXYGQ56aoI5ujFyyCMEldXUFtIP7Nm2iOCFaMsAa6v4Kn/nX0YbvV4UFCI9W lhLFcpaWEgzfIK6YCrf21lyhF4AQIQWM+D+vAnY3sJ+J0hwZuHDvw2HwghEkgG4D UvPLQUIbi5isnW890crzZfH3pOIYu+7ZxEY1wXvDDYJKbPNRpnythbZX0ddAhR1s UVrrS60qMbxloxBDKEvSQ4eoApeasDpT0LgvW9jTi1pbAKFKgirYA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedtgedgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepvfgrkhgrshhhihcuufgrkhgrmhhothhouceoohdqthgrkhgrshhh ihesshgrkhgrmhhotggthhhirdhjpheqnecuggftrfgrthhtvghrnhepudejteelhfdttd ekgfdtueeilefhgfetjeejheekgeevuddvveegieehueeukeejnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkh grmhhotggthhhirdhjph X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 5 Jun 2021 22:56:54 -0400 (EDT) From: Takashi Sakamoto To: tiwai@suse.de Subject: [PATCH] ALSA: firewire-lib: remove useless operations for kernel preemption Date: Sun, 6 Jun 2021 11:56:51 +0900 Message-Id: <20210606025651.29970-1-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, clemens@ladisch.de 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" In all of drivers of ALSA firewire stack, the callback of .pointer and .ack in snd_pcm_ops structure is done in acquired spin_lock of PCM substream, therefore already under disabled kernel preemption. Signed-off-by: Takashi Sakamoto --- sound/firewire/amdtp-stream.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index 945597ffacc2..1c566ddf0776 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -1751,13 +1751,8 @@ unsigned long amdtp_domain_stream_pcm_pointer(struct amdtp_domain *d, // Later, the process context will sometimes schedules software // IRQ context of the period_work. Then, no need to flush the // queue by the same reason as described in the above - if (current_work() != &s->period_work) { - // Queued packet should be processed without any kernel - // preemption to keep latency against bus cycle. - preempt_disable(); + if (current_work() != &s->period_work) fw_iso_context_flush_completions(irq_target->context); - preempt_enable(); - } } return READ_ONCE(s->pcm_buffer_pointer); @@ -1777,13 +1772,8 @@ int amdtp_domain_stream_pcm_ack(struct amdtp_domain *d, struct amdtp_stream *s) // Process isochronous packets for recent isochronous cycle to handle // queued PCM frames. - if (irq_target && amdtp_stream_running(irq_target)) { - // Queued packet should be processed without any kernel - // preemption to keep latency against bus cycle. - preempt_disable(); + if (irq_target && amdtp_stream_running(irq_target)) fw_iso_context_flush_completions(irq_target->context); - preempt_enable(); - } return 0; }