Commit Graph

3 Commits

Author SHA1 Message Date
Myron Stowe cb44949cfc PCI: hisi-error: Convert to platform remove callback returning void
JIRA: https://issues.redhat.com/browse/RHEL-2570
Upstream Status: 9a285fbbb591428de0cde7f553130e7c728a2e19

commit 9a285fbbb591428de0cde7f553130e7c728a2e19
Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date:   Tue Mar 21 20:32:00 2023 +0100

    PCI: hisi-error: Convert to platform remove callback returning void

    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is (mostly) ignored
    and this typically results in resource leaks. To improve here there is a
    quest to make the remove callback return void. In the first step of this
    quest all drivers are converted to .remove_new() which already returns
    void.

    Trivially convert this driver from always returning zero in the remove
    callback to the void returning variant.

    Link: https://lore.kernel.org/linux-pci/20230321193208.366561-8-u.kleine-koenig@pengutronix.de
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2023-09-19 13:32:23 -06:00
Myron Stowe f8853e94db PCI: Remove MODULE_LICENSE so boolean drivers don't look like modules
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2179137
Upstream Status: f98954b293d0a0f9646117af75c82c1b89191c53

commit f98954b293d0a0f9646117af75c82c1b89191c53
Author: Nick Alcock <nick.alcock@oracle.com>
Date:   Thu Feb 16 15:24:04 2023 +0000

    PCI: Remove MODULE_LICENSE so boolean drivers don't look like modules

    Since 8b41fc4454 ("kbuild: create modules.builtin without
    Makefile.modbuiltin or tristate.conf"), MODULE_LICENSE declarations are
    used to identify modules. As a consequence, MODULE_LICENSE in non-modules
    causes modprobe to misidentify the object file as a module when it is not,
    and modprobe might succeed rather than failing with a suitable error
    message.

    For tristate modules that can be either built-in or loaded at runtime,
    modprobe succeeds in both cases:

      # modprobe ext4
      [exit status zero if CONFIG_EXT4_FS=y or =m]

    For boolean modules like the Standard Hot Plug Controller driver (shpchp)
    that cannot be loaded at runtime, modprobe should always fail like this:

      # modprobe shpchp
      modprobe: FATAL: Module shpchp not found in directory /lib/modules/...
      [exit status non-zero regardless of CONFIG_HOTPLUG_PCI_SHPC]

    but prior to this commit, shpchp_core.c contained MODULE_LICENSE, so
    "modprobe shpchp" silently succeeded when it should have failed.

    Remove MODULE_LICENSE in files that cannot be built as modules.

    [bhelgaas: commit log, squash]
    Suggested-by: Luis Chamberlain <mcgrof@kernel.org>
    Link: https://lore.kernel.org/r/20230216152410.4312-1-nick.alcock@oracle.com/
    Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Cc: Luis Chamberlain <mcgrof@kernel.org>
    Cc: Hitomi Hasegawa <hasegawa-hitomi@fujitsu.com>
    Cc: Rob Herring <robh@kernel.org>
    Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2023-03-29 08:56:44 -06:00
Yicong Yang acb52897cc PCI: hip: Add handling of HiSilicon HIP PCIe controller errors
The HiSilicon HIP PCIe controller is capable of handling errors
on root port and performing port reset separately at each root port.

Add error handling driver for HIP PCIe controller to log
and report recoverable errors. Perform root port reset and restore
link status after the recovery.

Following are some of the PCIe controller's recoverable errors
1. completion transmission timeout error.
2. CRS retry counter over the threshold error.
3. ECC 2 bit errors
4. AXI bresponse/rresponse errors etc.

The driver placed in the drivers/pci/controller/ because the
HIP PCIe controller does not use DWC IP.

Link: https://lore.kernel.org/r/20200903123456.1823-3-shiju.jose@huawei.com
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
2020-09-16 10:30:42 +01:00