Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6175143rwd; Mon, 19 Jun 2023 03:35:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4TPFjrOD1xvBQmkoy7a3r0nJx75XuDF2YfztBCzRLCRf7GHOUXXJ/nT5YuDLmUV9UZo4Pw X-Received: by 2002:a05:6a20:3954:b0:10b:a9ca:97bf with SMTP id r20-20020a056a20395400b0010ba9ca97bfmr6278544pzg.24.1687170948403; Mon, 19 Jun 2023 03:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687170948; cv=none; d=google.com; s=arc-20160816; b=jLh/HwjIV7eSqmjXyV5H7FFmkKwdjmJ++wCDNPXV+Hk/CYYqzJX0cW7Cf3yvEbzUA0 ryoG3vq8pyJUnC9BIml8iLj+k88Td5mZwhAB+GL/i83Jiy7xwtnqeODqokpHrIRPe/rK 1kNNLm5xt4gOhVWoESoDFInwWrLLsAb3TwUhkzDZjnkpfbU2djetldH66OJZy17DYCkp nFQysgnmBiVF1stl6SHHs5pdQN9vmkW7jURw2edyfCHpp59du6DP3cB/+jOT5jc4xn1U NfHaGcRJ9EcvvyuhW3+XC5ILbp6iKmkiRkWXBa8m4fmcfK/AqQlwfHCQSC+Q17FJtLzR SIFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:references:in-reply-to:subject:cc:to :from:date:content-transfer-encoding:mime-version:dkim-signature; bh=atn+Xh5ofMQoAQOuOg3YzJZ4T0g/yVayYq8PRMt/Rg0=; b=i1s5gLZv/h+/Tse7FAIa7rO8GWJJFficVVG1XMJYLfNxGO9yj0rv0lim8wVhVVb9Zm jh1ohsgBgKYQl8NQbyWgkHXzDmwZ1i/iOJZG8TK33zPFkJvX1VTsL+ptOM5g+j/PPqzc gKmDogxNAwCmTXnGSmJCdznJnKCem59wZOiWUh52ldgXy26TA5HgIYWIkqz4NkNGo1zl FPu7ocJjDMPD2eHhRNTz9iI43hdEaqXnQSEyoOZiazPp140f1WYRVbYtWQF4EnnQ2F5e CJwxLxLB94j88Onlzrtgd3HelvyJKAftfTbxNVo4bKmit+Nm7qOM+jJJnxWRdu3BX2f2 BsLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b="WbFYvv/I"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u8-20020a170902e5c800b0019ec2a633f4si16784743plf.505.2023.06.19.03.35.35; Mon, 19 Jun 2023 03:35:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b="WbFYvv/I"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230321AbjFSKGW (ORCPT + 99 others); Mon, 19 Jun 2023 06:06:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230149AbjFSKGV (ORCPT ); Mon, 19 Jun 2023 06:06:21 -0400 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3705DCA for ; Mon, 19 Jun 2023 03:06:17 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E4984240106 for ; Mon, 19 Jun 2023 11:59:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1687168784; bh=rv8/fB8ERkqg5LdBhWihNWSXDtklcfVW8V0G2uDSZXM=; h=MIME-Version:Content-Transfer-Encoding:Date:From:To:Cc:Subject: Message-ID:From; b=WbFYvv/IRaKo2POREV7GfmxLozUE956aIYgA2va8sOp99W4lY+uOhqAceR6LnNVre cloDvIZqOTdu/gDFTXGAvE0wI9MlOj6Hi99P1d8nXWvU+yAvEDoiPlMxgea4SCw8st zPKj79SOh1ztbJg+jFIdbD4NIKVRKGJE9tqeUMRC8krSFt1GAta5lB/g9ywXJNAO8j qMX+ChKaAX1m9ZuT8tvBNASr6uQitijGINCz0CkPlHrVBU0DYph8fKI5cDC/OC/+0j Qj0sslhLb9RC8bLMy90NVrD5XmCtARHCyroyjxEMN7EmCamyxC/fhfSKsxD6lClPbb 7CnC//YiMgQMQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Ql4xX0Wrzz6tw9; Mon, 19 Jun 2023 11:59:44 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 19 Jun 2023 09:59:44 +0000 From: retpolanne@posteo.net To: Greg Kroah-Hartman Cc: Mathias Nyman , Yoshihiro Shimoda , Vinod Koul , Christian Lamparter , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: host: xhci: parameterize Renesas delay/retry In-Reply-To: <2023061951-taekwondo-unsoiled-faf2@gregkh> References: <20230618224656.2476-2-retpolanne@posteo.net> <2023061951-taekwondo-unsoiled-faf2@gregkh> Message-ID: <0627e991f2c446cd7e265188523607da@posteo.net> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19.06.2023 07:46, Greg Kroah-Hartman wrote: > On Sun, Jun 18, 2023 at 10:46:57PM +0000, Anne Macedo wrote: >> Cards based on Renesas uPD720202 have their firmware downloaded during >> boot by xhci-pci. At this step, the status of the firmware is read and >> it takes a while for this read to happen (up to a few seconds). The >> macros RENESAS_RETRY and RENESAS_DELAY are used to retry reading this >> status byte from PCI a few times. If it can't read the status byte in >> RENESAS_RETRY tries, it times out. >> >> However, since this may vary from card to card, these retry and delay >> values need to be tweaked. In order to avoid having to patch the code >> to >> change these values, CONFIG_USB_XHCI_PCI_RENESAS_RETRY and >> CONFIG_USB_XHCI_PCI_RENESAS_DELAY are introduced. > > No, a build-time option that affects all devices controlled by this > driver is not how you handle this, sorry. Sorry, I completely forgot that other environments might have multiple cards. Mine only has one and I was focused on making it work. > > Make this a dynamic value, either determined automatically by the > device > itself (as you know what device is being controlled), or worst case, a > sysfs attribute that you can modify if things are not working properly. > I'll follow Christian's tip and check the uPD720202 user manual and see if there's something I can look for in order to make this value dynamic. > But a build-time option will never work, as it will never be changed, > and it would not allow for multiple devices in the system that are > different. > > thanks, > > greg k-h