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.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, URIBL_BLOCKED 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 26541C07E9C for ; Thu, 8 Jul 2021 10:12:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0CAB561C17 for ; Thu, 8 Jul 2021 10:12:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231519AbhGHKPG (ORCPT ); Thu, 8 Jul 2021 06:15:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231421AbhGHKPF (ORCPT ); Thu, 8 Jul 2021 06:15:05 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF69BC061574 for ; Thu, 8 Jul 2021 03:12:22 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id h4so5428881pgp.5 for ; Thu, 08 Jul 2021 03:12:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jE27VuYVlOpCcGE27gQsr7n24gIzFqBsKr/EtxzjirM=; b=G92dwu3sSHn0hpFfWmwVWhaEJSJl1fZGJKtLaF8K9SCsn9B+SxyuB+cdrHAa41EEoe bOPKELTY0ujAr1/uUjjxq+xIFE6F987CKLcGzuKYHjUYMp+UfKO1c/i/DWXP0ShUbMXu 4eR9xAhqbcZUDGPmwY3PddJMgIsWU3LoVHfiw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jE27VuYVlOpCcGE27gQsr7n24gIzFqBsKr/EtxzjirM=; b=PEM4CeAbO5TkvDTTcztFc7NZh9HBZT1vmtLkGbXLkNjWLXpL0NQ3QtFINu9L/xFzof lMlyLKZ4aa1Kg5FJCiaOt8qI0JVwfpqK5V1Dg6N1pOK1uAMId29qBBRn+YF++H7dUDF/ Xe3JL9FguE8huW0X95Noi/Q0bSTdv/moP1Zx7yYLTtQd5LOlcxjThjjv/DND9RW5uRHZ uF9XCzLojIxqbKh0pgPm+fFqWUC2o2xqvxxzLjiHc+fgQAUkXKSa5lJv0UUxDxL2FRe7 YFsSSZGa5OXyvyG/mKDgrOfTlfj0Xkj7WYl8U+EdXY6SswKCvuBqOE18D1c6OEKRuTBk idCA== X-Gm-Message-State: AOAM532mbU3nOpDDyN9Vsiy6Ek5vfaTRZN2Bah+4520Pzke6rVD6VeiR pz84K4f41BzZ3MrR1wvw28mG5g== X-Google-Smtp-Source: ABdhPJw7HnJbMSz3SImDF0XLYGQVXOiCHGIGnPFgK7xXG1hDpDv9iYrxuVajKmvbZrTOqqKljUkzgA== X-Received: by 2002:a65:4903:: with SMTP id p3mr31418968pgs.402.1625739142574; Thu, 08 Jul 2021 03:12:22 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:9350:6a13:c03e:920f]) by smtp.gmail.com with ESMTPSA id y7sm2026578pfi.204.2021.07.08.03.12.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 03:12:21 -0700 (PDT) Date: Thu, 8 Jul 2021 19:12:17 +0900 From: Sergey Senozhatsky To: Takashi Iwai Cc: Max Filippov , Sergey Senozhatsky , alsa-devel@alsa-project.org, Leon Romanovsky , Takashi Iwai , LKML , "Gustavo A. R. Silva" Subject: Re: ALSA: intel8x0: div by zero in snd_intel8x0_update() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (21/07/08 11:00), Takashi Iwai wrote: > > > --- a/sound/pci/intel8x0.c > > > +++ b/sound/pci/intel8x0.c > > > @@ -694,7 +694,7 @@ static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ich > > > int status, civ, i, step; > > > int ack = 0; > > > > > > - if (!ichdev->prepared || ichdev->suspended) > > > + if (!(ichdev->prepared || ichdev->in_measurement) || ichdev->suspended) > > > > There's no ichdev::in_measurement, but if replaced with > > chip->in_measurement it indeed fixes my issue. > > One must compile the code before sending out :-< > > > So with this change: > > Tested-by: Max Filippov > > Great, thanks for quick testing, I'll prepare the fix patch now. Tested-by: Sergey Senozhatsky 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=-14.0 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 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 C52CCC07E96 for ; Thu, 8 Jul 2021 10:21:56 +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 46BEB61452 for ; Thu, 8 Jul 2021 10:21:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 46BEB61452 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 CFC581719; Thu, 8 Jul 2021 12:21:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CFC581719 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1625739714; bh=xIL2ZKjBXvMFhT33ntmUNbSg76qteHFRqM7ydRc4E4k=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=KKDPO9EZiyV18RrOUn4/43guI6EOA7ZAKs+kemVV1DaTy/stsYECcWHK/vylYuVZ2 jzniBfEaJ/48IbZBmSFZp675nV/JpPHrPXwMZXBq6KcTOPgM0zr6XQhi6an6kEsPXb 2RaPtUCs86yV/0keIDH5LTj52s3qlNxEyPgCZ+jI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0CE62F80246; Thu, 8 Jul 2021 12:12:33 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id ACD20F80249; Thu, 8 Jul 2021 12:12:31 +0200 (CEST) Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) (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 36D00F80143 for ; Thu, 8 Jul 2021 12:12:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 36D00F80143 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="G92dwu3s" Received: by mail-pg1-x536.google.com with SMTP id s18so5425997pgg.8 for ; Thu, 08 Jul 2021 03:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jE27VuYVlOpCcGE27gQsr7n24gIzFqBsKr/EtxzjirM=; b=G92dwu3sSHn0hpFfWmwVWhaEJSJl1fZGJKtLaF8K9SCsn9B+SxyuB+cdrHAa41EEoe bOPKELTY0ujAr1/uUjjxq+xIFE6F987CKLcGzuKYHjUYMp+UfKO1c/i/DWXP0ShUbMXu 4eR9xAhqbcZUDGPmwY3PddJMgIsWU3LoVHfiw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jE27VuYVlOpCcGE27gQsr7n24gIzFqBsKr/EtxzjirM=; b=TCrLvkhZIH7P+oEhtliPRd2tyUxx/H9MWhVuB9CO1uVIw4ph7oALzbXeVkdndwRAC4 MnLgZTzIq9/tXVyDyvqHsYFrfcgyMqOVMo4vL/IpowClLkVIHZpOa05H/JUsByuNBozC 1jYcx1MpEHyGYNwnTry9xTpXkzac9J/lVyA0+OhQOTem2QykSYqxawnxdwGZ+afGA6tL Qn8hKOV1kVC0M+YCTvHZdubssgO0N5e5vuAwQViSmZpEcIwfqegZDFQNXL9nBN/mNJDv ivL22OLHU6AkmUVovzqEmDUl7UVoH8qZEedI0ur9+pBSnsXNv8X6Ns3DaYwbHOQUaOW3 QpBg== X-Gm-Message-State: AOAM531n8wj6lXqtGDuETSWI7Ks0CltDrBe7T/c6aZ7njIcNFfgdDKEq h6YHMLyoRUJXspPCw1z+ixHFXQ== X-Google-Smtp-Source: ABdhPJw7HnJbMSz3SImDF0XLYGQVXOiCHGIGnPFgK7xXG1hDpDv9iYrxuVajKmvbZrTOqqKljUkzgA== X-Received: by 2002:a65:4903:: with SMTP id p3mr31418968pgs.402.1625739142574; Thu, 08 Jul 2021 03:12:22 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:9350:6a13:c03e:920f]) by smtp.gmail.com with ESMTPSA id y7sm2026578pfi.204.2021.07.08.03.12.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 03:12:21 -0700 (PDT) Date: Thu, 8 Jul 2021 19:12:17 +0900 From: Sergey Senozhatsky To: Takashi Iwai Subject: Re: ALSA: intel8x0: div by zero in snd_intel8x0_update() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: alsa-devel@alsa-project.org, "Gustavo A. R. Silva" , Leon Romanovsky , Sergey Senozhatsky , LKML , Takashi Iwai , Max Filippov 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" On (21/07/08 11:00), Takashi Iwai wrote: > > > --- a/sound/pci/intel8x0.c > > > +++ b/sound/pci/intel8x0.c > > > @@ -694,7 +694,7 @@ static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ich > > > int status, civ, i, step; > > > int ack = 0; > > > > > > - if (!ichdev->prepared || ichdev->suspended) > > > + if (!(ichdev->prepared || ichdev->in_measurement) || ichdev->suspended) > > > > There's no ichdev::in_measurement, but if replaced with > > chip->in_measurement it indeed fixes my issue. > > One must compile the code before sending out :-< > > > So with this change: > > Tested-by: Max Filippov > > Great, thanks for quick testing, I'll prepare the fix patch now. Tested-by: Sergey Senozhatsky