summaryrefslogtreecommitdiffstats
path: root/platform-intel.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* platform-intel: refactor path_attached_to_hba()Mateusz Kusiak2024-08-301-1/+1
| | | | | | | dprintf() call in path_attached_to_hba() is too noisy. Remove the call and refactor the function. Remove obsolete env variables check. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
* imsm: refactor RAID level handlingMateusz Kusiak2024-05-071-18/+14
| | | | | | | | | | | | | | | | | Add imsm_level_ops struct for better handling and unifying raid level support. Add helper methods and move "orom_has_raid[...]" methods from header to source file. RAID 1e is not supported under Linux, remove RAID 1e associated code. Refactor imsm_analyze_change() and is_raid_level_supported(). Remove hardcoded check for 4 drives and make devNumChange a multiplier for RAID 10. Refactor printing supported raid levels. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
* imsm: test_and_add_device_policies() implementationMariusz Tkaczyk2024-03-111-1/+0
| | | | | | | | This patch removes get_disk_controller_domain_imsm() in favour of test_and_add_device_policies_imsm(). It is used by create, add and mdmonitor. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
* imsm: Add reading vmd register for finding imsm capabilityMateusz Grzonka2023-09-011-1/+10
| | | | | | | | | | | | Currently mdadm does not find imsm capability when running inside VM. This patch adds the possibility to read from vmd register and check for capability, effectively allowing to use mdadm with imsm inside virtual machines. Additionally refactor find_imsm_capability() to make assignments in new lines. Signed-off-by: Mateusz Grzonka <mateusz.grzonka@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
* platform-intel: limit guid lengthKinga Tanska2023-09-011-1/+4
| | | | | | | | Moving GUID_STR_MAX to header to use it as a length limitation for snprintf function. Signed-off-by: Kinga Tanska <kinga.tanska@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
* enable RAID for SATA under VMDKevin Friedberg2023-05-081-0/+1
| | | | | | | | | | Detect when a SATA controller has been mapped under Intel Alderlake RST VMD, so that it can use the VMD controller's RAID capabilities. Create new device type SYS_DEV_SATA_VMD and list separate controller to prevent mixing with the NVMe SYS_DEV_VMD devices on the same VMD domain. Signed-off-by: Kevin Friedberg <kev.friedberg@gmail.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
* imsm: Limit support to the lowest namespaceMariusz Tkaczyk2021-05-261-1/+1
| | | | | | | | First namespace existence is not quaranted by NVMe specification. Instead first the smallest one shall be chosen. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* imsm: add devpath_to_char methodMariusz Tkaczyk2021-05-261-0/+2
| | | | | | | Add method for reading sysfs attributes and propagate it across IMSM code. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* imsm: add generic method to resolve "device" linksMariusz Tkaczyk2021-05-261-2/+2
| | | | | | | | | | | | | | | | | | | Each virtual device is linked with parent by "device". This patch adds possibility to get previous device in sysfs tree. Depending on device type, there is a different amount of virutal layers. The best we can do is allow to directly specify how many "device" links need to be resolved. This approach also allows to get previous virtual device, which may contain some attributes. Simplify fd2devname, this function doesn't require new functionality and shall use generic fd2kname. For nvme drives represented via nvme-subystem when path to block device if requested, then return it without translation. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* imsm: nvme multipath supportBlazej Kucman2021-03-161-0/+2
| | | | | | | | | | | Add support for nvme devices which are represented via nvme-subsystem. Print warning when multi-path disk is added to RAID. Signed-off-by: Oleksandr Shchirskyi <oleksandr.shchirskyi@intel.com> Signed-off-by: Blazej Kucman <blazej.kucman@intel.com> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* imsm: limit support to first NVMe namespaceMariusz Tkaczyk2020-11-261-0/+1
| | | | | | Due to metadata limitations NVMe multinamespace support has to be removed. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
* Remove unused codeXiao Ni2019-12-021-1/+0
| | | | | Signed-off-by: Xiao Ni <xni@redhat.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* imsm: count arrays under VMD HBAs correctlyAlexey Obitotskiy2017-01-091-0/+1
| | | | | | | | | | | | | | | OROM defines maximum number of arrays supported. On array creation mdadm checks if number of arrays doesn't exceed that limit, however it is not calculated correctly for VMD now. The current code performs a lookup of HBA using the id. VMD HBAs have the same id so each lookup returns the same structure (first encountered). Take a different approach for VMD HBAs. As id is not unique and cannot be used for lookups, iterate over all VMD HBAs and compare both id and HBA path. Signed-off-by: Alexey Obitotskiy <aleksey.obitotskiy@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
* IMSM: Add support for Non-Intel NVMe drives under VMDPawel Baldysiak2016-12-121-0/+7
| | | | | | | | | | This patch adds checking if platform (preOS) supports non-Intel NVMe drives under VMD domain, and - if so - allow creating IMSM Raid Volume with those drives. Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
* IMSM: Add support for VMDPawel Baldysiak2016-01-061-0/+4
| | | | | | | | | | | | | The Intel Volume Management Device (VMD) is an integrated endpoint on the platform's PCIe root complex that acts as a host bridge to a secondary PCIe domain. This patch adds proper handling of NVMe devices attached to VMD domain. Each VMD domain is treated as a separate controller (HBA). Spanning between domains is forbidden. Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com> Signed-off-by: NeilBrown <neilb@suse.com>
* IMSM: Count arrays per oromPawel Baldysiak2015-04-091-0/+1
| | | | | | | | | | | Active arrays with IMSM metadata are counted per hba so far. This is bad due to new functionality of orom shared between multiple controllers i.e. more arrays can be created than is supported by orom. This patch changes the way of counting arrays, so the result will be sum of arrays under every hba supported by specific orom. Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: simplified multiple OROMs supportArtur Paszkiewicz2015-03-041-1/+3
| | | | | | | | | Replaced oroms array with list, add_orom() now only appends to this list and add_orom_device_id() only appends devid_list node to an orom_entry. Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Don't break long strings onto multiple lines.NeilBrown2015-02-121-2/+1
| | | | | | | | | | | | | | | | | It is best to keep strings all together so that they are easier to search for in the source code. If a string is so long that it looks ugly one line, them maybe it should be broken into multiple lines for display too. Only strings which contain a newline can be broken into multiple lines: "It is OK to\n" "break this string\n" Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: detail-platform improvementsArtur Paszkiewicz2014-11-251-0/+23
| | | | | | | | | | Print platform details per OROM, not per controller, differentiate RST(e) platforms from legacy IMSM, print NVMe device paths, adjust port printing to newer sysfs path. Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: add support for NVMe devicesPawel Baldysiak2014-11-251-0/+5
| | | | | | | | Recognize Intel(R) NVMe devices as IMSM-capable. Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com> Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: support for OROMs shared by multiple HBAsArtur Paszkiewicz2014-11-251-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The IMSM platform code was based on an assumption that the OROM or UEFI capability structure (represented by struct imsm_orom) always belongs to only one HBA. This assumption is no longer valid, because of newer platforms with dual AHCI HBAs. Each HBA can have a separate OROM, but some versions have a combined OROM for both HBAs. This patch implements this HBA-OROM relationship in struct orom_entry, which matches an OROM with a list of HBA PCI ids. All the detected orom_entries are stored and retrieved using a global array and the functions add_orom(), add_orom_device_id() and get_orom_by_device_id(). This replaces the arrays: imsm_orom, populated_orom, imsm_efi, populated_efi. The scan() function is extended to find all HBAs for an OROM. The list of their device ids is retrieved from the PCI Expansion ROM Data Structure, hence the additional field devListOffset in struct pciExpDataStructFormat. In UEFI mode we can't read the PCI Expansion ROM Data Structure and the imsm_orom structures are stored in UEFI variables. They do not provide a similar device id list, so we also check the HBA PCI class to make sure that the HBA has RAID mode enabled. In super-intel.c there are changes which allow spanning of IMSM containers over HBAs of the same type, but only if the HBAs share the same OROM. This is done by comparing imsm_orom pointers, which (outside of platform-intel.c) always point to the global array containing all the detected oroms. Additional warnings are added to validate_container_imsm() to warn about potentially dangerous operations in all the possible cases, e.g. when an array is assembled using disks attached to HBAs with separate OROMs. Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* IMSM: Add warning message when assemble spanned containerPawel Baldysiak2014-07-081-0/+1
| | | | | | | | | | | Due to several changes in code assemble with disks spanned between different controllers can be obtained in some cases. After IMSM container will be assembled, check HBA of disks, and print proper warning if mismatch is detected. Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com> Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Remove lots of unnecessary white space.NeilBrown2013-06-191-2/+0
| | | | | | | Now that I am using white-space mode in Emacs I can see all of this, and I don't like it :-) Signed-off-by: NeilBrown <neilb@suse.de>
* platform-intel - cache 'intel_devices' for a few seconds.NeilBrown2013-01-071-1/+0
| | | | | | | | | find_intel_devices() has take a little while to run as it scans some directory tree, and the result isn't likely to change often. So cache the value and only discard it after 10 seconds. Signed-off-by: NeilBrown <neilb@suse.de>
* show 2TB volumes/disks support in --detail-platformCzarnowska, Anna2012-04-021-0/+1
| | | | | Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* fix: imsm: validate strip size - tuned upHawrylewicz Czarnowski, Przemyslaw2011-12-071-4/+3
| | | | | | | | Neil's proposal seems more reasonable and shows what is really going on here. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: fix: does not allow to use invalid chunk sizePrzemyslaw Czarnowski2011-12-061-1/+3
| | | | | | | | | Only least significant bit of chunk size provided by user has been used in test with OROM capabilities. This way user could pass value which is not a power of 2. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: fix default chunk in the !orom caseDan Williams2011-07-191-16/+0
| | | | | | | | | Set a valid default in the !orom case, otherwise we segfault, or otherwise fail. Cc: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* platfrom_intel: find OROM based on Intel AHCI and SAS driver device idLabun, Marcin2011-03-141-0/+1
| | | | | | | | | | | We use PCI device id exposed by AHCI and ISCU drivers (SAS controller) to find OROM version table. In this way there is no need to maintain AHCI and ISCU device id list in mdadm. The consequence is that the OROM properties can be found by mdadm when AHCI or SAS drivers are loaded in the system. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Some guid manipulation utilities has been added.Labun, Marcin2011-03-101-0/+15
| | | | | | | It will be used for reading efi variables with capabilities. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* update of imsm_orom structureLabun, Marcin2011-03-101-2/+14
| | | | | | | | | The structure is update according to current specification. These values are not used right now, but they are not "reserved" anymore. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Platform-intel: support for OROM SAS and AHCI controllerLabun, Marcin2011-03-101-2/+6
| | | | | Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm platform: support for Intel(R) SAS controller.Labun Marcin2011-01-261-0/+16
| | | | | | | | | This patch adds platform support for SAS controller(s) built in Intel(R) Patsburg chipset. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: Artur Wojcik <artur.wojcik@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* create: Check with OROM limit before setting default chunk sizeDave Jiang2010-06-161-0/+49
| | | | | | | | | | Make create check with the appropriate meta data handler and see what the largest chunk size is supported. The current 512K default is not supported by existing imsm OROM. [dan.j.williams@intel.com: trim the upper limit to 512k for future oroms] Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: validate arrays being created against firmware capabilitiesDan Williams2008-12-091-0/+37
| | | | | | | | | | | | | | | These checks are only enabled when platform support for imsm is found, i.e. ahci driver is loaded and talking to an Intel(R) controller, and the option rom header is located. They can be turned off by setting the environment variable IMSM_NO_PLATFORM to 1. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: sysfs support routines for determining device connectivityDan Williams2008-12-091-0/+3
| | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: detect option-rom capabilitiesDan Williams2008-12-091-0/+89
The option-rom advertises its capabilities in a data structure located in the platform ROM region 0xc0000-0xf0000. Attempt to detect the option-rom and limit array creation to the platform's capabilities. Signed-off-by: Dan Williams <dan.j.williams@intel.com>