Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1612967ybf; Thu, 27 Feb 2020 14:31:26 -0800 (PST) X-Google-Smtp-Source: APXvYqzUxvy75K1XcezvupN1hdAlU4CccfAGGrDMDp0DzQarTONFy8FAPwE9mC7KkZ51ZKPCjeDN X-Received: by 2002:a05:6808:aa8:: with SMTP id r8mr936517oij.7.1582842684326; Thu, 27 Feb 2020 14:31:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582842684; cv=none; d=google.com; s=arc-20160816; b=xTfpGQ3YM5M1tHQMC1UAfUg196UFD6TqIEHCm0p+KlT2q7d5CUJrNnNUHhPyQpjWbJ 86YvmkaQtSP9Vj9ioBFXLs0aJpVecb/eu9bKtAVIBdvVf+fgeLqstWiVarsXmjAg+S7h LTrmQXrPJCRGqJOnwZ0VmxnF4856500qrJ9V6WCu3j/BHvSJtfXO3hz5yzGxx9UeXv9k pq+AbzldT1b4yBcGWf5Csf1tt09xuSv+uW2WAmyx40d/Y7T3ez0X1GEvsUMl8/Hkwkwc JlodMVFYGJBzkQee2CVrkOfcyiwL8aCqA8QAzaDBnui2D2OKxfeNUsUslt4sKQsOYGwd IUWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=dAKQtQFMwvA4in1IKX12aA2LxpzkOZ3DeV5aYoLW1Dk=; b=IMw8bBSR+hLEbI/namobvm9NnIU47oyqrKeXXjTzsJ9yqiRArsAYFj6n/wbXMdeAzG pdBbhyq20djPyiJ9FJIr7ydozi5RoTHRd+XQ5Q7mcMHJPu8oNx/tObI7p9n3ZXGo2h3S BV9FDmhyTKVoJdyJCVIGevf4hEeIv5bVBC937tonEO2nYjcLp9ElCoR8sqy9yceVNXbd hN14ug0hTGNolSoCxdPk0IXsRTeUI3wBqSWk2cCLm065W5IJRZr2pF+papmI1XzOEHuv UgysSx+K9iFMU7amPeyWhf3CKa1nWNedSmBiyKRGkFblm8PfOarst0p1XltCoZlA9DEU kkYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=a0nmU5d8; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l19si615031oii.54.2020.02.27.14.31.12; Thu, 27 Feb 2020 14:31:24 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=a0nmU5d8; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730339AbgB0W3l (ORCPT + 99 others); Thu, 27 Feb 2020 17:29:41 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45802 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729850AbgB0W3l (ORCPT ); Thu, 27 Feb 2020 17:29:41 -0500 Received: by mail-pf1-f195.google.com with SMTP id 2so569879pfg.12; Thu, 27 Feb 2020 14:29:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=dAKQtQFMwvA4in1IKX12aA2LxpzkOZ3DeV5aYoLW1Dk=; b=a0nmU5d8Fqui67x7EDMrxyRLgET/G0iEKZQ3fHRK/3Dou0wE6XBiu9qf3bM08cfP6D /qzbSszn/RqpuBqcbVC38AaKcMIxx2t+aRQ9BuilhnT+bm4NDiyniMAVGrW5xNkH2lQ3 v376HxpgeUt0aQI5qpIQU80drCyrzsf4PKMVY7JtmLHX2PfuOOkuzUbT0ODcIbO4ACFK r1D65ggKF/4q/Y77n5lN02m+1wW3RwkBkcjmYy7sSKjgDTWZMOQh41RY7Qt+eRoa1MPv f2ZBhfq6NThumXvbKk2/QKyT/YlxdBpgGA5Ms52RO1xNhHrbwdBMFxEuYjO6ZAkHkV/k 35jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=dAKQtQFMwvA4in1IKX12aA2LxpzkOZ3DeV5aYoLW1Dk=; b=oi6xq7QJGkOf2zU8pwdvRRfONMhLVf34T1z5U5eIeiuKHK2w8NVHLa1Z5YC6BG7ERF 00NfS2O5N3Sf/H9eX61UiTseD/AabG3BILmJVrJqHKpcVjKgG24st0rk9yLUFQCqxWJL k1I3Y3oeD3fF6TSZo/Ih1FCQtr6ItXpJWd5+bGnHhE2sfdgBvW2cyw7P43WTtu7Fe4wH Md4LhRlSKMqNYzxEwT2rW34mjpHz7XsAzxEKCm9s3KjzJieF0wgC9H4tdpoMSO7C5vSy hVcXswnBd9WFlZrGvqxit0400jIQXgx/LUREBZ9Gcg0Yy+wV2JGk17bkZLjjwev7/mSf EQOA== X-Gm-Message-State: APjAAAXGo29KcjjNlq3ZLYuSDjcz8vUw1jbkvf3D2k6Z3GsHbIbtuGaZ exW1bDTdJyp6vROnVG/EboY= X-Received: by 2002:a63:2c85:: with SMTP id s127mr1480287pgs.138.1582842580284; Thu, 27 Feb 2020 14:29:40 -0800 (PST) Received: from taoren-ubuntu-R90MNF91 ([2620:10d:c090:500::4:d8f5]) by smtp.gmail.com with ESMTPSA id 136sm7794224pgh.26.2020.02.27.14.29.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Feb 2020 14:29:39 -0800 (PST) Date: Thu, 27 Feb 2020 14:29:32 -0800 From: Tao Ren To: Benjamin Herrenschmidt Cc: Felipe Balbi , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , Chunfeng Yun , Colin Ian King , Stephen Boyd , Rob Herring , Mark Rutland , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, taoren@fb.com Subject: Re: [PATCH v4 2/7] usb: gadget: aspeed: read vhub properties from device tree Message-ID: <20200227222931.GA29420@taoren-ubuntu-R90MNF91> References: <20200226230346.672-1-rentao.bupt@gmail.com> <20200226230346.672-3-rentao.bupt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ben, On Thu, Feb 27, 2020 at 03:09:01PM +1100, Benjamin Herrenschmidt wrote: > On Wed, 2020-02-26 at 15:03 -0800, rentao.bupt@gmail.com wrote: > > From: Tao Ren > > > > The patch introduces 2 DT properties ("aspeed,vhub-downstream-ports" and > > "aspeed,vhub-generic-endpoints") which replaces hardcoded port/endpoint > > number. It is to make it more convenient to add support for newer vhub > > revisions with different number of ports and endpoints. > > > > Signed-off-by: Tao Ren > > Reviewed-by: Joel Stanley > > With one minor nit that can be addressed in a subsequent patch (see > below) > > Acked-by: Benjamin Herrenschmidt Thanks for the help on the patch series. > > - if (istat & VHUB_IRQ_DEVICE3) > > - ast_vhub_dev_irq(&vhub->ports[2].dev); > > - if (istat & VHUB_IRQ_DEVICE4) > > - ast_vhub_dev_irq(&vhub->ports[3].dev); > > - if (istat & VHUB_IRQ_DEVICE5) > > - ast_vhub_dev_irq(&vhub->ports[4].dev); > > + for (i = 0; i < vhub->max_ports; i++) { > > + u32 dev_mask = VHUB_IRQ_DEVICE1 << i; > > + > > + if (istat & dev_mask) > > + ast_vhub_dev_irq(&vhub->ports[i].dev); > > } > > The 2400 and 2500 have very slow cores and every cycle counts in that > interrupt handler from my experience. I would sugggest you generate a > "mask" of all the device interrupts for enabled ports in struct vhub > and AND istat with that mask before going through the loop. Either that > or use find_next_zero_bit... > > I wouldn't gate merging this patch on this, it can be a subsequent > refinement. Got it. I will take care of the improvement in a follow-up patch. Cheers, Tao