Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp292465rdb; Wed, 14 Feb 2024 23:23:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWTupjD41joxgIQKhlbjtjJFcyeDon1sKa+dutDqtGuYW3RP7vOlay4L6wQ0XUoA5xy/8fs91iYOwY4laQ2cE4RRM3zI4AwAIbqa14Gbg== X-Google-Smtp-Source: AGHT+IGtNS2da2qeHv8jAEZuPoTz5I5YE0YBqZYavpiHorrNbm0X/j9cfhn2sFsKXrepV+0CrhOF X-Received: by 2002:a17:907:78c2:b0:a3d:385:1628 with SMTP id kv2-20020a17090778c200b00a3d03851628mr726637ejc.6.1707981814975; Wed, 14 Feb 2024 23:23:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707981814; cv=pass; d=google.com; s=arc-20160816; b=EgffxmMz1WkCp046RA0cFGiSy6OX9zsoVAWd8RadrbUf53Zd1OnSpw6EryyYc0rMYG Khf7/fnSiKOrZyoUV8FC0sSHUHoc1xUfuIxjIXWES/oZT5E2M8UpkpAH/UbVfXUNk8hJ FJkvuHjffVF0f89y7p9yPEevOnu1XKegY1HxDoJeEGyQj+pdhq3hYoDNB50LHOn4TcsY +XoJ5rlysCnQt+T6nsUoRO2Wb8hlwnjxiBYjaB8jsI2DGi2KnC/6jfQwNwoHI1d820wR Lnw+MiTofdiZeOgmpH+LWQEw+hlphGvj5x1lS7Jf4aCHSIXAoZdhqWaV2cbLYLwF3TaD 32GQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=PFDI5zvSSHcDcVhJNLCYDgkFu7wOot39cQZLDsl+1pM=; fh=PodzJodZ5C01nmc0UwBQKpA16Kh2K4W9owyUhlDQqNE=; b=KK3oYU23b6tKBaxh0Hu2tqxW3Wp6HANp2mRVTZhme67FF0azHDiPRKewlAFmCfn9KL B4iOhtov9zx95MGfqqn41opkTKaKT84WtlrNhwKmOtWr+erF8PyAC0qaKfBVipvRnCEB Qtx3ME7ob2BylGlBPU8tYfGMxrxAF+LjT67kNSI6sg7cAVYWSCewIjb3BMu/4xhV+pBc yR4r6dsfvv90y/hLZBn70gf1UutNrE+3PP38dRVm9+yPVYrIk/jAt812L0yQgnCUSPoJ HPO5VRfQB0Kt+sBnlNL1cfYcwzHq2JFHa692t5UYTn+jM4E3QiloCZMmxqwDL/ElieyR aYWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EWC2P15Y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66355-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66355-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id re10-20020a170906d8ca00b00a3d55ae9e24si372837ejb.998.2024.02.14.23.23.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 23:23:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66355-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EWC2P15Y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66355-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66355-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 85E0A1F22C3D for ; Thu, 15 Feb 2024 07:22:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F747DF5C; Thu, 15 Feb 2024 07:21:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EWC2P15Y" 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 AB1DF33CF; Thu, 15 Feb 2024 07:21:48 +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=1707981708; cv=none; b=iUvqiuqyowXMmuWcUfVZu5rh3PxRRSnHFsppPiKaJLdus//8RoEeGIkJpmP2WskUo32pZJ34VJ52i+F5BSPE8TsbRGL1x54yRYKXiMsGEb3dk7Q0Cocy6P3xYe07k0BLCjJwRluU62Eco0z91Te/YJSREoC7S6h+mf3NTWFjFeY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707981708; c=relaxed/simple; bh=QKpRsp1RwTdcyAJM3bUrM0Ffhxf1+M/TAhIk32zyMRs=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=ux2qRhWvPiB9bNnb/bj64RRwjJpYP7KWGzmCb+Ju4AeEyiOVnnGEZa6uStVE3/w2OjLWZkPz9bkXjl6JjNruqCUpCA5s+gHmMPohryqoohrkjCOiD+KX9hgN/ccPBA8TZSUqy86wQQabOp8E09yR1RJBbYRXkR97br75ynMjGF4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EWC2P15Y; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58A8FC433C7; Thu, 15 Feb 2024 07:21:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707981708; bh=QKpRsp1RwTdcyAJM3bUrM0Ffhxf1+M/TAhIk32zyMRs=; h=Date:From:To:Cc:Subject:From; b=EWC2P15Y1fQ/JTT9auxop0Kb73/apngE0JaFj/x3RqcAuswivKAAwWZh0c+k8GEaL MDaLwYzPVWGAcRbTMl3xqgqbUA2g2haC1rakhO8FrvgC506xbADeAa4pE7/wBGsKzV 9k8Yjm4mv0rU6k/vC78rvWzcRYbFDjO23Y2orx4//6oAyA0SRKzNo40npD7IT3lpiO G/ed52SdH5tpcaOPiki5obe+Y7HYTZnTnKmc7nuL6cVP7B4DFvzc3HBPYAH5etQwyu qRZUQIUau2QWQm0cTOLFzl0lr2tEs3MN4y2ykE/6wi4Ow+WIDnT1DGvwR/xgCnEMCQ 7augH/wyW7Ugg== Date: Thu, 15 Feb 2024 15:21:38 +0800 From: Peter Chen To: Pawel Laszczak Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, peter.chen@cixtech.com, stable@vger.kernel.org Subject: Re: [PATCH] usb: cdnsp: blocked some cdns3 specific code Message-ID: <20240215072138.GB1256251@nchen-desktop> 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 It is for both cdns3 and cdnsp. Reply-To: In-Reply-To: <20240206104018.48272-1-pawell@cadence.com> On 24-02-06 11:40:18, Pawel Laszczak wrote: > host.c file has some parts of code that were introduced for CDNS3 driver > and should not be used with CDNSP driver. > This patch blocks using these parts of codes by CDNSP driver. > These elements include: > - xhci_plat_cdns3_xhci object > - cdns3 specific XECP_PORT_CAP_REG register > - cdns3 specific XECP_AUX_CTRL_REG1 register > > cc: > Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") > Signed-off-by: Pawel Laszczak > --- > drivers/usb/cdns3/host.c | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/cdns3/host.c b/drivers/usb/cdns3/host.c > index 6164fc4c96a4..ceca4d839dfd 100644 > --- a/drivers/usb/cdns3/host.c > +++ b/drivers/usb/cdns3/host.c > @@ -18,6 +18,11 @@ > #include "../host/xhci.h" > #include "../host/xhci-plat.h" > > +/* > + * The XECP_PORT_CAP_REG and XECP_AUX_CTRL_REG1 exist only > + * in Cadence USB3 dual-role controller, so it can't be used > + * with Cadence CDNSP dual-role controller. > + */ > #define XECP_PORT_CAP_REG 0x8000 > #define XECP_AUX_CTRL_REG1 0x8120 > > @@ -57,6 +62,8 @@ static const struct xhci_plat_priv xhci_plat_cdns3_xhci = { > .resume_quirk = xhci_cdns3_resume_quirk, > }; > > +static const struct xhci_plat_priv xhci_plat_cdnsp_xhci; > + > static int __cdns_host_init(struct cdns *cdns) > { > struct platform_device *xhci; > @@ -81,8 +88,13 @@ static int __cdns_host_init(struct cdns *cdns) > goto err1; > } > > - cdns->xhci_plat_data = kmemdup(&xhci_plat_cdns3_xhci, > - sizeof(struct xhci_plat_priv), GFP_KERNEL); > + if (cdns->version < CDNSP_CONTROLLER_V2) > + cdns->xhci_plat_data = kmemdup(&xhci_plat_cdns3_xhci, > + sizeof(struct xhci_plat_priv), GFP_KERNEL); > + else > + cdns->xhci_plat_data = kmemdup(&xhci_plat_cdnsp_xhci, > + sizeof(struct xhci_plat_priv), GFP_KERNEL); > + You may explain why you duplicate another structure for cdnsp at commit log. > if (!cdns->xhci_plat_data) { > ret = -ENOMEM; > goto err1; > Others are okay for me. -- Thanks, Peter Chen