From patchwork Thu Nov 16 16:35:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Scheel X-Patchwork-Id: 10061469 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 97B8A604D3 for ; Thu, 16 Nov 2017 16:35:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 896652ABA9 for ; Thu, 16 Nov 2017 16:35:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CD3F2ABAF; Thu, 16 Nov 2017 16:35:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F34A62ABA9 for ; Thu, 16 Nov 2017 16:35:28 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 89DD126772E; Thu, 16 Nov 2017 17:35:26 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3AA55267733; Thu, 16 Nov 2017 17:35:25 +0100 (CET) Received: from web01.jusst.de (jusst.de [188.40.114.84]) by alsa0.perex.cz (Postfix) with ESMTP id 36230266EE4 for ; Thu, 16 Nov 2017 17:35:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by web01.jusst.de (Postfix) with ESMTP id A64A91B02CFE; Thu, 16 Nov 2017 17:35:22 +0100 (CET) Authentication-Results: web01.jusst.de (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=jusst.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=jusst.de; h= x-mailer:message-id:date:date:subject:subject:from:from; s= default; t=1510850122; x=1512664523; bh=ZyybtxjMCjgZ6iauKw9QoDDr RsSZmIaePZZrfyBMEfQ=; b=jYQtqMuW5tiPO70XwlBnhhoLOsUg0ReJ4YnTwJGQ TE8ni03sUGnjxU56y40vSkQykjMmYcgVJOVbu4FeLQabiigC0rpPpzbNpGZaLy9C y39UC5lwceYu4TliKPueLCcyziLnLazyFxY0gy2+vDUVO4ar0jCSUDd/rF49lVK6 Hn8= X-Virus-Scanned: Debian amavisd-new at web01.jusst.de Received: from web01.jusst.de ([127.0.0.1]) by localhost (web01.jusst.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id zQff_nW4w_eV; Thu, 16 Nov 2017 17:35:22 +0100 (CET) Received: from julian-workstation.adnet.avionic-design.de (p3EE0335A.dip0.t-ipconnect.de [62.224.51.90]) (Authenticated sender: julian@jusst.de) by web01.jusst.de (Postfix) with ESMTPSA id E05D71B02CF0; Thu, 16 Nov 2017 17:35:21 +0100 (CET) From: Julian Scheel To: Jaroslav Kysela , Takashi Iwai , Bhumika Goyal , Julian Scheel , Stephen Barber , Con Kolivas , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Date: Thu, 16 Nov 2017 17:35:17 +0100 Message-Id: <20171116163517.5010-1-julian@jusst.de> X-Mailer: git-send-email 2.15.0 Subject: [alsa-devel] [PATCH] ALSA: usb-audio: uac1: Invalidate ctl on interrupt X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP When an interrupt occurs, the value of at least one of the belonging controls should have changed. To make sure they get re-read from device on the next read, invalidate the cache. This was correctly implemented for uac2 already, but missing for uac1. Signed-off-by: Julian Scheel --- sound/usb/mixer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 91bc8f18791e..1beb5b4d027e 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -2330,9 +2330,14 @@ void snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, int unitid) { struct usb_mixer_elem_list *list; - for (list = mixer->id_elems[unitid]; list; list = list->next_id_elem) + for (list = mixer->id_elems[unitid]; list; list = list->next_id_elem) { + struct usb_mixer_elem_info *info = + (struct usb_mixer_elem_info *)list; + /* invalidate cache, so the value is read from the device */ + info->cached = 0; snd_ctl_notify(mixer->chip->card, SNDRV_CTL_EVENT_MASK_VALUE, &list->kctl->id); + } } static void snd_usb_mixer_dump_cval(struct snd_info_buffer *buffer,