Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1320865ybg; Tue, 2 Jun 2020 07:03:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzU85N61Nn442CoCq4M8IvMog6QWDE65Fy6MCGWddA76hawztVpLIucazzDBIOpQIaIoT+f X-Received: by 2002:a17:906:34c5:: with SMTP id h5mr23163863ejb.325.1591106635242; Tue, 02 Jun 2020 07:03:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591106635; cv=none; d=google.com; s=arc-20160816; b=RB+kgGLRFDkwJY5hmkaP8LULPLJQpBViVTZTtl7pC9XOZesrEROLCkRxWd8vYnJtdy kTCZc7Hm/f3Wvl6QuUS3rKQ5I0tO2e2Ca6eJenCovhIZvDKjeUhQ7dyhcwifeZNNjpqK 5nF/S65ynWXlvHGTErN7lTy+OOUHAWFrEQgM7Blnj5KzSyf1p0W1BEh/0pYD5Qc8e+kv Yt3K5K0aOOKe/2p0bmvWBiC7zFcsTNoC0ktuACef89vVC3kgfoskXSG1EcHAy9IgREBe LC3RgjMLNU1Jt9oLO/89WbJ6riN9dI+TvP317aajcX6rBQhRwmFMHXxMJTiC5mrQadnX zPOg== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=7yBqRQ05m/Z4dmTqP2jf4amoRtlJTzK7ps3isjshOVc=; b=TmOIxo7mFD9WM3sZG1Eilb2yNw6eAwxDaln2+8IyiiLSKrIn+M+hejsXUpTaT0QYbL g5G/qUlHaA7uyR499kGiAdUh+1eaf3X+C5QVXbZWwjJRtugOIvDBooAcpvkZ9QNT64rC 4U1u2li3RUVBdT+RcN5jtYQUqYWQHpg/Dls4RiH91rcmbM8fCCwt8DlRmnbtvlfMfzlf bu/OCibiq595Dub2g1jAKzqLI68tEElAB2gQplXn3McBNW1I/09oCDcehcvMlfr3BfoB CA6mR1tJH4hBKpk2kWdpmffd0ppe8QMI229n8G299GoLSdNG7lXDBN1l2508EW/YRZsD VW7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BYLCVngy; 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 bc22si1581033edb.368.2020.06.02.07.03.29; Tue, 02 Jun 2020 07:03:55 -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=20161025 header.b=BYLCVngy; 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 S1728247AbgFBOAd (ORCPT + 99 others); Tue, 2 Jun 2020 10:00:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbgFBOAc (ORCPT ); Tue, 2 Jun 2020 10:00:32 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84806C08C5C0 for ; Tue, 2 Jun 2020 07:00:32 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id s88so1480185pjb.5 for ; Tue, 02 Jun 2020 07:00:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=7yBqRQ05m/Z4dmTqP2jf4amoRtlJTzK7ps3isjshOVc=; b=BYLCVngy4uvXcIBPOgBUgVA0OPaE+H9Fyfe9LVc4F4uRNZXwKG1fmWo90RbVuFdj2h 3VSgFyffB6NjRiZG+jajuSTEagKpWwT8ZLfryOA7RcaVRV3s57dUZGAGd/QeFaXOKSwN wNicNnfkZQHReNgWl0ZUZ6e/OEe5N3ppU6i4QtSFoOfo7QOX3U8HCQ11vyiP680D6vJU m4HXHkMCbfQzopvgRyWnUi9Ep/1/CjKLH7xvxAu2KZuk/mVwA9NycekR1paT5abB5qRO tcDU1qOcqKNaosOCMDzgpMb9XiDWRPgNIW4a8pre/lp/T+/zExpaJ5ifhkEElourHw2i J+jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=7yBqRQ05m/Z4dmTqP2jf4amoRtlJTzK7ps3isjshOVc=; b=lyinFBNj6+zjbMnqdZ3z1g9NCe68EkU2/ub80vwACzY8TzbPBE7X+w613Bsvk9r9pJ uIsf8XxJA/+EoQST2wAdsdHlIX7WHiIm2ajtoibDLw72pLrqRhMJ7RVh4gO3Iy/3urpA pcNoFH3M7N0Vt1WYhwy0aKgaz9ALm1BJFokpfMBhAG3XR/30Gul+TMBTeYbZRGyrxc2g J5sbr9U9UGa/6F4tAcf6Wm6/ieDyznwDxM16qVm0VkhyGnl46LdBtuZmw2m9TN3hoW2C w7azMfwq+K3J+ckV/xgWsYwm6O3TsjyJDcbUQFvX7kXFpizwI0ubu/RhfWK5d/gy69eV UepA== X-Gm-Message-State: AOAM530gUB51ZhtaxXfmdsbYEwtBuD9MJS/cxmSa/UCHpPAMLKXROK0J XU0C8Eh0y6Fm017e4fMAyCgVHcbJ5vGlUycRxiM+sYEVNlU4sA== X-Received: by 2002:a17:90a:1704:: with SMTP id z4mr5657315pjd.181.1591106431949; Tue, 02 Jun 2020 07:00:31 -0700 (PDT) MIME-Version: 1.0 References: <20200602092030.31966-1-piotr.stankiewicz@intel.com> <14063C7AD467DE4B82DEDB5C278E8663010E23E538@FMSMSX108.amr.corp.intel.com> In-Reply-To: <14063C7AD467DE4B82DEDB5C278E8663010E23E538@FMSMSX108.amr.corp.intel.com> From: Andy Shevchenko Date: Tue, 2 Jun 2020 17:00:20 +0300 Message-ID: Subject: Re: [PATCH 07/15] drm/amdgpu: use PCI_IRQ_MSI_TYPES where appropriate To: "Ruhl, Michael J" Cc: "Stankiewicz, Piotr" , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , David Zhou , David Airlie , Daniel Vetter , "dri-devel@lists.freedesktop.org" , "amd-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 2, 2020 at 4:38 PM Ruhl, Michael J w= rote: > >-----Original Message----- > >From: dri-devel On Behalf Of > >Piotr Stankiewicz > >Sent: Tuesday, June 2, 2020 5:21 AM > >To: Alex Deucher ; Christian K=C3=B6nig > >; David Zhou ; David > >Airlie ; Daniel Vetter > >Cc: Stankiewicz, Piotr ; dri- > >devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org; linux- > >kernel@vger.kernel.org > >Subject: [PATCH 07/15] drm/amdgpu: use PCI_IRQ_MSI_TYPES where > >appropriate ... > > int nvec =3D pci_msix_vec_count(adev->pdev); > > unsigned int flags; > > > >- if (nvec <=3D 0) { > >+ if (nvec > 0) > >+ flags =3D PCI_IRQ_MSI_TYPES; > >+ else > > flags =3D PCI_IRQ_MSI; > >- } else { > >- flags =3D PCI_IRQ_MSI | PCI_IRQ_MSIX; > >- } > > Minor nit: > > Is it really necessary to set do this check? Can flags just > be set? > > I.e.: > flags =3D PCI_IRQ_MSI_TYPES; > > pci_alloc_irq_vector() tries stuff in order. If MSIX is not available, > it will try MSI. That's also what I proposed earlier. But I suggested as well to wait for AMD people to confirm that neither pci_msix_vec_count() nor flags is needed and we can directly supply MSI_TYPES to the below call. > > /* we only need one vector */ > > nvec =3D pci_alloc_irq_vectors(adev->pdev, 1, 1, flags); --=20 With Best Regards, Andy Shevchenko