diff mbox

[1/1] UBUNTU: SAUCE: storvsc: use small sg_tablesize on x86

Message ID 96b9c1de3fa661a07acab3d61cb9cc39b21d05c5.1444930545.git.joseph.salisbury@canonical.com
State New
Headers show

Commit Message

Joseph Salisbury Oct. 15, 2015, 5:53 p.m. UTC
BugLink: http://bugs.launchpad.net/bugs/1495983

OriginalAuthor: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
---
 drivers/scsi/storvsc_drv.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Seth Forshee Oct. 15, 2015, 7:40 p.m. UTC | #1
On Thu, Oct 15, 2015 at 01:53:12PM -0400, Joseph Salisbury wrote:
> BugLink: http://bugs.launchpad.net/bugs/1495983
> 
> OriginalAuthor: Olaf Hering <olaf@aepfle.de>
> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>

Looks like upstream they're looking for a more generic "this is a 32-bit
arch" rather than "this is 32-bit x86" as this patch does. For our
purposes this patch should be fine though.
Brad Figg Oct. 15, 2015, 7:54 p.m. UTC | #2
On Thu, Oct 15, 2015 at 01:53:12PM -0400, Joseph Salisbury wrote:
> BugLink: http://bugs.launchpad.net/bugs/1495983
> 
> OriginalAuthor: Olaf Hering <olaf@aepfle.de>
> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
> ---
>  drivers/scsi/storvsc_drv.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 3c6584f..8d9c504 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -1849,6 +1849,11 @@ static int storvsc_probe(struct hv_device *device,
>  	 * from the host.
>  	 */
>  	host->sg_tablesize = (stor_device->max_transfer_bytes >> PAGE_SHIFT);
> +#if defined(CONFIG_X86_32)
> +	dev_warn(&device->device, "adjusting sg_tablesize 0x%x -> 0x%x",
> +			host->sg_tablesize, MAX_MULTIPAGE_BUFFER_COUNT);
> +	host->sg_tablesize = MAX_MULTIPAGE_BUFFER_COUNT;
> +#endif
>  
>  	/* Register the HBA and start the scsi bus scan */
>  	ret = scsi_add_host(host, &device->device);
> -- 
> 2.1.0
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Positive testing.
Andy Whitcroft Oct. 16, 2015, 10:14 a.m. UTC | #3
On Thu, Oct 15, 2015 at 01:53:12PM -0400, Joseph Salisbury wrote:
> BugLink: http://bugs.launchpad.net/bugs/1495983
> 
> OriginalAuthor: Olaf Hering <olaf@aepfle.de>
> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
> ---
>  drivers/scsi/storvsc_drv.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 3c6584f..8d9c504 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -1849,6 +1849,11 @@ static int storvsc_probe(struct hv_device *device,
>  	 * from the host.
>  	 */
>  	host->sg_tablesize = (stor_device->max_transfer_bytes >> PAGE_SHIFT);
> +#if defined(CONFIG_X86_32)
> +	dev_warn(&device->device, "adjusting sg_tablesize 0x%x -> 0x%x",
> +			host->sg_tablesize, MAX_MULTIPAGE_BUFFER_COUNT);
> +	host->sg_tablesize = MAX_MULTIPAGE_BUFFER_COUNT;
> +#endif
>  
>  	/* Register the HBA and start the scsi bus scan */
>  	ret = scsi_add_host(host, &device->device);

This feels like it could raise the limit if max_transfer_bytes is < than
MAX_MULTIPAGE_BUFFER_COUNT.  I rather feel it should be a min(), but if
this is what is being applied upstream ...

-apw
Brad Figg Oct. 23, 2015, 6:28 p.m. UTC | #4
Applied to the master-next branch of Wily.
diff mbox

Patch

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 3c6584f..8d9c504 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1849,6 +1849,11 @@  static int storvsc_probe(struct hv_device *device,
 	 * from the host.
 	 */
 	host->sg_tablesize = (stor_device->max_transfer_bytes >> PAGE_SHIFT);
+#if defined(CONFIG_X86_32)
+	dev_warn(&device->device, "adjusting sg_tablesize 0x%x -> 0x%x",
+			host->sg_tablesize, MAX_MULTIPAGE_BUFFER_COUNT);
+	host->sg_tablesize = MAX_MULTIPAGE_BUFFER_COUNT;
+#endif
 
 	/* Register the HBA and start the scsi bus scan */
 	ret = scsi_add_host(host, &device->device);