Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp225030lqs; Mon, 4 Mar 2024 23:09:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVnl/rHRHkXQwt4NX8XnvOWFbxP9R9IZ3RacvrCNNAy1ki6UbscYJMvmhAC0rpleAVl2aE9Pcbci/EOA45H8Pr0vthwMkbWqwaHAcZM5w== X-Google-Smtp-Source: AGHT+IHwgV5J49S1AbxAcBxSaQZKuceGocOO4heQjgc/5TEPe+QvtK3gBQJdfh+JAccnLauW3J3c X-Received: by 2002:a0c:e845:0:b0:690:765c:70c0 with SMTP id l5-20020a0ce845000000b00690765c70c0mr1492415qvo.51.1709622576583; Mon, 04 Mar 2024 23:09:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709622576; cv=pass; d=google.com; s=arc-20160816; b=Bm/ak8G1GcE+TDaXZktiBZfdrv+1Ug4RysHR9dMiQPq8cGmPbNMBe3XIyePV2ydegG ZvFoCuanAX/w6v5bb3iJizwwx207+7P5wYWfuu/PDkNtGU7fMVqd7BMdM5dRtb424cu/ 16VfXU+fWSuYqMAy8b67bACwEXfggcjCAPeNTQQQ+IbR9liKfoA39/9owZ/0gBs/0LmP pXENk0+xQrZCHVH5z6TP74GJkT1P1SKmeyv/CSPCxkKoPDyoKb1g8GVwbbrWyFFeZ/jw qLGAcLrVgjiFprpX1IkdP1+eaYgqKMWeWGQ0qlwQ34Yy5yqxuyEPXVGfciZ2PXgiBWV3 rcXA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZIiaUEHSM9FKPNS4uuGiYVBUXfnYrsTmi09x+XeF/P8=; fh=LeuKSDEr3QrwOV2ezzARSMGEeiNQz2bZ1B+6FlOovTw=; b=BeUX2oVjV+BLV+NgVtoOqAta3gEX3aM7GM1JgdvR7cA9n0eP5NaKg2QB8vc1rGQ2YM Kx5njmdRz5jJbCoy6M0gDYruWa3G3tjx8PTwWxPdjWaHEIrTuJYhFvm7/T8047U1FTS9 EnPRLzIFXsNWI5CGiiDoqdpgMjpoEQS4+8SxfEXzlcslzhIIaGsCi+5uMNq54wZ0w9x7 6dVoxqBrqap8waACmNvLAclzhSvCWUCJt/Z9ZgZE6UbCUuFseaHrmKD/O34AVz8Z/jvf lJdDX40PtCdWwE8fkcYURnKDXOOdmim3+Hn0Ya/VE81n6tWwCLVUmDk2G27wyLbIJn+k g4iQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VZZKx7aq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-91766-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91766-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h7-20020a0562140da700b0068f30e856fdsi11489585qvh.452.2024.03.04.23.09.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 23:09:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91766-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=@kernel.org header.s=k20201202 header.b=VZZKx7aq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-91766-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91766-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 49F5B1C21D92 for ; Tue, 5 Mar 2024 07:09:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C37F17D41C; Tue, 5 Mar 2024 07:09:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VZZKx7aq" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E37D845005; Tue, 5 Mar 2024 07:09:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709622565; cv=none; b=gOzRmBZ7raIUvDMsBPGRspOmtZMeaISA6F8CWsaHj++liyY0nmAjKbnT2Kcdznz3LKV32UMTVG4+/rg7/SVAzDQczMRLwVY/YwFQvPKOtHdf94QH5HjDr3Uj/G7aSqJh57CE98zlXrwR50VzS9DUnx7hke7wB6C6qaERastk/YU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709622565; c=relaxed/simple; bh=iLJtfJRG3AykwJvs44aX4uKsd63Qlq1YiC9OCMcC31U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fOsAmeABDx/TZ9DfbtNODYS0Un2SuLv+rOvc80l/b696z3jk+HiI+HxtcVOQNHlO8/AOjb7p56Lmhu8bgX9FcQwrZabBaqxEbxRMx/6GtpC7ZBEMLRk94GPeJYh1IWRU2gfl8qsyjDy51B1E5TGaC3x1cA14JtmZSA1BcB9GIYw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VZZKx7aq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2FF9C433F1; Tue, 5 Mar 2024 07:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709622564; bh=iLJtfJRG3AykwJvs44aX4uKsd63Qlq1YiC9OCMcC31U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VZZKx7aqHcP6Ly6lUphCoXqjWxAvksTF4ak3Y8fCg05LhRVZROMttCjmSkrJcPcnJ okAGM0RW/vHxwON1IvSMvVooywP0aEW/hsroPF4j6lU3rps8BnLdky865zVkUtzR5t QrVzxGgVK9ZQotLuqbUiFf69AvuQBaFj4NmeQdfLi8nEZkOH7UQS9EFNia1cA2FCpK uZca0/iiOLhTvkxsdGHf5B7BA1UAE6Vu5YEemVMlLa72Lb1U959dPH1lpuRdX6i2Ta JPKXxsTxF9ua9qzQ5Mb4qhJrJ2TEH9H5uEC5JHX/BRYvIYz7klwHNcIggsxcLO78y9 afRcy0E/4hghA== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rhOva-000000002G7-0EMj; Tue, 05 Mar 2024 08:09:30 +0100 Date: Tue, 5 Mar 2024 08:09:30 +0100 From: Johan Hovold To: Krishna Kurapati Cc: Bjorn Andersson , Wesley Cheng , Konrad Dybcio , Greg Kroah-Hartman , Thinh Nguyen , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, quic_ppratap@quicinc.com, quic_jackp@quicinc.com Subject: Re: [PATCH] usb: dwc3: qcom: Remove ACPI support from glue driver Message-ID: References: <20240305042143.3455101-1-quic_kriskura@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240305042143.3455101-1-quic_kriskura@quicinc.com> On Tue, Mar 05, 2024 at 09:51:43AM +0530, Krishna Kurapati wrote: > Minimal ACPI support was added to the Qualcomm DWC3 glue driver in order to > enable USB on SDM850 and SC8180X compute platforms. The support is still > functional, but unnoticed regressions in other drivers indicates that no > one actually booting any of platforms dependent on this implementation. > > The functionality provides is the bare minimum and is not expected to aid > in the effort of bringing full ACPI support to the driver in the future. > > Remove the ACPI code from the Qualcomm DWC3 glue driver to aid in the > implementation of improvements that are actually used like multiport and > flattening device tree. With a simple lookup function that returns the ACPI index based on name this shouldn't be required to add multiport support even if it may simplify it slightly. But IIRC it would help more with the devicetree binding rework. > Commit message by Bjorn Andersson. > > Signed-off-by: Krishna Kurapati > --- > drivers/usb/dwc3/dwc3-qcom.c | 273 ++--------------------------------- > 1 file changed, 11 insertions(+), 262 deletions(-) You should update the Kconfig entry for USB_DWC3_QCOM as well and drop the ACPI dependency. > static int dwc3_qcom_probe(struct platform_device *pdev) > { > struct device_node *np = pdev->dev.of_node; > struct device *dev = &pdev->dev; > struct dwc3_qcom *qcom; > struct resource *res, *parent_res = NULL; You should drop parent_res as well. > - struct resource local_res; > int ret, i; > bool ignore_pipe_clk; > bool wakeup_source; > @@ -825,14 +659,6 @@ static int dwc3_qcom_probe(struct platform_device *pdev) > platform_set_drvdata(pdev, qcom); > qcom->dev = &pdev->dev; > > - if (has_acpi_companion(dev)) { > - qcom->acpi_pdata = acpi_device_get_match_data(dev); > - if (!qcom->acpi_pdata) { > - dev_err(&pdev->dev, "no supporting ACPI device data\n"); > - return -EINVAL; > - } > - } > - > qcom->resets = devm_reset_control_array_get_optional_exclusive(dev); > if (IS_ERR(qcom->resets)) { > return dev_err_probe(&pdev->dev, PTR_ERR(qcom->resets), > @@ -860,41 +686,18 @@ static int dwc3_qcom_probe(struct platform_device *pdev) > } > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - > - if (np) { > - parent_res = res; > - } else { > - memcpy(&local_res, res, sizeof(struct resource)); > - parent_res = &local_res; > - > - parent_res->start = res->start + > - qcom->acpi_pdata->qscratch_base_offset; > - parent_res->end = parent_res->start + > - qcom->acpi_pdata->qscratch_base_size; > - > - if (qcom->acpi_pdata->is_urs) { > - qcom->urs_usb = dwc3_qcom_create_urs_usb_platdev(dev); > - if (IS_ERR_OR_NULL(qcom->urs_usb)) { > - dev_err(dev, "failed to create URS USB platdev\n"); > - if (!qcom->urs_usb) > - ret = -ENODEV; > - else > - ret = PTR_ERR(qcom->urs_usb); > - goto clk_disable; > - } > - } > - } > + parent_res = res; > > qcom->qscratch_base = devm_ioremap_resource(dev, parent_res); And just use res here. > if (IS_ERR(qcom->qscratch_base)) { > ret = PTR_ERR(qcom->qscratch_base); > - goto free_urs; > + goto clk_disable; > } Looks good to me otherwise. Johan