Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1652454pxy; Thu, 6 May 2021 12:23:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjJ8dcLG17vAM/2/h+QdfXIrWxQfBeXHBy4xTZlunqvI3LmzWu0PnTBjtaBTR2PeQqeQbp X-Received: by 2002:a17:90a:c782:: with SMTP id gn2mr6238167pjb.94.1620328988382; Thu, 06 May 2021 12:23:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620328988; cv=none; d=google.com; s=arc-20160816; b=cakUQANkCXCpvQFc/AsqvARRQJ+IuHsmUQUSVKdgSdY9RJ2+LCNiqDApEma5eaEmDU 6+SflqstgU/K+dFG26BXz1iujDHJqv91bCibjmi0bBysWgS9YcmybjB6tlZA9Cp8pSPI uq5BoCuk8x9TcuPapXKGFwo/5Lm0K+Pml9DYKZLzNEcyW9eSvxMnyl0AStR/4KwdHHkS gXBJJXdby1+Dj9Q1410eKz2yTPqds6fAxcElgCQjWTxnOxLWw5bwDJQeuQ/V+KYsoX5X VlcvUd9iHX0dOsDqNpQwViOnWP4gUv/MiNTdmPQhpbp18C5lYXMPXZWVmijmTVAPOFG0 1gBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5QnKiVvlMGggt+u+Rbfh/wgi8B39h3AKsBB/TYS2YXE=; b=fV7okpkgYG+zjeOVRp50Tc8FtjUEWF774COPkeLR0qwdwm85QayIdCvS7mRXYkwvxB /+ccZEFCdLkXsza+VrDHXKUBj5xxls0666cL86mWlKCHoV4XfEpcgl3uyPMATgn6/SbP KCp4s34L2RrE5FfwazMsJHeAj+c913Q+/8t+VZw+WCf67inm0d/Q/NwVSu6BCANAifQZ /NLm3HgdZ8vyOzm4tW2Byt4IKmXyIN/peSxsrErIWAhjyaoZAXhy028bUmcsJx7x0FBa pH9UZ20bwfOJa8WzbiD0jlbjqZi6auJfzbLrnK58Z+NZTt66EDlgRiFKQeHwn0T2NxDo xj+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EqDJhLO1; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s3si3887797plr.336.2021.05.06.12.22.54; Thu, 06 May 2021 12:23:08 -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=@kernel.org header.s=k20201202 header.b=EqDJhLO1; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235811AbhEFPhp (ORCPT + 99 others); Thu, 6 May 2021 11:37:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:45970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235690AbhEFPdx (ORCPT ); Thu, 6 May 2021 11:33:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0526E61469; Thu, 6 May 2021 15:32:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620315174; bh=zi+PML1cWSulO/GYWf9yak7a3W+RSD4MegJIQ/xyX/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EqDJhLO1Hbf8GkvCKJD0Nzd3ZOEPegQ4Ex2n1YeJtatlQl6Tr4bvmFR9YYqpgSfqb BX4/PEJZLywUrkQrde7yaSPg/j5lrsNr8UlJ44x1jVDO5GS4GPG+/eJo+sGYb+OKro GQHHh13UH+UCZ2TOlXFdq696tTnU9DaAsE3hhTnwH33W047YxWZ2ZixmzjtoF4AoqO N7q6gFcsJOkOEEnUjLywFP7y/SJT+kIm4jDnurpRFmXqfb9+XYfe2YcR6Z/vsTru6I lz+ngyp3uxxpZmbe5h7lWGZT1u1XE1WJLPaklxoistVSrSAkZsUXFwxF7xmFgyJC2U GtL62ZeX3tDUA== Received: by pali.im (Postfix) id B509A8A1; Thu, 6 May 2021 17:32:53 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Lorenzo Pieralisi , Thomas Petazzoni , Rob Herring , Bjorn Helgaas Cc: Russell King , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Remi Pommarel , Xogium , Tomasz Maciej Nowak , Marc Zyngier , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 32/42] PCI: pci-bridge-emul: Add description for class_revision field Date: Thu, 6 May 2021 17:31:43 +0200 Message-Id: <20210506153153.30454-33-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210506153153.30454-1-pali@kernel.org> References: <20210506153153.30454-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make it clear why there is bitshift by 16 and rewrite the code to align with the new description. Signed-off-by: Pali Rohár Reviewed-by: Marek Behún --- drivers/pci/pci-bridge-emul.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pci-bridge-emul.c b/drivers/pci/pci-bridge-emul.c index fdaf86a888b7..2b6ea84f25af 100644 --- a/drivers/pci/pci-bridge-emul.c +++ b/drivers/pci/pci-bridge-emul.c @@ -265,7 +265,11 @@ int pci_bridge_emul_init(struct pci_bridge_emul *bridge, { BUILD_BUG_ON(sizeof(bridge->conf) != PCI_BRIDGE_CONF_END); - bridge->conf.class_revision |= cpu_to_le32(PCI_CLASS_BRIDGE_PCI << 16); + /* + * class_revision: Class is high 24bits and revision is low 8bit + * Class for PCI Bridge Normal Decode has 24bit value (PCI_CLASS_BRIDGE_PCI << 8) + */ + bridge->conf.class_revision |= cpu_to_le32((PCI_CLASS_BRIDGE_PCI << 8) << 8); bridge->conf.header_type = PCI_HEADER_TYPE_BRIDGE; bridge->conf.cache_line_size = 0x10; bridge->conf.status = cpu_to_le16(PCI_STATUS_CAP_LIST); -- 2.20.1