* [PATCH] Let AHCI dirver skip Lenovo SWRAID controller
@ 2016-01-25 3:11 Ocean HY1 He
2016-01-25 9:56 ` Christoph Hellwig
2016-01-25 13:18 ` One Thousand Gnomes
0 siblings, 2 replies; 5+ messages in thread
From: Ocean HY1 He @ 2016-01-25 3:11 UTC (permalink / raw)
To: tj@kernel.org, linux-ide@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Ocean HY1 He
Lenovo SWRAID solution is based on Intel Non-RSTE RAID controller which
is called Lenovo SWRAID controller by set Lenovo dedicated PCI
SVID:SDID.
Because AHCI driver now take control this Lenovo SWRAID controller for
MDRAID, Lenovo SWRAID driver fails to load later. It's not proper to
disable AHCI driver, because system has SATA contoller used for SATA
DVD, M.2 etc. There is no chance to load Lenovo SWRAID first, because
almost all Linux distros load AHCI driver first during installation.
As default, when Lenovo SWRAID controller is detected, let AHCI driver
skip it thus MDRAID is disabled. Use the boot option 'ahci.lenovo_swraid=0'
could disable Lenovo SWRAID.
Signed-off-by: Ocean He <hehy1@lenovo.com>
---
drivers/ata/ahci.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 594fcab..8ec51a6 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -557,6 +557,35 @@ static int marvell_enable = 1;
module_param(marvell_enable, int, 0644);
MODULE_PARM_DESC(marvell_enable, "Marvell SATA via AHCI (1 = enabled)");
+static int lenovo_swraid = 1;
+module_param(lenovo_swraid, int, 0644);
+MODULE_PARM_DESC(lenovo_swraid, "SWRAID via SATA(RAID mode) (1 = enable (default))");
+
+static int lenovo_swraid_enable(struct pci_dev *pdev)
+{
+ if (!lenovo_swraid)
+ return 0;
+
+ /* Lenovo Gen6 Servers */
+ if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
+ (pdev->device == 0xa186 || pdev->device == 0xa206) &&
+ pdev->subsystem_vendor == 0x1d49) {
+ dev_info(&pdev->dev,
+ "Skip SATA controller for Lenovo SWRAID.\n");
+ return -ENODEV;
+ }
+
+ /* Lenovo Gen5 Servers */
+ if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
+ pdev->device == 0x8d06 &&
+ pdev->subsystem_vendor == 0x17aa) {
+ dev_info(&pdev->dev,
+ "Skip SATA controller for Lenovo SWRAID.\n");
+ return -ENODEV;
+ }
+
+ return 0;
+}
static void ahci_pci_save_initial_config(struct pci_dev *pdev,
struct ahci_host_priv *hpriv)
@@ -1466,6 +1495,10 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (pdev->vendor == PCI_VENDOR_ID_MARVELL && !marvell_enable)
return -ENODEV;
+ /* Let AHCI driver skip the Lenovo SWRAID controller. */
+ if (lenovo_swraid_enable(pdev))
+ return -ENODEV;
+
/* Apple BIOS on MCP89 prevents us using AHCI */
if (is_mcp89_apple(pdev))
ahci_mcp89_apple_enable(pdev);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Let AHCI dirver skip Lenovo SWRAID controller
2016-01-25 3:11 [PATCH] Let AHCI dirver skip Lenovo SWRAID controller Ocean HY1 He
@ 2016-01-25 9:56 ` Christoph Hellwig
2016-01-25 13:18 ` One Thousand Gnomes
1 sibling, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2016-01-25 9:56 UTC (permalink / raw)
To: Ocean HY1 He
Cc: tj@kernel.org, linux-ide@vger.kernel.org,
linux-kernel@vger.kernel.org
On Mon, Jan 25, 2016 at 03:11:40AM +0000, Ocean HY1 He wrote:
> Lenovo SWRAID solution is based on Intel Non-RSTE RAID controller which
> is called Lenovo SWRAID controller by set Lenovo dedicated PCI
> SVID:SDID.
>
> Because AHCI driver now take control this Lenovo SWRAID controller for
> MDRAID, Lenovo SWRAID driver fails to load later.
And that's a good thing!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Let AHCI dirver skip Lenovo SWRAID controller
2016-01-25 3:11 [PATCH] Let AHCI dirver skip Lenovo SWRAID controller Ocean HY1 He
2016-01-25 9:56 ` Christoph Hellwig
@ 2016-01-25 13:18 ` One Thousand Gnomes
2016-01-26 12:42 ` Ocean HY1 He
1 sibling, 1 reply; 5+ messages in thread
From: One Thousand Gnomes @ 2016-01-25 13:18 UTC (permalink / raw)
To: Ocean HY1 He
Cc: tj@kernel.org, linux-ide@vger.kernel.org,
linux-kernel@vger.kernel.org
On Mon, 25 Jan 2016 03:11:40 +0000
Ocean HY1 He <hehy1@lenovo.com> wrote:
> Lenovo SWRAID solution is based on Intel Non-RSTE RAID controller which
> is called Lenovo SWRAID controller by set Lenovo dedicated PCI
> SVID:SDID.
>
> Because AHCI driver now take control this Lenovo SWRAID controller for
> MDRAID, Lenovo SWRAID driver fails to load later. It's not proper to
> disable AHCI driver, because system has SATA contoller used for SATA
> DVD, M.2 etc. There is no chance to load Lenovo SWRAID first, because
> almost all Linux distros load AHCI driver first during installation.
>
> As default, when Lenovo SWRAID controller is detected, let AHCI driver
> skip it thus MDRAID is disabled. Use the boot option 'ahci.lenovo_swraid=0'
> could disable Lenovo SWRAID.
You need to submit the Lenovo SWRAID driver to the kernel first.
Otherwise this breaks things.
Alan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Let AHCI dirver skip Lenovo SWRAID controller
2016-01-25 13:18 ` One Thousand Gnomes
@ 2016-01-26 12:42 ` Ocean HY1 He
2016-01-26 13:24 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Ocean HY1 He @ 2016-01-26 12:42 UTC (permalink / raw)
To: One Thousand Gnomes
Cc: tj@kernel.org, linux-ide@vger.kernel.org,
linux-kernel@vger.kernel.org
Hi Alan,
Thanks for your comments!
Lenovo SWRAID driver is a closed source driver at this time, I am afraid
it's not possible to submit it to kernel.
This patch is very important and critical for Lenovo next generation
Servers. I have tried to make sure this patch only impacts Lenovo
dedicated hardware and add a on/off boot option to end user who may
still wants using open source SWRAID(such as MDRAID).
I am a newbie to submit patch to kernel, so I am not so clear about what
my patch breaks. Could you kindly explain that and is there a workaround
or solution to avoid the break?
Thanks a lot!
Ocean.
On 01/25/2016 09:18 PM, One Thousand Gnomes wrote:
> On Mon, 25 Jan 2016 03:11:40 +0000
> Ocean HY1 He <hehy1@lenovo.com> wrote:
>
>> Lenovo SWRAID solution is based on Intel Non-RSTE RAID controller which
>> is called Lenovo SWRAID controller by set Lenovo dedicated PCI
>> SVID:SDID.
>>
>> Because AHCI driver now take control this Lenovo SWRAID controller for
>> MDRAID, Lenovo SWRAID driver fails to load later. It's not proper to
>> disable AHCI driver, because system has SATA contoller used for SATA
>> DVD, M.2 etc. There is no chance to load Lenovo SWRAID first, because
>> almost all Linux distros load AHCI driver first during installation.
>>
>> As default, when Lenovo SWRAID controller is detected, let AHCI driver
>> skip it thus MDRAID is disabled. Use the boot option 'ahci.lenovo_swraid=0'
>> could disable Lenovo SWRAID.
>
> You need to submit the Lenovo SWRAID driver to the kernel first.
> Otherwise this breaks things.
>
> Alan
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Let AHCI dirver skip Lenovo SWRAID controller
2016-01-26 12:42 ` Ocean HY1 He
@ 2016-01-26 13:24 ` Christoph Hellwig
0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2016-01-26 13:24 UTC (permalink / raw)
To: Ocean HY1 He
Cc: One Thousand Gnomes, tj@kernel.org, linux-ide@vger.kernel.org,
linux-kernel@vger.kernel.org
On Tue, Jan 26, 2016 at 12:42:43PM +0000, Ocean HY1 He wrote:
> Hi Alan,
>
> Thanks for your comments!
>
> Lenovo SWRAID driver is a closed source driver at this time, I am afraid
> it's not possible to submit it to kernel.
So you're violating our copyright and want help for that? Be ashamed!
> This patch is very important and critical for Lenovo next generation
> Servers. I have tried to make sure this patch only impacts Lenovo
> dedicated hardware and add a on/off boot option to end user who may
> still wants using open source SWRAID(such as MDRAID).
The right ting is to always use mdraid and contribute the lenovo
superblock format to it, similar to how we support half a dozen other
non-native formats.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-01-26 13:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-25 3:11 [PATCH] Let AHCI dirver skip Lenovo SWRAID controller Ocean HY1 He
2016-01-25 9:56 ` Christoph Hellwig
2016-01-25 13:18 ` One Thousand Gnomes
2016-01-26 12:42 ` Ocean HY1 He
2016-01-26 13:24 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).