Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3382251imm; Mon, 6 Aug 2018 03:55:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcJ3m62jYqkJMWiF6NN5tYjte6eSXAW7rSRIiQsVb45k3bOgJBMOuir8M5bkOe6EqwCojaQ X-Received: by 2002:a63:2043:: with SMTP id r3-v6mr14389236pgm.105.1533552913831; Mon, 06 Aug 2018 03:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533552913; cv=none; d=google.com; s=arc-20160816; b=d3bJLHu3W5W1ytM+xDE+317MxnaIMMhcQ7gkyrjznV8lyvTMnF3MFiyQYuYy9cVYki b5S2v7RcS7j3AIkV1BzfUhjQg86vISOsu7hJk5c4K9CTtNL00vdzUDY81ggN6rF1cJFY s+O4h3/LWmwYbirQr5etqMCcG4dJiV9DBKOEgfjOmWfMqxzNxMs0vf9biqvqYG+7+2kG TghlANw62/mvqtyMVovccuuEo4gHhDssoY0KBQkdrAgCEKn18tJkxMyc/focsgBF8Nuh O1SldBUvZocnV20gBjzWbp/CcL6DMPWwttqlPMaIt0xKVOvI0y9lX62qaQPbVFHe4jt3 inJg== 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:arc-authentication-results; bh=ol9RhpJjTo+ExL2Wo8lDi/lzai9QPThGbabhWVVgNjQ=; b=Q6G6CrDIjvb1zGkjwl1k4KDV9sW1vukwHw9s7fF/OEG+pXYtykn8s/fiMxy6Y5W2XG pRdxRjs95WoreYlz/OjiUhuqeVeZQ3W9GWJR4dw4OxKZUmwuUT1nt9wY2n5Lj41YeMrC 2DTgWXkabeM2OH1AVu9CLUG2n71usjEjwvYV3IPfJWomxbd1ALhCC4jknT7YWtqHd0aX HZign7zVbFte+TUkafKK9hccBa05falO8jMvcWgbdhK7mpKG4j1P/GdxSyK7Uumq+uFt x5GY5xYL8pNXglOxCtIlSpJG0kDxMWCT6rPz4GGqb8nT7WAYTke/r2LVPHS/HaXUn1SV tfQA== 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 s65-v6si12523943pgb.486.2018.08.06.03.54.58; Mon, 06 Aug 2018 03:55:13 -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; 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 S1729974AbeHFM4J (ORCPT + 99 others); Mon, 6 Aug 2018 08:56:09 -0400 Received: from mga03.intel.com ([134.134.136.65]:29657 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726678AbeHFM4J (ORCPT ); Mon, 6 Aug 2018 08:56:09 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2018 03:47:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,452,1526367600"; d="scan'208";a="73988427" Received: from mattu-haswell.fi.intel.com (HELO [10.237.72.164]) ([10.237.72.164]) by fmsmga002.fm.intel.com with ESMTP; 06 Aug 2018 03:47:39 -0700 Subject: Re: [PATCH] usb: host: xhci-plat: Iterate over parent nodes for finding quirks To: Anurag Kumar Vulisha , Mathias Nyman , Greg Kroah-Hartman Cc: "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <1528212056-28390-1-git-send-email-anurag.kumar.vulisha@xilinx.com> From: Mathias Nyman Message-ID: <51566ca4-1002-5c62-71d0-9da610bff368@linux.intel.com> Date: Mon, 6 Aug 2018 13:50:38 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: 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 Hi, Back from vacation On 20.07.2018 18:39, Anurag Kumar Vulisha wrote: > > Hi Mathias, > > Thanks for providing your comments, please find my comments inline > >>> >>> - if (device_property_read_bool(sysdev, "usb2-lpm-disable")) >>> - xhci->quirks |= XHCI_HW_LPM_DISABLE; >>> + /* Iterate over all parent nodes for finding quirks */ >>> + for (tmpdev = &pdev->dev; tmpdev; tmpdev = tmpdev->parent) { >> >> Isn't sysdev at this point the topmost device that can have any of those device >> properties set? >> We could loop from &pdev->dev up to and including sysdev. >> >> It doesn't matter much but maybe avoid walking some extra parents. >>> > I have seen some drivers ( like dwc3 host.c) which create a child dev, which is > the pdev that is being passed to xhci_plat_probe(). So, sysdev may not be the > topmost parent. There could be some properties which may be present in parent > and may not be populated in the child. So, I made this change to search on all > available parents for finding a valid property Ok, lets keep it like you wrote it > >>> >>> - if (device_property_read_bool(sysdev, "usb3-lpm-capable")) >>> - xhci->quirks |= XHCI_LPM_SUPPORT; >>> + if (device_property_read_bool(tmpdev, "usb2-lpm-disable")) >>> + xhci->quirks |= XHCI_HW_LPM_DISABLE; >>> >>> - if (device_property_read_bool(&pdev->dev, "quirk-broken-port-ped")) >>> - xhci->quirks |= XHCI_BROKEN_PORT_PED; >>> + if (device_property_read_bool(tmpdev, "usb3-lpm-capable")) >>> + xhci->quirks |= XHCI_LPM_SUPPORT; >>> >>> - /* imod_interval is the interrupt moderation value in nanoseconds. */ >>> - xhci->imod_interval = 40000; >> >> Setting the default imod_interval could be moved before the for() loop >> > > I thought it would be better if everything related to imod_interval is in one place, > so kept it as is. I can fix this in v2 if you suggest. Default imod_interval needs to be set before the for loop to avoid overwriting a value got from device property So a v2 is needed -Mathias