Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1379896pxb; Thu, 21 Oct 2021 23:01:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOVHmN70kYDDy9yKy1poffg6fUv6vElYi9Phq6GBZEHWgR/CWvSWRyzB9gJA4nlQg3aWn8 X-Received: by 2002:a17:907:c27:: with SMTP id ga39mr12589704ejc.217.1634882493630; Thu, 21 Oct 2021 23:01:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634882493; cv=none; d=google.com; s=arc-20160816; b=SrY44+kPVlMn6rkb79QXNUxQgTlMmrOgLvfrCnWPLJd72PHroCGUWgoPC0bwVbwIWb T3iaV64z7HvfP3veWqt2FpTqxX1yz6aI8xnmJyF1tY7EMRsjuA+sB0xR9f3/YXUkwBKt myvQ/QypqVYNP6KQA4Zkp5w23cxNfY/dDdc6we9RlrtRFMrOVgBcwRmdGVqL+SC9VYQY s0xZWcwgkeFEg47/n1tu/Bua3UHCGIudXsCDsz6q+x9TFhD+LifNBXIz28ei+aQI+3FW mIQMvj6KGONZPQ+f/XxdJEyuLjZc88/xC1EzaBT0q6yjv4aD9b1Io1CAz+V5bDtpoanW EI2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=YBqZ2/WOjzFpakGpLZqp4pTnNIzI3k69qYYA40+nsis=; b=DPSzGyHwUnrfuV0aAzT0MogGU3nSlSd03Dg3ClP/aBOrvS6vSIp4uIxKRNFa+b6u/B z4aJJ4MSwh2zxWDAVrDCiTUcMyCf4Z66RYegrED8d+vkNLINAA+1evgLZ0ng8vSZDsKV z1VxYEhwbHhiWbL1VhZiZ7F9JkU1RPHow+SOm9GpGiDWBBb819Dx1W+CHjaXuoaabg3y TDlUo2UkrRJLxYjQwRHCyt424YkRXoL3h+VNmurKNeF+EDw8xWRXaeSp90w6lKdyQ3zt DSOjBiVlmsdZygOalTrXHo2PmKyAHbldR2MEiMaBIL3fI5FnVbMcJruaeEPlqq3cDHHO 8jKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lXhUDsy8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id o2si14730502ejy.80.2021.10.21.23.00.58; Thu, 21 Oct 2021 23:01:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lXhUDsy8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230238AbhJVGAX (ORCPT + 99 others); Fri, 22 Oct 2021 02:00:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbhJVGAW (ORCPT ); Fri, 22 Oct 2021 02:00:22 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8331C061764; Thu, 21 Oct 2021 22:58:04 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id bq11so507803lfb.10; Thu, 21 Oct 2021 22:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=YBqZ2/WOjzFpakGpLZqp4pTnNIzI3k69qYYA40+nsis=; b=lXhUDsy8yUWIDFjjiXAOqAibq/tVSSErBHVs+3nhznGA605bJYXCviOhpL2tuNgWC1 9ieEq+sXXLF3o5P6jYEywU4zuiZUv3RQ23ohd7Xpzi6933k9SuLVRydbcE+QcCI/oc5s +n0m4qTYneQ9YQ0onKYjzqnQmea2m6teqz18XZcuQ7M7eytbtbEJO47tFtFxuw7YLkM2 +Tw5V9ZSh/kFTuZ2G2SzVhpSmshHana4gjBi9xD4nYSpPJspNpHz62DX6Qx7OBEXWREj xvxvrc2BewV4Qhm+pbLB47uvE3lXm9URP7b1LXCZJu56E1cUDFSBqgU+cNU8DWV/iiXU r/dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=YBqZ2/WOjzFpakGpLZqp4pTnNIzI3k69qYYA40+nsis=; b=blLW34IhEgJ/Inuz/oyIwZZ9nZ8QiiLa1uDglmd2KJCBYIVE1TGI2rUctSzJgQOj9Y JWVdp6Pm3SY1S0kMoukQiWnJ52/w1SdJk0yePrgliXTdBEw8ewL+7X1P8E+n4s3MB8It hk9UR2gpqrp0Y00CGh6ghMI+PrNe3CW1L/ejN+qWNjExfnckxDLHObiMLQ34e8AXRSfj IfqJIJ6bG0ivn4Z0ysHg5zCrDusD4ugaLYSTVTvGY4Mvs+Ub+8T0d0Txps9mE7gO8yCA HBJiYza2komSifBpbyc4ssTuiEe9nh5OwQcPynTKW92KS9belU9E/VRWJoxDM+qXJlnk Yiug== X-Gm-Message-State: AOAM532qmbSdWzYQWF70l/Yb2GCmE+La1uoSzyeyOfuIclRmIvYnOCtC gVv2M4ulLt4MHj89w5OrEoRvaoc3MGE= X-Received: by 2002:a05:6512:10d3:: with SMTP id k19mr9608407lfg.438.1634882283081; Thu, 21 Oct 2021 22:58:03 -0700 (PDT) Received: from [192.168.2.145] (94-29-61-202.dynamic.spd-mgts.ru. [94.29.61.202]) by smtp.googlemail.com with ESMTPSA id t3sm634511lfc.216.2021.10.21.22.58.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Oct 2021 22:58:02 -0700 (PDT) Subject: Re: [PATCH v1] usb: xhci: tegra: Check padctrl interrupt presence in device tree To: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: Thierry Reding , Jonathan Hunter , Greg Kroah-Hartman , Mathias Nyman , JC Kuo , Nicolas Chauvet , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org References: <20211021115501.14932-1-digetx@gmail.com> <29b38423-631e-192e-b006-aa0d258c8030@gmail.com> From: Dmitry Osipenko Message-ID: <0a48c38e-1841-0dc9-473e-5dbe67ce04d5@gmail.com> Date: Fri, 22 Oct 2021 08:58:02 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 22.10.2021 01:14, Michał Mirosław пишет: > On Fri, Oct 22, 2021 at 12:46:23AM +0300, Dmitry Osipenko wrote: >> 22.10.2021 00:37, Michał Mirosław пишет: >>> On Thu, Oct 21, 2021 at 02:55:01PM +0300, Dmitry Osipenko wrote: >>>> Older device-trees don't specify padctrl interrupt and xhci-tegra driver >>>> now fails to probe with -EINVAL using those device-trees. Check interrupt >>>> presence and disallow runtime PM suspension if it's missing to fix the >>>> trouble. >>> [...] >>>> --- a/drivers/usb/host/xhci-tegra.c >>>> +++ b/drivers/usb/host/xhci-tegra.c >>>> @@ -1454,10 +1454,13 @@ static int tegra_xusb_probe(struct platform_device *pdev) >>>> goto put_padctl; >>>> } >>>> >>>> - tegra->padctl_irq = of_irq_get(np, 0); >>>> - if (tegra->padctl_irq <= 0) { >>>> - err = (tegra->padctl_irq == 0) ? -ENODEV : tegra->padctl_irq; >>>> - goto put_padctl; >>>> + /* Older device-trees don't specify padctrl interrupt */ >>>> + if (of_property_read_bool(np, "interrupts")) { >>> >>> Does this catch "interrupts-extended"? >> >> No, Tegra doesn't use interrupts-extended. > > I believe it is generic and equivalent to "interrupt-parent" + > "interrupts" properties, so people might as well put this in > the DT to save (or loose) a few bytes. > > You could just check if of_irq_get() returned -EINVAL instead of > matching "interrupts" property. It should be a bad idea to rely on -EINVAL since it's ambiguous error code. Perhaps it's fine to assume that today of_irq_get() may only return -EINVAL in a case of a missing DT property, but then it should be two patches here: 1. Use -EINVAL and backport this fix to stable kernel. 2. Change of_irq_get() to return -ENOENT for a missing property and change tegra_xusb_probe() accordingly.