Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1177945lqt; Sat, 20 Apr 2024 04:14:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUk3moUz0A0nUX8u1SLQrfv2q+FqyDHvi/6j3AdVB/4hegLq4Us+7NJTY5XGjB4nJk39HMh0mrywrb/25+1wzr9b44q1OxJOzrkVeqcWw== X-Google-Smtp-Source: AGHT+IEV2Y1oIxszpMs743gkURlHlDjycWTJtaFjHKhzjf7ZGMyLRRRlRXYfPrdGYwkSvIEumXhr X-Received: by 2002:ad4:424d:0:b0:6a0:4fda:af51 with SMTP id l13-20020ad4424d000000b006a04fdaaf51mr5258793qvq.37.1713611645865; Sat, 20 Apr 2024 04:14:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713611645; cv=pass; d=google.com; s=arc-20160816; b=usMt9vCnSCbw+MTvBsD74HyfCG1iv8yKRR3VuLhDwoqfWW51ZVeXPOZOUS3Yn5IbU3 IACLxMpmJqIeQ0AilyppN1TlTQioysaqI20wEKDMgWn38/ZzYxFSgPvjUO0mqKzm57Ph Kq0jdRVt0ExCDpMiwbQ9R6RdkvxjU51KUmkwfGJLKEz15/vcngjwa4thEzNAEsgEajFh NQsQrkOhdU3Wh5yuVF6whM3KHT7ZfIP7lAN9hi7ZcjENajmZR0KW5v51m+JDMkbKIrNp dUMT+j0wfRfhqSd1KzQGUwi8HP3LURSUq4IMjrHoQx0bJ74d6tt56EP+SkEng1rFWJap G7KQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=RpaCBLRwVUaHxyixxxO4YLcvdiQBR/wSVK4Af+7Ypjo=; fh=x0AI9Hyjruznt0fUAc0WB51HNFserLNLuqVc+2GUFHY=; b=rLQWgO7SYrheRCgsQzZnDtX7yZzh2wctViYIlaYHBlDfpyyMXncem0vW+MfoDjPXyY RZ+XuW1RmEp7S5HGDehYhcB7lzCzw3tKTQAf+/kaMvrJ5NrduCowALQXR2JdBi67hHGP JqQ2ZXMte/UqEOXz3hn5HERknQ5i1G4Al9jyEMN3dqvJjj5B2HSKNP925niSIx04dzX9 n2mXqVLvb6kX/ZavCh6S+a8w/GZCPyWpbZk3BDDuCcU2EGVOmEAE7D95XMtUQnm0e0/Z rox/6IWdaLdhomrZzLiis3vj4M/BKmQ/mrIfvdmQfkxjy535kUELUjA7jf1Vp8qY8Tnn r2jg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NhuiMAie; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-bluetooth+bounces-3798-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3798-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 11-20020a0562140ccb00b0069b7cfcadeesi6149110qvx.563.2024.04.20.04.14.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Apr 2024 04:14:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-3798-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NhuiMAie; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-bluetooth+bounces-3798-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3798-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 51A251C20CB3 for ; Sat, 20 Apr 2024 11:14:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A7231C294; Sat, 20 Apr 2024 11:14:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NhuiMAie" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D4A52563 for ; Sat, 20 Apr 2024 11:14:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713611642; cv=none; b=T8xyRosjlE3NCCGOh0PZLOsMWu++1uBMw96mIE1CZZWGoeyhASl3pb7+udEFhB+7asVMfjRIyT6/X92t5jOz/tSA9Zs0NdlGFlpAE+5rSb19IIrLWOx1I8n50o4FAWXN5Ysn3TR0Wy7Rd7QUlpMohCOmBAXPHS8aKEiyeoFdclE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713611642; c=relaxed/simple; bh=RppZEGV/ccSUfwt8cxXV9ey8UXG91HSJotMChd5giyY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LPee0tHgdO9NvRJAXTsHHNLXxCCCLm9TZYqSxJ8EowqaqkDr9BZrsFAWKHS+OyhknSL+hUMdJWyci/iKPfMc9L2p3xcwzkD8nr8QgVvBDOLmyvyzZWi2tOcuJiWcYC8I0PfpMRuJmNxaBpkpAS4C88ROi6cBzu8ERWc+pPU71/0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=NhuiMAie; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-344047ac7e4so2339638f8f.0 for ; Sat, 20 Apr 2024 04:14:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713611639; x=1714216439; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=RpaCBLRwVUaHxyixxxO4YLcvdiQBR/wSVK4Af+7Ypjo=; b=NhuiMAie14eGocopTv9uosSsS6GqAm/62qPnctglJede9cTZmMT0Mmu/GFZkRXINwE WjfSaLs46PkIyGozgswdFrv0HmL9gGIGUuq0mXsJMlUM7Jh9T+ljthoM2NjLe885x86M oSoI4tD9xUYY/q27rP9adHNTaEJErWiIC+R2ywze7Cz/cxjt92EkruCpdlMeC51OZ8+E OHk70RwQ3ojPRbgxrkKrzV6Ax0XcS6RQX561UI+25nP7BDHGnaatx4JICa5K4PyWSDi4 b4O1rd2JhYdCoT5w/dzSi7o3uO5E0XYcFbtFEZ9hRyk+hK3LKw6sSD5n3bsmlVSrJtDp P/5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713611639; x=1714216439; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RpaCBLRwVUaHxyixxxO4YLcvdiQBR/wSVK4Af+7Ypjo=; b=rR1GXpEq4fLSJZKcb0uMFmGgHn2KhG6tJNzY9PL5I9CBdSjVn45iweKIlJC8MQsK5m rE3xsda+blZVkI/fEEWZmRrc6dDbwt2TuF3ce94m36vmKDD8yLSR6Ebx4vvyNUWt1zTZ /Ku/L2i46s3NXGngPtfeVCXHhrKeMTkc8+cHrTYPovz43nWzfoAvsvUHrqoq5VCs5c7B mpi0hVc/XugBeM+uUsuQxMKcntG6TAb8DXqVoiz7hESXnesqu+7qR389Y/UHFl3weXs5 G6VZHdUrhHYPlw1DgRkdvdqCmybISGZ5vhX2bf05DFGFdp2VFF48md+XC1BQBWjt/q75 OzCg== X-Gm-Message-State: AOJu0YwRfnb8OJI8MXoWoCi5LI2XBq6WqBRNtknClmq6G7W8mupO6sma DrwskzoW228TJ0WXZFOdu54rkCXT1LxidMKHSmQqlp73DwIZ5X3Kgw6IyPQN9Qw= X-Received: by 2002:adf:f68c:0:b0:341:b5ca:9e9c with SMTP id v12-20020adff68c000000b00341b5ca9e9cmr3170711wrp.25.1713611639262; Sat, 20 Apr 2024 04:13:59 -0700 (PDT) Received: from [10.236.36.88] ([88.128.88.151]) by smtp.gmail.com with ESMTPSA id bf7-20020a0560001cc700b003439d2a5f99sm6632775wrb.55.2024.04.20.04.13.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 20 Apr 2024 04:13:58 -0700 (PDT) Message-ID: <2166fc66-9340-4e8c-8662-17a19a7d8ce6@linaro.org> Date: Sat, 20 Apr 2024 13:13:57 +0200 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/2] Revert "Bluetooth: hci_qca: don't use IS_ERR_OR_NULL() with gpiod_get_optional()" To: quic_zijuhu , luiz.dentz@gmail.com, luiz.von.dentz@intel.com, marcel@holtmann.org Cc: linux-bluetooth@vger.kernel.org, wt@penguintechs.org, bartosz.golaszewski@linaro.org References: <1713449192-25926-1-git-send-email-quic_zijuhu@quicinc.com> <1713449192-25926-2-git-send-email-quic_zijuhu@quicinc.com> <83a1c837-e403-4da2-83c6-ee3dedbc1fe0@linaro.org> <7c5b85ca-e897-4798-97e7-955478c57d12@quicinc.com> <52394d97-04c3-4f77-aaae-f1e152cd5632@linaro.org> <0dca7c9b-6a97-4171-9b0c-5b806a4e8a60@quicinc.com> <4e4d8ee0-fbbe-4dc7-b40b-b983f9f39539@linaro.org> <01677a26-ea91-47cc-bdc4-283cf313d8e4@quicinc.com> Content-Language: en-US From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA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tHAcUF35hSJrvMJzPT/+u /oVmYDFZkbLlqs2XpWaVCo2jv8+iHxZZ9FL7F6AHFzqEFdqGnJQqmEApiRqH6b4jRBOgJ+cY qc+rJggwMQcJL9F+oDm3wX47nr6jIsEB5ZftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <01677a26-ea91-47cc-bdc4-283cf313d8e4@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 20/04/2024 07:25, quic_zijuhu wrote: > On 4/19/2024 9:49 PM, Krzysztof Kozlowski wrote: > > Hi Krzysztof,bartosz, > > let me summarize our discussion here in order to reduce unneccessary > disagreements here. > > 1) i only revert your change IS_ERR() to my change IS_ERR_OR_NULL. > > 2) your change will cause serious regression issues for many lunched > products Instead of repeating every time "serious regression" can you actually explain the problem? None of commit messages from v3 help there. > > 3) we only need to discuss how to handle devm_gpiod_get_optional(..., > "enable", ...) returning NULL since this is only difference between your > change and mine. > > 4) your change doesn't solve any actual issue and the reason you > submitted is that "The optional variants for the gpiod_get() family of > functions return NULL if the GPIO in question is not associated with > this device, and should not treat it as error". > > code applet of your merged change is shown by below link > https://patchwork.kernel.org/project/bluetooth/patch/20240208164017.26699-1-brgl@bgdev.pl/#25705104 > > qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable", > GPIOD_OUT_LOW); > - if (IS_ERR_OR_NULL(qcadev->bt_en)) { > + if (IS_ERR(qcadev->bt_en)) { > dev_warn(&serdev->dev, "failed to acquire enable gpio\n"); > power_ctrl_enabled = false; > } > > 5) Original BT driver design agree with your point mentioned at 4), so > for case "qcadev->bt_en == nullptr", qca_serdev_probe() don't do error > return for this scenario and use dev_warn() instead of dev_err() to give > user prompt. > > 6) your wrong fix changes flag power_ctrl_enabled set logic and will > cause serious BT regression issue, hope you will realize this point. Sorry, not realized and you did not explain it. Neither above nor in commit msg. > > > i would like to give below extra comments even if these comments are > irrelevant to the critical point of this issue mentioned at above 3) > > A) you need to investigate it is a) the prompting approach or message > error or b) the if condition error even if if dev_err() is used to give > prompt instead of dev_warn() in above 4). What? > > B) don't talk about how about devm_gpiod_get_optional() returning error > case since it is meaningless as explained by above 3). also don't > require a fix to fix another unreported issue. a fix is a good fix > if it fix the issue in question and don't introduce new issue. What? > > C) per DTS property enable-gpios of BT, different soc types have > different requirements, many are required and another many are NOT > mandatory as shown be below link. > https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/tree/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml. > > for a soc type which are attached to 3rd platform, customer doesn't > would like to or are not able to congfig BT reset pin within DTS for QCA > driver even if QC strongly suggest customer config it and also be marked > as required within above DTS bindings spec link. i often meet this > scenario. there are many of such lunched products. So where is it documented? Where is it explained? Which binding or which commit msg? > > i will try to fix this issue due your change product by product in new > patch thread based on this DTS comment. > > D) you maybe ping me offline about this issue if you are a member of QC > since you known "go/upstream" Please keep all discussions public, unless your customer requires some sort of confidentiality. Although even then I would argue that you can hide company secrets and discuss about hardware. Best regards, Krzysztof