Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1905884rwd; Fri, 2 Jun 2023 01:44:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Ueefzr5PaChkb0hmoCG7iY6VL3Y5zLPURxF3yaivdYxHWIJUzYTvapwrVyOzizsccBP48 X-Received: by 2002:aca:2b12:0:b0:398:45bf:6e65 with SMTP id i18-20020aca2b12000000b0039845bf6e65mr1922495oik.9.1685695442130; Fri, 02 Jun 2023 01:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685695442; cv=none; d=google.com; s=arc-20160816; b=IrCmx1lKW+UYTzomAn2h0VAzUMIPPhnspf2TwLry9TgO5ESBIMTImaMPmQmesMcOev g/uk+BQXu67BSrxlyGlRzAxq3+5GfeDhUOTpGLQrwDFUxLKPDkhAvFcqpC8lY9V21aeS Qm+KuR2OHs9CQ/rqkKLwshTbvjVvDaix/kQfllUKUlD6fF0zwNrAzamHsU3Z7ScPuiA3 HjPz+fZkbW9H3Anx19+4arVv/ugUTa3DY4byCZMaofRe0LrSDQyXlELhwXyA1R8PQajA os8zwnzEnh0Ol7JpYsLeQxt5m7xRydt8ICn/AImnbdewQNOGr/zoqMxi2drmXVuzsvvR mw0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=gXsHwXIkqIMPI+sU77tOM2/Q0dJ8eT8YqESfqpSpNww=; b=TjlZotJiR9Y5uZZExKGNyPWwMVlbqIUIo2z92AdcZnMnryATq7ydaDgUKpVPi+pTE+ PLqKrAtAfB4rswC9jryHNcFeQFD7gdFOqW8PUP1H8y7v5ITZwBzU8H/ElIe9Y16/HG5s gGkNupaJAgLp0KRA6sVQR8lW7Kwq2N6DYSLzauL1rRIS4oru5TGY6niCyEFoHkQbbVqc relHWBeZYVpAPX+r/rf4P26lKFD66k4OG+Ns0u5WH39BntoeTnFfAHWOO4z6+9t4C066 NHaV/gGBj/xzNkeh9yYwyl+xKmowCkNG1g5dy6xJ/8yCeD67h31uLm5qI09kpAfClKai HqLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=hZo2EPAH; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a170902f7c500b001a64e7b702fsi513562plw.447.2023.06.02.01.43.49; Fri, 02 Jun 2023 01:44:02 -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; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=hZo2EPAH; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234530AbjFBIie (ORCPT + 99 others); Fri, 2 Jun 2023 04:38:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234331AbjFBIia (ORCPT ); Fri, 2 Jun 2023 04:38:30 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0579E2 for ; Fri, 2 Jun 2023 01:38:29 -0700 (PDT) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35273kMd018220; Fri, 2 Jun 2023 03:38:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=PODMain02222019; bh=gXsHwXIkqIMPI+sU77tOM2/Q0dJ8eT8YqESfqpSpNww=; b=hZo2EPAHqAvS4bLxSPIRXIKHFOF/bnglY6aTEYtUhpLFUbZoi4imV2Mipf/XwqwJ0uP7 SJWKMUkNQPp9ZCfD/H0bParGBbagDNJSCMdsHos6X3skgDrOQoq5wDqENjNLR2wBRslg ZgBQHn4u1caoSDCgYkQ3vSHv9w4FkwmBnW38idiXaL1qHdMYnpsvZ24h+FTQ9ENmejPd dmb8pd47QMgCQ7H+4Yg9QkIqaOTeqXJKF7J1wGk18ni6ap69qNcRb/+AnhwbuAA13R5G xkBnO6IEFueqGcx1EpHNYc9wNl5xWBDAp4iN479/PTHbeN0xgAsivCLlaavERFBEcASL mQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3quf90y5s3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Jun 2023 03:38:12 -0500 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 2 Jun 2023 09:38:10 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 2 Jun 2023 09:38:10 +0100 Received: from ediswmail.ad.cirrus.com (ediswmail.ad.cirrus.com [198.61.86.93]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 57E8715A4; Fri, 2 Jun 2023 08:38:10 +0000 (UTC) Date: Fri, 2 Jun 2023 08:38:10 +0000 From: Charles Keepax To: Pierre-Louis Bossart CC: , , , , , Subject: Re: [PATCH 4/4] soundwire: stream: Tidy do_bank_switch error messages Message-ID: <20230602083810.GK68926@ediswmail.ad.cirrus.com> References: <20230601161622.1808135-1-ckeepax@opensource.cirrus.com> <20230601161622.1808135-4-ckeepax@opensource.cirrus.com> <4e90380f-b328-5806-4305-0a794cadc550@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <4e90380f-b328-5806-4305-0a794cadc550@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-GUID: 8C9lHObPsMRu1WPHQ1nYgXrAnLxE34WY X-Proofpoint-ORIG-GUID: 8C9lHObPsMRu1WPHQ1nYgXrAnLxE34WY X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Thu, Jun 01, 2023 at 11:34:10AM -0500, Pierre-Louis Bossart wrote: > On 6/1/23 11:16, Charles Keepax wrote: > > Every error path in do_bank_switch prints an error message so there is no > > need for the callers to also print error messages. Indeed in multi-master > > cases these extra messages are confusing because they print out against a > > random bus device whereas the do_bank_switch messages print against the bus > > that actually failed. > > Errm, what? > > There is no way to know which bus failed in multi-master mode, and the > 'stream' can span multiple buses so the use of pr_err was intentional. Apologies this is the commit message not quite keeping pace with the code base. Originally when I wrote the patch the error message after do_bank_switch were a "dev_err(bus->dev", that was then fixed up in commit d014688eb373 ("soundwire: stream: remove bus->dev from logs on multiple buses"). > There's just no other way to report issues, and I don't see why one > would remove such logs and fail silently. > > I just don't get what you are trying to address. > The current code would say produce something like: Bank switch failed: -5 _sdw_prepare_stream: do_bank_switch failed: -5 I am sensing you are keen to keep both error messages, so fair enough I will drop that. Although worth noting originally before that patch I mention above this would have been: Bank switch failed: -5 do_bank_switch failed: -5 Which is really what I was attempting to address, that is clearly redundant. Now with the addition of the function in the print I guess it is slightly less redundant. > > This also allows clean up of a couple of if's and variable initialisations > > that were only there to silence potentially uninitialised variable > > warnings on the bus variable. > > That should be a separate patch IMHO. > I will trim the patch down to leave the duplicate error messages and just remove those bits. Thanks, Charles