Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46081b16 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by James Bottomley
Browse files

[SCSI] st: Increase success probability in driver buffer allocation



Modify allocation to try the minimum possible page order allowed by the HBA
scatter/gather segment limit in allocation of the driver's internal
buffer. This increases the probability of successful allocation. The
allocation may still fail if this minimum order is > 0.

Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: default avatarKai Makisara <kai.makisara@kolumbus.fi>
Reported-by: default avatarLukas Kolbe <lkolbe@techfak.uni-bielefeld.de>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 373daacf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3729,7 +3729,8 @@ static int enlarge_buffer(struct st_buffer * STbuffer, int new_size, int need_dm
		b_size = PAGE_SIZE << order;
	} else {
		for (b_size = PAGE_SIZE, order = 0;
		     order < ST_MAX_ORDER && b_size < new_size;
		     order < ST_MAX_ORDER &&
			     max_segs * (PAGE_SIZE << order) < new_size;
		     order++, b_size *= 2)
			;  /* empty */
		STbuffer->reserved_page_order = order;