Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp488133ybl; Fri, 23 Aug 2019 04:03:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOBzLRrsh59QqmCMzbOBhEBg5LwYpSVdSkqQkS5cpFKru8L2BCmz24MmZoJE3lJhg8J7JN X-Received: by 2002:a65:6152:: with SMTP id o18mr3309323pgv.279.1566558208380; Fri, 23 Aug 2019 04:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566558208; cv=none; d=google.com; s=arc-20160816; b=dStu6Cd+YMEOmTvlZPXdV/QJJloB2ZV9LEuVxEZx42R0/bP+CD5YDbCQr4W4dVkTXv 5M4clDHR1Uhke102RuG9c9dStMp4BNudedZHBjzYRwrUNSkDBoRs1fslWNTgHQoRg1rV P9eOVZL8VRZwDhdhcPt1LXs/1c5R/A/yy6NxL/EkBq3A9BUIKIVa4TsYbZS948xBe7fG 2gfSAoUtXQEqat10RFm6hgVcxcPZXFsR+4U7fBCXiATpbAcY0ZAU+Cknr3q3QDqmvZ+v RAZOnEVlFM+W+zlPwVyTxGDY9kNRLrfyEqO992NBaEgTFRRr3Ve1+3cNgrkCXDbmq6sF NhxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=AygYke9eev/ace09mklN8ehfRR+GaHjHMEoeOSlv2ko=; b=tF5v2OW+oq3OyTfYVUxGJQ+jbJiiV4d5YW3AhOOCakdjk109Sd9RMXWRdEEd9OtpiP DaZmFhqWmiSyBIaIWlYQrQFV8U/xMkTn2sbmc8IYLXPYb4hvtEMW8e+97hGHesMMQloi 42Tp4B9lq1YH+S/jHglI6o2ebqfao07L0HRIOlEhrywCY3SyexOmcUwEGOmtKMVbb/lK had6KnOUkFtxlGRvoTbeKKOp6264I54V0o0/GHpsHiSS2blRoqB1SCnMi/Z6tyTzbNpA YYI61MBF0ouXJLpxYG1m57Z27YdrD/gTZFl2CpReV9aNtOMR2m71WgVC6BwxAdrxpRxV Ho6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=RuDlomvH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x19si1976576pjn.35.2019.08.23.04.03.11; Fri, 23 Aug 2019 04:03:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=RuDlomvH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393229AbfHWIx0 (ORCPT + 99 others); Fri, 23 Aug 2019 04:53:26 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:53572 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389120AbfHWIx0 (ORCPT ); Fri, 23 Aug 2019 04:53:26 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x7N8rL2n039346; Fri, 23 Aug 2019 03:53:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1566550401; bh=AygYke9eev/ace09mklN8ehfRR+GaHjHMEoeOSlv2ko=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=RuDlomvHA+ozFBm2seWvqjWHsD4d5bUc8SLiA3BbFf31RdvtoNgulPq4c/Hy6faz8 gWSFWMsgTBvBYyRe+Qzd1l92xIRKzwbVpP2r7ViAAkjvDlrjhus7mpEUfE9HT8O8Ry dfT0y1b+FY5K0YOhYcWyODGZ1n3qnHyy4JSuDC3s= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x7N8rLhh112033 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 23 Aug 2019 03:53:21 -0500 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 23 Aug 2019 03:53:21 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 23 Aug 2019 03:53:21 -0500 Received: from [172.24.145.136] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x7N8rGdo010932; Fri, 23 Aug 2019 03:53:16 -0500 Subject: Re: [PATCH v10 5/6] usb:cdns3 Add Cadence USB3 DRD Driver To: Pawel Laszczak , CC: , , , , , , , , , , References: <1563733939-21214-1-git-send-email-pawell@cadence.com> <1563733939-21214-6-git-send-email-pawell@cadence.com> From: Vignesh Raghavendra Message-ID: Date: Fri, 23 Aug 2019 14:23:55 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1563733939-21214-6-git-send-email-pawell@cadence.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 22/07/19 12:02 AM, Pawel Laszczak wrote: > + > +/** > + * cdns3_req_ep0_get_status - Handling of GET_STATUS standard USB request > + * @priv_dev: extended gadget object > + * @ctrl_req: pointer to received setup packet > + * > + * Returns 0 if success, error code on error > + */ > +static int cdns3_req_ep0_get_status(struct cdns3_device *priv_dev, > + struct usb_ctrlrequest *ctrl) > +{ > + __le16 *response_pkt; > + u16 usb_status = 0; > + u32 recip; > + u32 reg; > + > + recip = ctrl->bRequestType & USB_RECIP_MASK; > + > + switch (recip) { > + case USB_RECIP_DEVICE: > + /* self powered */ > + if (priv_dev->is_selfpowered) > + usb_status = BIT(USB_DEVICE_SELF_POWERED); > + > + if (priv_dev->wake_up_flag) > + usb_status |= BIT(USB_DEVICE_REMOTE_WAKEUP); > + > + if (priv_dev->gadget.speed != USB_SPEED_SUPER) > + break; > + > + reg = readl(&priv_dev->regs->usb_sts); I see usb_sts is read, but never used in this function? > + > + if (priv_dev->u1_allowed) > + usb_status |= BIT(USB_DEV_STAT_U1_ENABLED); > + > + if (priv_dev->u2_allowed) > + usb_status |= BIT(USB_DEV_STAT_U2_ENABLED); > + > + break; > + case USB_RECIP_INTERFACE: > + return cdns3_ep0_delegate_req(priv_dev, ctrl); > + case USB_RECIP_ENDPOINT: > + /* check if endpoint is stalled */ > + cdns3_select_ep(priv_dev, ctrl->wIndex); > + if (EP_STS_STALL(readl(&priv_dev->regs->ep_sts))) > + usb_status = BIT(USB_ENDPOINT_HALT); > + break; > + default: > + return -EINVAL; > + } > + > + response_pkt = (__le16 *)priv_dev->setup_buf; > + *response_pkt = cpu_to_le16(usb_status); > + > + cdns3_ep0_run_transfer(priv_dev, priv_dev->setup_dma, > + sizeof(*response_pkt), 1, 0); > + return 0; > +} > + -- Regards Vignesh