Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4899861rwb; Tue, 8 Aug 2023 16:14:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG0DRarBTPZwTbIyY0FPVeVJLVl4Phdi10bFbrQ1tyHfTUJ9BGlzEUdnlJ6A+CG2wXXosnJ X-Received: by 2002:a17:902:e746:b0:1bb:3979:d467 with SMTP id p6-20020a170902e74600b001bb3979d467mr1063235plf.63.1691536446681; Tue, 08 Aug 2023 16:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691536446; cv=none; d=google.com; s=arc-20160816; b=sS+ZyR17AVWLw7vwWoz1gQjf+KiYfmivJENo8pvc1WR2aYtisYRhnPgDRownBT+oUE yzdHdD8qRA475EuxARPEhcnOzQas4oPs2+AbZp5GkB55fWpWycwXrBtVlERTGaU0PONV 3sMQ6wYQI4r1vrmIe+Y3gLoS6uXBxBHSfzmrG4ARO0aRus4x3Iw+bO5DEUnGizWcO+d2 4S0Zpw9VQ/UiBNETA5b5hwI+HRWYMj/cR3LohHfxCabQ1TcVxhQhwen6VUwvkrIOqxYA WF8c6KfX95iwgxky3gJCqtMLiFIiBm4fFQ/FNS2KnUfh4ECftM7hcJf53YYqc9qBqa6D gCgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=JA6j7VS/rS3yDsG08S2JG8LrZ8nNHZxEMEtKtxMZ+D4=; fh=Tznq2zVJx77OtQW9jPXAQrvBFilyRuBw8ud/AudfOKE=; b=U9lP80KdSxu4mRilmBC4aOkekHivS0nzIr+Gmgeh2B6ULs9abP/FhqlxmaZMuYbshp /DuJbFySNUO++6sZHzIBMTiEmWiqQXM8jcYAn1Bh4yEyhQfgXNzLwrvRepIXUSLVSEWG bvOVdEDodclI276nc9oSYHNlH4a7W+55VEwfaP/Xem7fY2PEB7FPg8TFHuF7f6SiBvP1 2UkEzXGGKTT1LRSsoH3arQhDwE8ibeCNpEj0+yZGc8aNM02ZjRxY7my+1UihDyWgBpsA 97nUlhVw6xwmbH+7WFFO/7I1j3S3Foq7ZIsmB7uFxArUIrrpxdOCt8GoTYU8gH5lQLQA RNsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kb12-20020a170903338c00b001b89ecd8e66si7694621plb.188.2023.08.08.16.13.54; Tue, 08 Aug 2023 16:14:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229519AbjHHVby convert rfc822-to-8bit (ORCPT + 99 others); Tue, 8 Aug 2023 17:31:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjHHVbw (ORCPT ); Tue, 8 Aug 2023 17:31:52 -0400 Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2562A91; Tue, 8 Aug 2023 14:31:52 -0700 (PDT) Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-6bb1133b063so980114a34.1; Tue, 08 Aug 2023 14:31:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691530311; x=1692135111; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dar5Gf1UmWSsQg1cGFlHubc+7wJ03BPupNvzSWN3N8E=; b=AEUTKNCJEJgm5HPDFVmLUeJeK4kWnCDKMU/kmaOU8XNcahqUJePV6RjlAUymQ3NLwC oUSQ7jV+AWr5p4WQNxXjgiROHKINIevaKNe8L2/qPvP/x8yWcMUf2YI/e0Xz6fbwvjE+ gODCl8PPfVJnON4YocuKo2zlhuM5odZqD5XOaqc63wFT8ltkNqAbnNUqbcKZo0pdAxCV kWuXZE5/UXs/taMpelYAoJVWemnPSoObklV7NYGFpYmTcHjQjMJh6OeA71entQEkjGos nudaYP+ctNGzAgthPjTuN+QHiOlihBIBMy6fTPgpj8FgdvRl0k0YIVmIUZq6J24Zl4CU ZjnQ== X-Gm-Message-State: AOJu0Yxn6HSLtvHHBuRg+CqjymWCg7Gm9jUUDPPc+W86WmtbpF08M+rB QL/CC1aX49CvaZqORytH/CQu6Y4M3mIgkhtZifA= X-Received: by 2002:a4a:2c42:0:b0:560:b01a:653d with SMTP id o63-20020a4a2c42000000b00560b01a653dmr1006343ooo.0.1691530311356; Tue, 08 Aug 2023 14:31:51 -0700 (PDT) MIME-Version: 1.0 References: <20230808205800.GA332785@bhelgaas> In-Reply-To: <20230808205800.GA332785@bhelgaas> From: "Rafael J. Wysocki" Date: Tue, 8 Aug 2023 23:31:40 +0200 Message-ID: Subject: Re: [PATCH] PCI: acpiphp: Log more slot and notification details To: Bjorn Helgaas Cc: "Rafael J. Wysocki" , linux-pci@vger.kernel.org, Len Brown , Igor Mammedov , "Michael S . Tsirkin" , Woody Suwalski , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 8, 2023 at 10:58 PM Bjorn Helgaas wrote: > > On Tue, Aug 08, 2023 at 09:39:22PM +0200, Rafael J. Wysocki wrote: > > On Tue, Aug 8, 2023 at 9:27 PM Bjorn Helgaas wrote: > > > From: Bjorn Helgaas > > > > > > When registering an acpiphp slot, log the slot name in the same style as > > > pciehp and include the PCI bus/device and whether a device is present or > > > the slot is empty. > > > > > > When handling an ACPI notification, log the PCI bus/device and notification > > > type. > > > > > > Sample dmesg log diff: > > > > > > ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff]) > > > - acpiphp: Slot [3] registered > > > - acpiphp: Slot [4] registered > > > PCI host bridge to bus 0000:00 > > > pci 0000:00:03.0: [8086:100e] type 00 class 0x020000 > > > > > > pci 0000:00:04.0: [8086:100e] type 00 class 0x020000 > > > > > > ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff]) > > > + acpiphp: pci 0000:00:03 Slot(3) registered (enabled) > > > + acpiphp: pci 0000:00:04 Slot(4) registered (empty) > > > PCI host bridge to bus 0000:00 > > > pci 0000:00:03.0: [8086:100e] type 00 class 0x020000 > > > > > > + acpiphp: pci 0000:00:04 Slot(4) Device Check > > > pci 0000:00:04.0: [8086:100e] type 00 class 0x020000 > > > ... > > > > @@ -793,6 +804,14 @@ static void hotplug_event(u32 type, struct acpiphp_context *context) > > > > > > pci_lock_rescan_remove(); > > > > > > + pr_info("pci %04x:%02x:%02x Slot(%s) %s\n", > > > + pci_domain_nr(slot->bus), slot->bus->number, > > > + slot->device, slot_name(slot->slot), > > > + type == ACPI_NOTIFY_BUS_CHECK ? "Bus Check" : > > > + type == ACPI_NOTIFY_DEVICE_CHECK ? "Device Check" : > > > + type == ACPI_NOTIFY_EJECT_REQUEST ? "Eject Request" : > > > + "Notification"); > > > > pr_debug() perhaps? > > > > On systems that don't have any hotplug problems these messages will > > just be filling the kernel log unnecessarily. > > If these notifications are really common, pr_debug() sounds like the > right thing. I assumed that they would not be common, e.g., they > would happen for user-time things like dock/undock, plug/unplug, > suspend/resume, etc. > > In pciehp, we use _info for attention button presses, presence detect > changes, link up/down, and I assumed the ACPI notify events would > roughly correspond to those. No? Depending on how often the system gets suspended and resumed, they may end up in the log quite often and if there are no problems related to them, they are just noise. IMHO in that case the users are taught to ignore stuff that lands in the log which is not fantastic.