Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1043635rdh; Fri, 24 Nov 2023 04:11:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGfgYGtqiaPOJzTOai3Y0QkN819WpDNlYIpG4YbbHswDatbTPCTFqa4hQ8vKmmgCYASxCy X-Received: by 2002:a17:90b:1c86:b0:280:cd7b:1fa5 with SMTP id oo6-20020a17090b1c8600b00280cd7b1fa5mr2549990pjb.4.1700827908318; Fri, 24 Nov 2023 04:11:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700827908; cv=none; d=google.com; s=arc-20160816; b=wpWZzWDu7FfBbMciaF29pNU8IZd8qk6+ooSyMTMIwImVF5Myi6h34jH6AdtilHd6ZX Ub3Vt8P1QraZxRZDFB+szTOWkthuAf9QZuRMS2pOwYna/ffRztLzkrjZ25bKJ6NkxzzF dW7AqlFi4jRP7GfyqdpTotoFnrqeyDCtQzls8cum/1qobrC90IoIyalwNat+Tq9agrai xVf/b6e/dQS9SK5DebX3RP1GfbRJCZpaNXF//tXzWU+8IJPKxYi5wgvm/nBMIJceFXoD ltb88xG3bY+9lXlriIVJnu0PwS3JgXTQUf8WpZ4q90TtkB9lDIo6MtXtBi+4zMx+OQws /FBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=3HsNw1xykXwYfSR+pNMUEEfWUKX0b4qVVWE+fINVjB4=; fh=sJhw+3PNhbPGIHQ3wugqwwdm0HVyf7HCphx+blvjebo=; b=L1csfvYGmdNYxQJS9YYsmY6fayNaZUExSPlRTZUko8Pkf8m3pWVuxZrpfkmQQmVq+L 68U/E6EvWo+w8Dz6iyU41c20iSNhaGRxeJoL9T0a/rq0RCMVMvTqON30LmjBffjpOXGd HkpGCKRdwQQ09hjhVOI7IZ/z5sfpzN3xIfDuaECseeDQxv4Mu5jYJt12GT20pFLqV+WL 6eVeoj2uIHKXJPAu5iPq7WWR19RkvWQoRa6wEXWUBthqP6htx0DSfQLG6YjuQsV2lE2Y tBIdLNktG5pxFYQ1Cd83WZC/6/K4nSag2OBE/U0ptzAwdkO5x+kPNcNzwUEESFeV0rCZ zjDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@phytec.de header.s=a4 header.b=YdJHiUpv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id q34-20020a17090a752500b0027cdee52324si4051046pjk.74.2023.11.24.04.11.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 04:11:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=fail header.i=@phytec.de header.s=a4 header.b=YdJHiUpv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B699383CDFEF; Fri, 24 Nov 2023 04:11:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229708AbjKXML1 (ORCPT + 99 others); Fri, 24 Nov 2023 07:11:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbjKXML0 (ORCPT ); Fri, 24 Nov 2023 07:11:26 -0500 Received: from mickerik.phytec.de (mickerik.phytec.de [91.26.50.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ACB318B for ; Fri, 24 Nov 2023 04:11:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; d=phytec.de; s=a4; c=relaxed/simple; q=dns/txt; i=@phytec.de; t=1700827886; x=1703419886; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ueaYiJio+rr5h9VoUpW5qtG1LvpMOX1vur0Jso/gkfY=; b=YdJHiUpvrpQRqBSnlgDhuaWdI+HaD0yE2FmihhWDZO86Dz34jKv4n2ZXU/mTbByC plqzo1dnOz7oiCdgO8eUtLi0B+AWtFC9RWdQex+NwOIyCtrSY2SuGc+TyehQ5XZF AnPAPxUDj0UmkE35MNaJSf2RXa1SPTp3g8QTjr60Www=; X-AuditID: ac14000a-fbefe7000000290d-17-656092eda846 Received: from florix.phytec.de (Unknown_Domain [172.25.0.13]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mickerik.phytec.de (PHYTEC Mail Gateway) with SMTP id C1.7D.10509.DE290656; Fri, 24 Nov 2023 13:11:25 +0100 (CET) Received: from [172.25.39.28] (172.25.0.11) by Florix.phytec.de (172.25.0.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.6; Fri, 24 Nov 2023 13:11:24 +0100 Message-ID: Date: Fri, 24 Nov 2023 13:11:24 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] iio: adc: ti_am335x_adc: Fix return value check of tiadc_request_dma() Content-Language: en-US To: Jonathan Cameron CC: , , , , , , , , , Bhavya Kapoor References: <20230925134427.214556-1-w.egorov@phytec.de> <20231005150917.2d0c833e@jic23-huawei> From: Wadim Egorov In-Reply-To: <20231005150917.2d0c833e@jic23-huawei> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [172.25.0.11] X-ClientProxiedBy: Florix.phytec.de (172.25.0.13) To Florix.phytec.de (172.25.0.13) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMIsWRmVeSWpSXmKPExsWyRpKBV/ftpIRUgwmvrCxWbn/OaPH/0WtW iwdNq5gslkyez2ox78g7FovLu+awWVx9UG7x5sdZJotZH3+wWvzfs4PdovudugO3x6ZVnWwe /d0trB5L3hxi9dh+bR6zx/Eb25k8Pm+SC2CL4rJJSc3JLEst0rdL4Mr4/OYAY8F83oodZ1qZ GxhPcHUxcnJICJhI3G9/z9jFyMUhJLCYSeJ172sWCOcuo8SjT02sIFW8AjYSWz69YQSxWQRU JX4sO8ACEReUODnzCZgtKiAvcf/WDHYQW1ggQWLWzjVsIDazgLjErSfzmUBsEQF1iWkzrjCB LGAW+MEosXjfC7CEkECixIfDc8BsNqCiOxu+gS3mFDCWmPtpDzvEIAuJxW8OQtnyEtvfzmGG 6JWXeHFpOQvEO/IS0869ZoawQyXmr/nOPoFReBaSW2chuWkWkrGzkIxdwMiyilEoNzM5O7Uo M1uvIKOyJDVZLyV1EyMo4kQYuHYw9s3xOMTIxMF4iFGCg1lJhDf3T3yqEG9KYmVValF+fFFp TmrxIUZpDhYlcd7VHcGpQgLpiSWp2ampBalFMFkmDk6pBsYtZr6rnbJ94lZ//fV+7y27qcmn 1qxdHLzAlWVb9oer2oZpCjo52qEebSFnk577BH2QD9kR26wat+NxR5+b8K6EB3kfxO7veBMr 9cu2Y972C0uteOf4ydxeMGPy+tBwrkm9mgdtths873u6vrnmvMTuST68Ntvjl2yoL92+Wsa7 vOl5Ybzcv7NKLMUZiYZazEXFiQAcMclBpgIAAA== X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 24 Nov 2023 04:11:44 -0800 (PST) Am 05.10.23 um 16:09 schrieb Jonathan Cameron: > On Mon, 25 Sep 2023 15:44:27 +0200 > Wadim Egorov wrote: > >> Fix wrong handling of a DMA request where the probing only failed >> if -EPROPE_DEFER was returned. Instead, let us fail if a non -ENODEV >> value is returned. This makes DMAs explicitly optional. Even if the >> DMA request is unsuccessfully, the ADC can still work properly. >> We do also handle the defer probe case by making use of dev_err_probe(). >> >> Fixes: f438b9da75eb ("drivers: iio: ti_am335x_adc: add dma support") >> Signed-off-by: Wadim Egorov > +CC Bhavya, > > Could you take a look at this given you had comments on v1. Bhavya, any comments on this? If not, is there anything else that is blocking this patch? Regards, Wadim > > Thanks, > > Jonathan > >> --- >> v2: >> - Update description >> - Drop line break after Fixes tag >> - Move decision about optional DMA into probe/caller >> --- >> drivers/iio/adc/ti_am335x_adc.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c >> index 8db7a01cb5fb..5f8795986995 100644 >> --- a/drivers/iio/adc/ti_am335x_adc.c >> +++ b/drivers/iio/adc/ti_am335x_adc.c >> @@ -670,8 +670,10 @@ static int tiadc_probe(struct platform_device *pdev) >> platform_set_drvdata(pdev, indio_dev); >> >> err = tiadc_request_dma(pdev, adc_dev); >> - if (err && err == -EPROBE_DEFER) >> + if (err && err != -ENODEV) { >> + dev_err_probe(&pdev->dev, err, "DMA request failed\n"); >> goto err_dma; >> + } >> >> return 0; >>