From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E48703A6405 for ; Fri, 24 Apr 2026 11:12:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777029129; cv=none; b=Bd3L/Z8vjA6DbuYdkrSfeQsFNT5RcRm60Vmt2IhOsyae7d0CCWIpG53eTRpB+U5HGBmzwNZDnY8s0zSwlyIEwrVsqsYyiHimoCR3DcRT1uJ2pizcw6PSj57zUt0d4xKz/NhHqPs0C5sCEiCohf6kqruywHh4/d+dTBuUJLp1SyM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777029129; c=relaxed/simple; bh=8TDfTd2nN17K149dCg7BZzVS6ufG9hPrdJL4Vxj3gpE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qPgAKEqepvqyVI27N9Td3gwURL95lcnTliHNG9ZJPR/BxCNyZoPqbROG4sGZH6vV+ow1PDtUWFJJsKWn0mETVXYpQRR9olnaPvMV+b4p6qCQn1NVN3BLv3HRht9Mb0rzqw5muKeSytau9htFAUJWq5CgVrHieyJqYLLSeCpyKqc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SDKuwWwp; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SDKuwWwp" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-48984d29fe3so82700025e9.0 for ; Fri, 24 Apr 2026 04:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777029126; x=1777633926; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=azCtRYCcNhig1YJKb3nkefIxZBkys6ZdtGUhFZQ31D8=; b=SDKuwWwpAFxkB2BFGdw7ndnH8ybcDVN/A6a52remEt9C27x6WFdDtToeHHAwNkthOz 8SlLdkM0O7QJT4vR66K5YWvrXtu2lmydPPLteRWpg1aiTsSbsbh4562fSmqNOcMxcN1C Kso/rjPQucC0PRVOkiYStbQFsZMiEyoLkb7vbbsai4Tuk64Nq9RB/4xgR0FhLAhzBwCe oEXmfsdFma4Y6miMQ8rrsN8hzWaKx2Zpth6m2mv/DeMghjzl7vaASTze3OSH/9fpSZTP /JLMGOKJwmdh+BaG0BPpdNDUy8RmHVVz8fQNMH+w8K7vQ7fOmySC0OVJxbNvtPKZOqEP Xg+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777029126; x=1777633926; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=azCtRYCcNhig1YJKb3nkefIxZBkys6ZdtGUhFZQ31D8=; b=eDkyHeDc46vyGlcxsMYkMY/GcqAToMX/tW2a0+qTa7zKy2uSEbCEaOPeJXqHkNqj0c jFzBzE6duevHr5Xqx/hBdeyGTdKDIHD1z10GKE3QkF/S8T8oez4hRUnZSFxlrtiGFSaW /GNbFRIInwc4RqJPA1j6ZeVV7KoVHwAExhNTJFPsR6UrtybPGzCQRlqHCZYIRvZi9FfQ G/7FpXjUjeHZ2LNKdR8daJwl+baxQinuV/PrScC8DSx6MSQyd9wQXp6+YSZQZ5YjKMxe 7pdhDCXmlSVIvMuPjnLA+Xs30M6ivmJxKFt4bm98Sm2iL+/Fd9ELqNUOPGBcxyqp0UU1 o6sw== X-Gm-Message-State: AOJu0YxLqA9D/uQfte+uH0ux17WXmx0YrBnEy6vSvnp+ePC58I+1wb05 ZkjjktMdlVK6lbmH0UYNir+MtYVtMftXqQ9a6qXVQGq1FRznqRXBSzHO5dxYZw== X-Gm-Gg: AeBDieuefH4pZZ6bWhxQtRJR0Nz1qIpaZJjSFCMrO1qnKP9ulXt5KPSwclxGXL8t5yj 8eqqNRd0veokzNWEIjdzM204h4Ce14bIdpq59iKfcHziG9yDCJ3Ul9NGQ9q39ScT2lGKtbBC0on ZdjYgdk9I0LcwEFJZmWHQbO3s3cHLojvKpBpxAOAO2ug+N6C0ziuC2stdZgnozGp0DXUCDohdkV tRSK85ht8S0RSHV0L8ns/OTCBH9+/XRivuojepi5REj5aQ41M+Kep6405jT4JeRrzinNiZiwU8i f69SlJk/rTHoXQEC5geU1VoJ3VswNV8MPAFalVqTy3sNnSJyf2qL8/tegSBTQx+qZYFbr4/gKw1 avXo+FvPLh2o/7ysgo9k59JRAvauZ/eiAqPq24qStPivS2V7fXbnPRcge6y574DH/MxYPwlA2nu zP77h5s1vcuQ4a5py4NoPGvY3tvDE+KrMHNfupIv5lXovkKXOFR+zFXoS7mXK1tEoeOUdWPXWV X-Received: by 2002:a05:600c:5295:b0:485:30d4:6b9e with SMTP id 5b1f17b1804b1-488fb77facemr443394935e9.21.1777029126071; Fri, 24 Apr 2026 04:12:06 -0700 (PDT) Received: from [192.168.178.118] (p4ffae9c7.dip0.t-ipconnect.de. [79.250.233.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4891cc7b2efsm216570435e9.0.2026.04.24.04.12.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Apr 2026 04:12:05 -0700 (PDT) Message-ID: Date: Fri, 24 Apr 2026 13:12:05 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 0/2] mcb: enable register PCI devices using any BAR To: Filip Jensen Cc: linux-kernel@vger.kernel.org, Jose Javier Rodriguez Barbarin References: <20260304132650.140680-1-dev-Felipe.Jensen@duagon.com> Content-Language: en-US From: Johannes Thumshirn In-Reply-To: <20260304132650.140680-1-dev-Felipe.Jensen@duagon.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 3/4/26 2:26 PM, Filip Jensen wrote: > V2 -> V3: Thanks for second review. Fixed declaring pci_dev outside of the > only block where it is needed in patch 1/2. > V1 -> V2: Thanks to the review from Johannes Thumshirn, the patch 2/3 of > the first version has been removed and the cleaner solution from patch 3/3 > is then kept. > > The PCI mcb driver is currently only able to register devices that use > the first PCI BAR. That is hardcoded in mcb-parse.c in lines 156-161: > > c = kzalloc_obj(struct chameleon_bar); > if (!c) > return -ENOMEM; > > bar_count = 1; > c->addr = mapbase; > > However, mcb devices can use other indexes of the 6 PCI BARs. This serie of > patches allows to use these devices by adding the relevant PCI BAR info to > the chameleon table. As this code must also work for lpc devices, it has > been done a refactoring in order to keep the two buses dependent operations > regarding bars (get_bar and is_io_mapped_bar) outside of the common parsing > code. These callback operations are stored in a structure and passed over > to the parser, thus rendering each module, the mcb-lpc and mcb-pci, only > with their own bus relevant logic. > > This patch depends on the previously accepted patch: > Link: https://lore.kernel.org/lkml/20260217075124.10052-1-dev-Felipe.Jensen@duagon.com/ > > Reviewed-by: Jose Javier Rodriguez Barbarin Added to mcb-for-next. Sorry for the delay. Byte,     Johannes