Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1969833ybl; Thu, 30 Jan 2020 09:08:51 -0800 (PST) X-Google-Smtp-Source: APXvYqyjWkNuKY5DZ2ysYsAY46bZFW+QQhjE2aTTQ9P/ybmbgKsVIaUsuzKAAhH5Haz8O2VgZsOS X-Received: by 2002:a05:6830:1042:: with SMTP id b2mr4251840otp.306.1580404131104; Thu, 30 Jan 2020 09:08:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580404131; cv=none; d=google.com; s=arc-20160816; b=snb1Tms/e3l/mcD0VZcV9ug7UN8QU5a3sDT4UksXLBZLXQogHZe5w0lezhA/l5/7uU YIV0RWm4709fYlrPvpOM0HbOdKZRSHzA5dFG8RKOK02uNG/rT8bko2Ql/sYuKLnmX8VD bNUfU8j81hSg+33t6rMjiQjKrYfsT4jVQ7WBR42nveUSQoBL+HMCYWs0ls3TPMyQnVeZ rtLv9V0YJoMQ/1HdO+VhbymDDvHW0ndKchoh0I324wUUm2+Qe40v01AosTdg57SXKPt2 ctXOlkiGv6DbpS+yJboR1UDNwaW4xKO8oXZeZIglVaX1Z29HhUZdY3dj/b7+WuNlHPKS DILw== 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; bh=095MdZOln6jxq5TT7zUNzrEma/RkDcoTM/Bm7XvLT5o=; b=uINOGZgUGONpFp5c/5H8o5Nxpc6m/jJaXGA1/dR/vqdQNw+0ESFpsdjxmeV5aoPG6Q by5dTNMGeEmHEv+wnSQtNc/NfEm4YHCyhc8VhstPidcf+ZtWBRB6CfXHFYhDVJqbu2eG nrE2kXj1pYuyHaJ2xIWwnh6fDzFPOJi5DAsiDEjuSEzG06SffwRKtKHw3wF8i16sqLl4 xOwsG9XkiheC+J2SJsSyvzmPcvaQy7XSE0X7dsa/ujOfFwO096IgFb45ETy9qG8MpxgD UfQsR9XNE40UiRevgT1mZB+UhtbRKwJbsGafTz7hYymOivHqbC23ONTw+LN/dP+XlejU cZhQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o14si3045765oie.257.2020.01.30.09.08.33; Thu, 30 Jan 2020 09:08:51 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727351AbgA3RFf (ORCPT + 99 others); Thu, 30 Jan 2020 12:05:35 -0500 Received: from mga09.intel.com ([134.134.136.24]:16487 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727158AbgA3RFf (ORCPT ); Thu, 30 Jan 2020 12:05:35 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2020 09:05:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,382,1574150400"; d="scan'208";a="309759519" Received: from mattu-haswell.fi.intel.com (HELO [10.237.72.170]) ([10.237.72.170]) by orsmga001.jf.intel.com with ESMTP; 30 Jan 2020 09:05:13 -0800 Subject: Re: [PATCH v6 0/5] usb: xhci: Add support for Renesas USB controllers To: Vinod Koul , Christian Lamparter , Greg Kroah-Hartman Cc: John Stultz , Mathias Nyman , linux-arm-msm@vger.kernel.org, Bjorn Andersson , Yoshihiro Shimoda , USB list , Linux Kernel Mailing List , Alan Stern , Heikki Krogerus References: <20200113084005.849071-1-vkoul@kernel.org> <20200121064608.GA2841@vkoul-mobl> <5878067.luYmtVZgP3@debian64> <20200125053237.GG2841@vkoul-mobl> From: Mathias Nyman Message-ID: <64340358-6682-4ae0-9c06-d72d5a4ff259@linux.intel.com> Date: Thu, 30 Jan 2020 19:07:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200125053237.GG2841@vkoul-mobl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25.1.2020 7.32, Vinod Koul wrote: >>>>>> >>>>>> On Mon, Jan 13, 2020 at 12:42 AM Vinod Koul wrote: >>>>>>> >>>>>>> This series add support for Renesas USB controllers uPD720201 and uPD720202. >>>>>>> These require firmware to be loaded and in case devices have ROM those can >>>>>>> also be programmed if empty. If ROM is programmed, it runs from ROM as well. >>>>>>> >>>>>>> This includes two patches from Christian which supported these controllers >>>>>>> w/o ROM and later my patches for ROM support and multiple firmware versions, >>>>>>> debugfs hook for rom erase and export of xhci-pci functions. >>>>>>> ... > > Mathias, any comments on this series..? > Hi Vinod Sorry about the delay. Maybe a firmware loading driver like this that wraps the xhci pci driver could work. One benefit is that we could skip searching for the right firmware name based on PCI ID. Each of these Renesas controllers now have their own pci_device_id entry in the pci_ids[] table, and could have the supported firmware name(s) in .driver_data. This way we wouldn't need to add the renesas_fw_table[] or maybe even the renesas_needs_fw_dl() function in this series. I realize this can't be easily changed because usb_hcd_pci_probe() takes the pci_device_id pointer as an argument, and expects id.driver_data to be a HC driver pointer. So this turns out to be a question for Greg and Alan: Would it make sense to change usb_hcd_pci_probe() to take a HC driver pointer as an argument instead of a pointer to pci_device_id? pci_device_id pointer is only used to extract the HC driver handle. This way the driver_data could be used for, well, driver data. Heikki actually suggested this some time ago to me, back then the idea was to improve xhci quirks code by using driver_data for quirk flags instead of finding and setting them later. There are a few other opens regarding this series. Mostly because I'm not (yet) familiar with all the details, so I'll just just list them here. - Is it really enough to add the Renesas driver to Makefile before xhci-pci driver to make sure it gets matched and probed based on vendor/device id before xhci-pci driver is matched and probed based on pci class? What if the Renesas driver is a module and xhci-pci compiled in? - Previously probe didn't return before hcd's were added and everything set up. Now with request_firmware_nowait() probe returns early successfully, and the old xhci_pci_probe() which sets up everything is called later by the request firmware callback. So there could be whole new set of races possible. For example pci remove can be called mid firmware loading, or when the old xhci_pci_probe is still setting up things. I understood that a synchronous request_firmware() in probe has its own issues, not sure if there is a good solution for this. - Before the firmware is written to the controller the firmware version is compared against a hardcoded number in the drivers renesas_fw_table[]. This means new firmware versions can't be supported without patching the driver. Is this intentional? - Mathias